Newbie - confused about jax-ws in java SE 1.6

View: New views
4 Messages — Rating Filter:   Alert me  

Newbie - confused about jax-ws in java SE 1.6

by metro-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
For additional commands, e-mail: users-help@...


Re: Newbie - confused about jax-ws in java SE 1.6

by Jitendra Kotamraju :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@... 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@...
> For additional commands, e-mail: users-help@...
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Newbie - confused about jax-ws in java SE 1.6

by metro-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.
[Message sent by forum member 'freddiefishcake' (freddiefishcake)]

http://forums.java.net/jive/thread.jspa?messageID=272364

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Newbie - confused about jax-ws in java SE 1.6

by metro-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
[Message sent by forum member 'gamliela' (gamliela@...)]

http://forums.java.net/jive/thread.jspa?messageID=370109

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...