Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Hi Alex,
i'm trying to do exactly the same like you.
But until now the creation of the java service classes with wsimport fails.
Could you please tell me the complete wsimport commandline.
After this i maye can help you with your problem with localhost.
Thanks
Jan
Hi Jan,
Yeah, as I remember getting wsimport to work with this WSDL wasn't easy (these services are clearly not written in Java). Here is the command I used:
wsimport -b bindings.xml -b http://www.w3.org/2001/XMLSchema.xsd -B-XautoNameResolution -keep -p package.name.qms.gen -s ./src -verbose -XadditionalHeaders -Xnocompile http://dmaqv01:4799/QMS/Service?wsdl
Here is the content of bindins.xml, which was located in the same directory the command was run in:
<?xml version="1.0" encoding="US-ASCII" ?>
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jaxb:extensionBindingPrefixes="xjc"
>
<jaxb:globalBindings>
<xjc:simple />
</jaxb:globalBindings>
</jaxb:bindings>
I believe I ran that command from a different computer than the one QMS was running on. Hope that works.
I have not been able to solve the problem where the code generated by wsimport will not run on the same computer hosting QMS. We created workarounds, so we only run it from other computers.
Thanks,
Alex
Hi Alex,
thanks for your anwer.
Everthing works fine at the moment. With JDK 7 I had to add a few custom binding hints for wsimport to work successfully. Our Qlikview server is running on a different computer, so by now I'm not able to to tell you my experiences with localhost connections.
I think in the next weeks we are going test the scenario with localhost.
Thanks,
Jan