# Mobile Java Exception Error

**URL:** <https://forum.inductiveautomation.com/t/mobile-java-exception-error/7705>\
**Category:** Ignition\
**Created:** [December 14, 2013, 1:05am UTC](https://forum.inductiveautomation.com/t/mobile-java-exception-error/7705 "2013-12-14T01:05:02Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![cire3621](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@cire3621](https://forum.inductiveautomation.com/u/cire3621)\
**Post date:** [December 14, 2013, 1:05am UTC](https://forum.inductiveautomation.com/t/mobile-java-exception-error/7705/1 "2013-12-14T01:05:02Z")

</div>

Recently we have noticed on first attempt at login to a mobile project we all get (java.net.SocketException: Connection reset by peer: socket write error. It logs us out and when we relog back in it initalizes. Why does this happen so many times on first log on attempt that we have to try again before we can see the project?

---

<div class="post-metadata">

**Author:** ![Polynomial](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@Polynomial](https://forum.inductiveautomation.com/u/Polynomial)\
**Post date:** [December 19, 2013, 1:25pm UTC](https://forum.inductiveautomation.com/t/mobile-java-exception-error/7705/2 "2013-12-19T13:25:51Z")

</div>

Were you able to find a resolution to your problem? We’re encountering the same thing using Ignition 7.6.4 and Java 7 update 45. We get the “socket write error” about 9 times out of 10 of starting the app.

We tried using Java update 25 but it didn’t seem to make any difference.

---

<div class="post-metadata">

**Author:** ![Polynomial](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@Polynomial](https://forum.inductiveautomation.com/u/Polynomial)\
**Post date:** [December 20, 2013, 2:37pm UTC](https://forum.inductiveautomation.com/t/mobile-java-exception-error/7705/3 "2013-12-20T14:37:39Z")

</div>

I don’t mean to take over the thread but I’m not sure I should start a new one on this since it seems to be a similar problem. We’re running Ignition 7.6.4 on Windows 8.1, Java 7 Update 45. We get the socket write error exactly ten times and then the mobile app loads on the 11th try every time. I tried setting the Mobile module to use Java 7u25 but it didn’t seem to make a difference. Any suggestions?

Here are the relevant logs:

WARN 9:28:42 AM DataServlet Failure in mobiledata/initvm

java.net.SocketException: Connection reset by peer: socket write error  
at java.net.SocketOutputStream.socketWrite0(Native Method)  
at java.net.SocketOutputStream.socketWrite(Unknown Source)  
at java.net.SocketOutputStream.write(Unknown Source)  
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)  
at java.io.BufferedOutputStream.flush(Unknown Source)  
at java.io.DataOutputStream.flush(Unknown Source)  
at com.inductiveautomation.mobile.gateway.MobileVMManager$ClientVMImpl.sendMessage(MobileVMManager.java:595)  
at com.inductiveautomation.mobile.gateway.MobileVMManager.initializeVM(MobileVMManager.java:337)  
at com.inductiveautomation.mobile.gateway.servlets.MobileSession.initializeVM(MobileSession.java:384)  
at com.inductiveautomation.mobile.gateway.servlets.MobileDataServlet$InitVM.handle(MobileDataServlet.java:835)  
at com.inductiveautomation.mobile.gateway.servlets.MobileDataServlet.doRequest(MobileDataServlet.java:159)  
at com.inductiveautomation.mobile.gateway.servlets.MobileDataServlet.doGet(MobileDataServlet.java:108)  
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)  
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)  
at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:85)  
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)  
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)  
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)  
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)  
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)  
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)  
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)  
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)  
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)  
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)  
at java.lang.Thread.run(Unknown Source)  
less  
(I) 9:28:42 AM ClientVM Client vm 52dd4597-a769-5d82-5da8-247c8836a1aa closed: Exception during init message

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [December 27, 2013, 11:53pm UTC](https://forum.inductiveautomation.com/t/mobile-java-exception-error/7705/4 "2013-12-27T23:53:41Z")

</div>

This sounds like a problem with the version of Java you’re using, and there is a setting specifically for what version of java the mobile module uses. You can find it in the Ignition Gateway in the Configure section under Mobile -\> Settings. You should make sure that the Java Path is set to something like ‘C:\Program Files\Java\jre7\bin\java.exe’

If that’s set to the correct path, then you can try clearing the Java cache on the computer Ignition is installed on.

---

<div class="post-metadata">

**Author:** ![cire3621](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@cire3621](https://forum.inductiveautomation.com/u/cire3621)\
**Post date:** [January 6, 2014, 6:17pm UTC](https://forum.inductiveautomation.com/t/mobile-java-exception-error/7705/5 "2014-01-06T18:17:03Z")

</div>

I spoke to tech support on the phone and did a gotomeeting. She kept seeing the error occur on first attempt login and could not find a solution. She gave me instructions on what needed to be logged if it keeps occuring and to submit for the developers to review and see why this is happening.

These were her instructions. But I have been out of the office on business so have not had time to start the logging.

1. Configure \> Console \> Levels, search for “VMManager”, set it to “Debug”

Get it to error out, export the logs

1. Go to Mobile / settings, in the “JVM Optons”, type “-Dmobile.debug=true” ( not quotation marks).  
Get it to error out, then go to /data/mobile\_wdir , zip that the mobile\_wdir folder

upload both to ticket 15220 ( [inductiveautomation.com/uploads](http://inductiveautomation.com/uploads))

---

<div class="post-metadata">

**Author:** ![anna](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@anna](https://forum.inductiveautomation.com/u/anna)\
**Post date:** [January 8, 2014, 6:49pm UTC](https://forum.inductiveautomation.com/t/mobile-java-exception-error/7705/6 "2014-01-08T18:49:30Z")

</div>

cire3621, I never got the mobile\_wdir upload to that ticket.

---

<div class="post-metadata">

**Author:** ![mlangdon](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@mlangdon](https://forum.inductiveautomation.com/u/mlangdon)\
**Post date:** [August 12, 2014, 5:04pm UTC](https://forum.inductiveautomation.com/t/mobile-java-exception-error/7705/7 "2014-08-12T17:04:20Z")

</div>

I've seen the following errors when changing to Debug on the VMManager: (Ignition 7.6.6, Windows 8.1, Java 7\_67). If I try to login 3-4 times it then lets me.

> [@](#):
>
> ```
> Time	Logger	Message
> 
> ```
> 
> (I) 12:58:35 PM Mobile.VMManager New client VM discovered. id=d4dcde0e-2180-776b-a5c0-1ecde60a9fa9  
> (I) 12:58:34 PM Mobile.VMManager VMCreator starting 1 new client VM(s).  
> WARN 12:58:33 PM Mobile.DataServlet Failure in mobiledata/initvm
> 
> java.net.SocketException: Connection reset by peer: socket write error  
> at java.net.SocketOutputStream.socketWrite0(Native Method)  
> at java.net.SocketOutputStream.socketWrite(Unknown Source)  
> at java.net.SocketOutputStream.write(Unknown Source)  
> at java.io.BufferedOutputStream.flushBuffer(Unknown Source)  
> at java.io.BufferedOutputStream.flush(Unknown Source)  
> at java.io.DataOutputStream.flush(Unknown Source)  
> at com.inductiveautomation.mobile.gateway.MobileVMManager$ClientVMImpl.sendMessage(MobileVMManager.java:612)  
> at com.inductiveautomation.mobile.gateway.MobileVMManager.initializeVM(MobileVMManager.java:338)  
> at com.inductiveautomation.mobile.gateway.servlets.MobileSession.initializeVM(MobileSession.java:384)  
> at com.inductiveautomation.mobile.gateway.servlets.MobileDataServlet$InitVM.handle(MobileDataServlet.java:835)  
> at com.inductiveautomation.mobile.gateway.servlets.MobileDataServlet.doRequest(MobileDataServlet.java:159)  
> at com.inductiveautomation.mobile.gateway.servlets.MobileDataServlet.doGet(MobileDataServlet.java:108)  
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)  
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)  
> at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:85)  
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)  
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)  
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)  
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)  
> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)  
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)  
> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)  
> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)  
> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)  
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)  
> at java.lang.Thread.run(Unknown Source)  
> (I) 12:58:33 PM Mobile.ClientVM Client vm 4188d323-9ce7-8fae-7eb2-890d04d6f442 closed: Exception during init message  
> WARN 12:58:24 PM Mobile.DataServlet.RectsB64 Failure in mobiledata/rects. [isClientVMRunning()=false, VM.id=77d4e664-2d71-3c71-2af5-3df5680cba96
> 
> java.net.SocketException: Connection reset by peer: socket write error  
> at java.net.SocketOutputStream.socketWrite0(Native Method)  
> at java.net.SocketOutputStream.socketWrite(Unknown Source)  
> at java.net.SocketOutputStream.write(Unknown Source)  
> at java.io.BufferedOutputStream.flushBuffer(Unknown Source)  
> at java.io.BufferedOutputStream.flush(Unknown Source)  
> at java.io.DataOutputStream.flush(Unknown Source)  
> at com.inductiveautomation.mobile.gateway.MobileVMManager$ClientVMImpl.getDirtyRectangles(MobileVMManager.java:499)  
> at com.inductiveautomation.mobile.gateway.servlets.MobileSession.getDirtyRectangles(MobileSession.java:263)  
> at com.inductiveautomation.mobile.gateway.servlets.MobileDataServlet$RectsBase64.handle(MobileDataServlet.java:304)  
> at com.inductiveautomation.mobile.gateway.servlets.MobileDataServlet.doRequest(MobileDataServlet.java:159)  
> at com.inductiveautomation.mobile.gateway.servlets.MobileDataServlet.doGet(MobileDataServlet.java:108)  
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)  
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)  
> at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:85)  
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)  
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)  
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)  
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)  
> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)  
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)  
> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)  
> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)  
> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)  
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)  
> at java.lang.Thread.run(Unknown Source)  
> (I) 12:58:24 PM Mobile.ClientVM Client vm 77d4e664-2d71-3c71-2af5-3df5680cba96 closed: IOException during rectangle message: java.net.SocketException: Connection reset by peer: socket write error

Any insight on this?

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [November 3, 2014, 9:47pm UTC](https://forum.inductiveautomation.com/t/mobile-java-exception-error/7705/8 "2014-11-03T21:47:00Z")

</div>

Anybody ever get a solution?

---

<div class="post-metadata">

**Author:** ![greg.simpson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/greg.simpson/32/3135_2.png) [@greg.simpson](https://forum.inductiveautomation.com/u/greg.simpson)\
**Post date:** [March 9, 2015, 11:44pm UTC](https://forum.inductiveautomation.com/t/mobile-java-exception-error/7705/9 "2015-03-09T23:44:00Z")

</div>

I would be curious if there are multiple installations of Java on the Gateway Server. Best practice and the first troubleshooting step I use is to hard code the path to java.exe in the “Path to Java” property in Mobile Settings. Also, make sure you are using the correct version of Java for the version of Java in use. Ignition 7.7 will require Java 8 (regardless of the fine print in mobile settings), Ignition 7.6 & 7.5 requires Java 7 for mobile.

---

<div class="post-metadata">

**Author:** ![sedobson](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@sedobson](https://forum.inductiveautomation.com/u/sedobson)\
**Post date:** [April 3, 2015, 10:45pm UTC](https://forum.inductiveautomation.com/t/mobile-java-exception-error/7705/10 "2015-04-03T22:45:11Z")

</div>

I’ve got the same problem on mobile devices. I’ve tried everything I could find in the forum(plus stackexchange, etc.) and the results are the same. Ignition 7.7 with Java 8 hard coded path - it’s the only version installed. Console listing is identical (or nearly so) to those shown here. Running Windows Server 2012 R2 x64 on a VM, but also have the problem when running on a Windows 7x64 development machine.

---

<div class="post-metadata">

**Author:** ![jlteel](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@jlteel](https://forum.inductiveautomation.com/u/jlteel)\
**Post date:** [June 19, 2015, 9:33pm UTC](https://forum.inductiveautomation.com/t/mobile-java-exception-error/7705/11 "2015-06-19T21:33:41Z")

</div>

I’m having this same problem on a customer installation. Is there no resolution?

---

<div class="post-metadata">

**Author:** ![matsons](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@matsons](https://forum.inductiveautomation.com/u/matsons)\
**Post date:** [June 30, 2015, 8:44pm UTC](https://forum.inductiveautomation.com/t/mobile-java-exception-error/7705/12 "2015-06-30T20:44:46Z")

</div>

We have Java 7 installed on the gateway for the mobile module in addition to Java 8. We then have the path to the Java 7 executable hard-coded into the module configuration page on the Ignition gateway.

Looking at the mobile module in the Module Marketplace, it appears that it still needs Java 7.  
[http://marketplace.inductiveautomation.com/moduledetail?9&moduleId=34](http://marketplace.inductiveautomation.com/moduledetail?9&moduleId=34)

---

<div class="post-metadata">

**Author:** ![jlteel](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@jlteel](https://forum.inductiveautomation.com/u/jlteel)\
**Post date:** [June 30, 2015, 9:12pm UTC](https://forum.inductiveautomation.com/t/mobile-java-exception-error/7705/13 "2015-06-30T21:12:08Z")

</div>

Thanks very much for this tip. I’ll take care of it on my customer’s gateway tomorrow!

---

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [August 15, 2016, 3:37pm UTC](https://forum.inductiveautomation.com/t/mobile-java-exception-error/7705/14 "2016-08-15T15:37:18Z")

</div>

Any luck on this issue fellas?? I get the same error and sometimes I have to hit restart 2 times sometimes 3 times and earlier 6 time to finally connect to the mobile project… its annoying. included some screenshot of my gateway status and mobile setting in this thread if it helps…  
[inductiveautomation.com/forum/v … 72&t=14444](https://inductiveautomation.com/forum/viewtopic.php?f=72&t=14444)

---

<div class="post-metadata">

**Author:** ![yao.hu](https://avatars.discourse-cdn.com/v4/letter/y/e5b9ba/32.png) [@yao.hu](https://forum.inductiveautomation.com/u/yao.hu)\
**Post date:** [December 13, 2017, 8:18am UTC](https://forum.inductiveautomation.com/t/mobile-java-exception-error/7705/15 "2017-12-13T08:18:48Z")

</div>

> [@Mr.K001](#):
>
> this issue fellas?? I get the same error and sometimes I have to hit restart 2 times sometimes 3 times and earlier 6 time to finally connect to the mobile project... its annoying. included some screenshot of my gateway status and mobile setting in this thread if it helps..

Same error here. Any update?  
Here comes a message shown as bellowing when we try to launch mobile project with browser.

> java.net.SocketException: Broken pipe (Write failed)  
> And that is unpredictable, sometimes it will happen, sometime not.  
> Is that possible to use the mobile module for operation ? What I mean is running on PAD to instead desktop or "desktop like".
