|
Replies:
3
-
Last Post:
Nov 1, 2009 1:44 AM
by: gamliela
|
Threads:
[
Previous
|
Next
]
|
|
|
|
|
|
Newbie - confused about jax-ws in java SE 1.6
Posted:
Apr 30, 2008 12:33 PM
|
|
|
A simple web service client developed in NetBeans 6.1 with jdk 1.6u6 makes repeated calls to a server (running under glassFish). Most of the time everything is OK, but occasionally a call to port.<getSomedata> fails to return.
Under NetBeans, if I include the JAX-WS 2.1 library, I can set a http request timeout threshold:
com.myCompany.myPortType port = service.getMyPort(); // set some timeouts.. seems to require explicit inclusion of +JAX-WS libraries Map<String, Object> ctxt = ((BindingProvider) port).getRequestContext(); //ctxt.put(JAXWSProperties.CONNECT_TIMEOUT, connectionTimeout); ctxt.put(BindingProviderProperties.REQUEST_TIMEOUT, requestTimeout);
and at run time this works as expected, throwing an occasional exception as expected:
SEVERE: Error requesting data com.sun.xml.ws.encoding.soap.DeserializationException: Failed to read a response: javax.xml.bind.UnmarshalException - with linked exception: [javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1196] Message: Read timed out]
However, whn run on a stand-alone Java SE machine (1.6_05) (without explicitly including jaxWS libraries from NetBeans), the code runs fine, but apparently ignores the request timeout - when a problem occurs it seems to hang forever at port.<getSomedata>.
Stupid question: if Java 1.6_05 includes jax-WS, (the hard part of the web Service runs fine), what is the recommended practice to set a http request timeout? (and ditto for connection timeout, if possible).
On a related note, what would be recommended technique to diagnose the root cause of the problem at the server side (apparently not returning a complete response) .. I have added logging that indicates the request is received, SQL lookup completes OK, and the very last line exceuted is the return of the WebMethod - presumably the next steps include some jaxb marshalling which may be getting indegestion or something similar?
|
|
|
|
|
|
|
Re: Newbie - confused about jax-ws in java SE 1.6
Posted:
Apr 30, 2008 7:15 PM
in response to: freddiefishcake
|
|
|
I think you are running into the following issue.
https://jax-ws.dev.java.net/issues/show_bug.cgi?id=555
JAX-WS in SE lags behind the java.net releases. I think you are running into some bugs. We schedule to put the selected bug fixes in the update releases of JDK 6. Can you try putting sjsxp.jar (from java.net distribution) or woodstox.jar(get it from woodstox site) in the classpath when running with Java SE 6. That may fix all your problems.
For the request timeout and custom extensions are not supported in JDK6. If you want to use any of these, just put java.net's jax-ws ri jars in the classpath.
Thanks. Jitu
metro@javadesktop.org wrote: > A simple web service client developed in NetBeans 6.1 with jdk 1.6u6 makes repeated calls to a server (running under glassFish). Most of the time everything is OK, but occasionally a call to port.<getSomedata> fails to return. > > Under NetBeans, if I include the JAX-WS 2.1 library, I can set a http request timeout threshold: > > com.myCompany.myPortType port = service.getMyPort(); > // set some timeouts.. seems to require explicit inclusion of +JAX-WS libraries > Map<String, Object> ctxt = ((BindingProvider) port).getRequestContext(); > //ctxt.put(JAXWSProperties.CONNECT_TIMEOUT, connectionTimeout); > ctxt.put(BindingProviderProperties.REQUEST_TIMEOUT, requestTimeout); > > and at run time this works as expected, throwing an occasional exception as expected: > > SEVERE: Error requesting data com.sun.xml.ws.encoding.soap.DeserializationException: Failed to read a response: javax.xml.bind.UnmarshalException > - with linked exception: > [javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1196] > Message: Read timed out] > > However, whn run on a stand-alone Java SE machine (1.6_05) (without explicitly including jaxWS libraries from NetBeans), the code runs fine, but apparently ignores the request timeout - when a problem occurs it seems to hang forever at port.<getSomedata>. > > Stupid question: if Java 1.6_05 includes jax-WS, (the hard part of the web Service runs fine), what is the recommended practice to set a http request timeout? (and ditto for connection timeout, if possible). > > On a related note, what would be recommended technique to diagnose the root cause of the problem at the server side (apparently not returning a complete response) .. I have added logging that indicates the request is received, SQL lookup completes OK, and the very last line exceuted is the return of the WebMethod - presumably the next steps include some jaxb marshalling which may be getting indegestion or something similar? > [Message sent by forum member 'freddiefishcake' (freddiefishcake)] > > http://forums.java.net/jive/thread.jspa?messageID=272294 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net > For additional commands, e-mail: users-help@metro.dev.java.net > >
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net For additional commands, e-mail: users-help@metro.dev.java.net
|
|
|
|
|
|
|
|
Re: Newbie - confused about jax-ws in java SE 1.6
Posted:
May 1, 2008 2:11 AM
in response to: freddiefishcake
|
|
|
Thanks for suggestion. I added sjsxp.jar and jsr173_1.0_api.jar to the classpath, removed the call to ctxt.put(BindingProviderProperties.REQUEST_TIMEOUT, requestTimeout);
[BTW - how can I check that sjsxp is being loaded instead of the default?]
But the client application still hangs at port.getSomeData (often after a few hundred successful iterations).
Strange that the default behaviour is never to time-out?
For now the only work around seems to be to explicitly include the JAX-WS 2.1 library files - which seems like overkill just to set the request timeout property.
|
|
|
|
|
|
|
|
Re: Newbie - confused about jax-ws in java SE 1.6
Posted:
Nov 1, 2009 1:44 AM
in response to: freddiefishcake
|
|
|
Hello Freddiefishcake,
I believe we encounter the same problem as you did. Sometimes the timeouts work - and sometimes they don't. I understand that the only workaround is to add some additional jars to the class-path, since there are bugs in current JDKs.
Could you please be more specific and describe which files did you add?
If I add "jaxws-rt.jar" from the latest release (2.1.7) to the classpath - it should be enough?
Thanks in advance,
Alon
|
|
|
|
|