Mobile Java Exception Error

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?

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.

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

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.

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)

cire3621, I never got the mobile_wdir upload to that ticket.

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.

Any insight on this?

Anybody ever get a solution?

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.

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.

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

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

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

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

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".