3 Replies Latest reply: Oct 21, 2013 8:13 AM by Jan Hinrichs RSS

    Java code access QMS fails on local machine, works elsewhere.

      Hi QlikView community,

       

      Thanks in advance for your help.

       

      I created a Java application that interacts with the QlikView Management Service (QMS) API. I generated the service classes from the WSDL using Java's wsimport utility. Everything works great when I run the java application from another computer on the network.

       

      However, when I attempt to run the java application on the same server that is hosting the QlikView Management Service, it does not start. Attempting to start the application on the QlikView server results an error (below) after several minutes of hanging. Additionally, while the app is attempting to start, other requests to the web service (including simple ones to get the WSDL from a browser) hang, and don't return until the java app errors and aborts.

       

      The error the Java applicaiton is running into looks like this:

       

      com.sun.jersey.api.container.ContainerException: Unable to create resource

          at com.sun.jersey.server.impl.resource.SingletonFactory$Singleton.init(SingletonFactory.java:139)

          ...

      Caused by:

      java.lang.reflect.InvocationTargetException

      Trigger found: Exception in line:

      java.lang.reflect.InvocationTargetException

          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

          ...

      Caused by:

      javax.xml.ws.WebServiceException: java.net.SocketException: Connection reset

      Trigger found: Exception in line:

      javax.xml.ws.WebServiceException: java.net.SocketException: Connection reset

          at com.sun.xml.internal.ws.streaming.TidyXMLStreamReader.close(Unknown Source)

          at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(Unknown Source)

          at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(Unknown Source)

          at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(Unknown Source)

          at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(Unknown Source)

          at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)

          at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)

          at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(Unknown Source)

          at javax.xml.ws.Service.<init>(Unknown Source)

          at xxx.xxx.xxx.mgmt.qv.qms.gen.QMSBackendService.<init>(QMSBackendService.java:42)

          ...

      Caused by:

      java.net.SocketException: Connection reset

      Trigger found: Exception in line:

      java.net.SocketException: Connection reset

          at java.net.SocketInputStream.read(Unknown Source)

          ...

      javax.servlet.ServletException: com.sun.jersey.spi.container.servlet.ServletContainer-517302766@ff3091d3==com.sun.jersey.spi.container.servlet.ServletContainer,-1,false

      Trigger found: Exception in line:

      javax.servlet.ServletException: com.sun.jersey.spi.container.servlet.ServletContainer-517302766@ff3091d3==com.sun.jersey.spi.container.servlet.ServletContainer,-1,false

          at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:548)

          ...

      Caused by:

      com.sun.jersey.api.container.ContainerException: Unable to create resource

      Trigger found: Exception in line:

      com.sun.jersey.api.container.ContainerException: Unable to create resource

          at com.sun.jersey.server.impl.resource.SingletonFactory$Singleton.init(SingletonFactory.java:139)

          ...

      Caused by:

      java.lang.reflect.InvocationTargetException

      Trigger found: Exception in line:

      java.lang.reflect.InvocationTargetException

          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

          ...

      Caused by:

      javax.xml.ws.WebServiceException: java.net.SocketException: Connection reset

      Trigger found: Exception in line:

      javax.xml.ws.WebServiceException: java.net.SocketException: Connection reset

          at com.sun.xml.internal.ws.streaming.TidyXMLStreamReader.close(Unknown Source)

      start script scripts/trayMessage.gv

          at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(Unknown Source)

          at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(Unknown Source)

          at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(Unknown Source)

          at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(Unknown Source)

          at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)

          at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)

          at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(Unknown Source)

          at javax.xml.ws.Service.<init>(Unknown Source)

          at xxx.xxx.xxx.mgmt.qv.qms.gen.QMSBackendService.<init>(QMSBackendService.java:42)

          ...

      Caused by:

      java.net.SocketException: Connection reset

      Trigger found: Exception in line:

      java.net.SocketException: Connection reset

          at java.net.SocketInputStream.read(Unknown Source)

      ...

       

      There are no corresponding entries in the QlikView QMS log.

       

      It appears that the application cannot read the WSDL. The connection is reset while the application is still waiting to read more of the xml. As mentioned this exact same code run by the same user works when it is hosted an any computer other than the server hosting the QlikView Management Service. I suspect that this might have to do with how Windows handles local and external network traffic separately, which also makes this problem much harder to debug using packet sniffing tools like WireShark.

       

      Any insight into this problem would be appreciated. Are other people able to run applications interacting with the QMS service on the same server it is hosted on?

       

      Thanks again for your help.