# Gateway startup fault due to access denied in Module Hook

**URL:** <https://forum.inductiveautomation.com/t/gateway-startup-fault-due-to-access-denied-in-module-hook/8859>\
**Category:** Ignition\
**Created:** [August 5, 2014, 6:10pm UTC](https://forum.inductiveautomation.com/t/gateway-startup-fault-due-to-access-denied-in-module-hook/8859 "2014-08-05T18:10:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rforbes](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@rforbes](https://forum.inductiveautomation.com/u/rforbes)\
**Post date:** [August 5, 2014, 6:10pm UTC](https://forum.inductiveautomation.com/t/gateway-startup-fault-due-to-access-denied-in-module-hook/8859/1 "2014-08-05T18:10:54Z")

</div>

I just upgraded to 7.7 on 64-bit Windows…I’m having trouble getting the Gateway to restart; it is faulted and I see this in the wrapper.log. Any suggestions?

INFO | jvm 1 | 2014/08/05 11:52:07 | INFO [ModuleManager] [11:52:07,535]: Setting up modules  
INFO [ModuleHook] [11:52:20,124]: JNI Library: C:\Windows\TEMP\jniwrap-3.8.3304715667401831135.Build.3.8.31966291242\jniwrap64.dll  
INFO | jvm 1 | 2014/08/05 11:52:20 | ERROR [SRContext] [11:52:20,156]: Error during context startup.  
INFO | jvm 1 | 2014/08/05 11:52:20 | java.lang.ExceptionInInitializerError  
INFO | jvm 1 | 2014/08/05 11:52:20 | at com.jniwrapper.win32.system.Kernel32.isUnicode(Kernel32.java:77)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at com.jniwrapper.win32.FunctionName.(FunctionName.java:24)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at com.jniwrapper.win32.MessageLoopThread.(MessageLoopThread.java:24)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at com.inductiveautomation.opccom.ModuleHook.setup(ModuleHook.java:176)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$LoadedModule.setup(ModuleManagerImpl.java:2189)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.setup(ModuleManagerImpl.java:265)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at com.inductiveautomation.ignition.gateway.SRContext.startupInternal(SRContext.java:1169)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at com.inductiveautomation.ignition.gateway.redundancy.RedundancyManagerImpl.startup(RedundancyManagerImpl.java:194)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at com.inductiveautomation.ignition.gateway.SRContext.asyncInit(SRContext.java:917)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at com.inductiveautomation.ignition.gateway.SRContext.access$200(SRContext.java:249)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at com.inductiveautomation.ignition.gateway.SRContext$2.run(SRContext.java:651)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:526)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at java.util.concurrent.FutureTask.run(FutureTask.java:266)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
INFO | jvm 1 | 2014/08/05 11:52:20 | at java.lang.Thread.run(Thread.java:745)  
INFO | jvm 1 | 2014/08/05 11:52:20 | Caused by: com.jniwrapper.JNIWrapperException: java.io.IOException: Access is denied  
INFO | jvm 1 | 2014/08/05 11:52:20 | Caused by: java.io.IOException: Access is denied  
INFO | jvm 1 | 2014/08/05 11:52:20 | INFO [SRContext] [11:52:20,171]: Ignition["/main", state=STARTING] ContextState = FAULTED

---

<div class="post-metadata">

**Author:** ![Duffanator](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/duffanator/32/3560_2.png) [@Duffanator](https://forum.inductiveautomation.com/u/Duffanator)\
**Post date:** [August 5, 2014, 6:14pm UTC](https://forum.inductiveautomation.com/t/gateway-startup-fault-due-to-access-denied-in-module-hook/8859/2 "2014-08-05T18:14:23Z")

</div>

Did you upgrade Java to version 8?

---

<div class="post-metadata">

**Author:** ![rforbes](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@rforbes](https://forum.inductiveautomation.com/u/rforbes)\
**Post date:** [August 8, 2014, 5:52pm UTC](https://forum.inductiveautomation.com/t/gateway-startup-fault-due-to-access-denied-in-module-hook/8859/3 "2014-08-08T17:52:14Z")

</div>

Yes, I upgraded to 1.8.

This is getting to be quite a problem; I can’t get the Gateway to come up at all now.

This is on 64-bit Windows 7.

java version info as follows:

$ java -version  
java version “1.8.0\_11”  
Java™ SE Runtime Environment (build 1.8.0\_11-b12)  
Java HotSpot™ 64-Bit Server VM (build 25.11-b03, mixed mode)

Rob

---

<div class="post-metadata">

**Author:** ![rforbes](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@rforbes](https://forum.inductiveautomation.com/u/rforbes)\
**Post date:** [August 8, 2014, 5:54pm UTC](https://forum.inductiveautomation.com/t/gateway-startup-fault-due-to-access-denied-in-module-hook/8859/4 "2014-08-08T17:54:08Z")

</div>

…wrapper log attached…  
[wrapper.log](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/0d6f8cdd24f11042096883433aba77071a6149b9.log) (67.7 KB)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 8, 2014, 6:05pm UTC](https://forum.inductiveautomation.com/t/gateway-startup-fault-due-to-access-denied-in-module-hook/8859/5 "2014-08-08T18:05:12Z")

</div>

Are you sure these are the right logs? They actually show the gateway starting up the second time…

The following:

```auto
INFO | jvm 1 | 2014/08/08 11:48:32 | INFO [ActivateSessionService] [11:48:32,132]: User "opcuauser" connected but could not authenticate. (invalid username or password)
INFO | jvm 1 | 2014/08/08 11:48:32 | WARN [ActivateSessionService] [11:48:32,132]: Returning ServiceFault for request: com.inductiveautomation.opcua.types.messages.ActivateSessionRequest@238167dd. StatusCode=StatusCode[Severity=Bad, Subcode=Bad_UserAccessDenied]
```

is the OPC-UA connection failing to authenticate, which is weird, but wouldn’t stop the gateway from starting.

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [August 11, 2014, 6:56pm UTC](https://forum.inductiveautomation.com/t/gateway-startup-fault-due-to-access-denied-in-module-hook/8859/6 "2014-08-11T18:56:57Z")

</div>

Hi,

Based on what I read, my _guess_ is that it’s potentially something about the way the temp files are generated/named… there have been various issues in the past that have been fixed in Java with symptoms like this, and then I’ve found other discussions from the particular library vendor talking about them fixing issues, maybe something regressed in Java 7 or 8?

Anyhow, in reading around, one possible cause is if the new temp file name clashes with an existing file. This is supposed to be unlikely, since the files are generated with random numbers. But if this problem is so reproducible for you, maybe we can help narrow down when & why it’s happening.

When you get the error, try the following:

1. Stop the Ignition service.
2. Go to C:\windows\temp and delete all of the folders that start with “jniwrap-\*”.
3. Start again, see if the error occurs. Try restarting a few times if you want.

If it keeps happening after this, or happens after a short period, maybe we can look at other causes.

Regards,

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [September 27, 2014, 2:49pm UTC](https://forum.inductiveautomation.com/t/gateway-startup-fault-due-to-access-denied-in-module-hook/8859/7 "2014-09-27T14:49:24Z")

</div>

I had the same problem. I followed Colby’s instructions to get it to work. After deleting temp files and restarting a few times it worked.

---

<div class="post-metadata">

**Author:** ![bneagu](https://avatars.discourse-cdn.com/v4/letter/b/50afbb/32.png) [@bneagu](https://forum.inductiveautomation.com/u/bneagu)\
**Post date:** [December 17, 2014, 1:45am UTC](https://forum.inductiveautomation.com/t/gateway-startup-fault-due-to-access-denied-in-module-hook/8859/8 "2014-12-17T01:45:41Z")

</div>

Deleting the c:\windows\temp files helped me also to start the gateway. However, I did not find folders that start with "jniwrap-\*".

OS: Windows 7 Home Premium, Built 7601

> java -version  
> java version "1.8.0\_25"  
> Java(TM) SE Runtime Environment (build 1.8.0\_25-b18)  
> Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

Ignition 64 bits, v7.7.1
