dev@glassfish.java.net

Re: Issue 247 NPE when acessing web resource

From: Sameer Tyagi <Sameer.Tyagi_at_Sun.COM>
Date: Mon, 14 Aug 2006 11:00:12 -0400

So here is the solution to this.

It turns out that in order to override the FCS JAX-WS completely, you
also need to package the
XWSS Jars in the lib directory. The JAX-WS SPI tries to load the
com.sun.xml.xwss.SystemHandlerDelegateFactory
which it doesnt find in the lib directory, so tries the bundled XWSS in
the appserver. Theres possibly a conflict
with the different XWSS Jars around.
I bunlded XWSS 2.0 by downloading it from here
(https://xwss.dev.java.net/) with JAX-WS 2.0 FCS that
I bundled in the war and it seemed to work fine.

I will update the issue on GF in case anyone else encounters this.

/s



Jan Luehe wrote:

>
>
> Vijay Ramachandran wrote On 08/10/06 10:11,:
>
>> Jan - can you please take a look at this ?
>>
>>
>
> From the stacktrace, I can see that you are getting the
> ClassCastException (involving
> com.sun.xml.xwss.SystemHandlerDelegateFactory) during deployment, when
> your webapp is started and its context listener is invoked.
>
> I've searched all GlassFish issues for this exception and found:
>
> https://glassfish.dev.java.net/issues/show_bug.cgi?id=247
>
> At that time, the exact exception was:
>
> Caused by: java.lang.ClassCastException:
> com.sun.xml.xwss.SystemHandlerDelegateFactory cannot be cast to
> com.sun.xml.ws.spi.runtime.SystemHandlerDelegateFactory
>
> Before 247 issue was fixed, accessing
>
> http://localhost:8080/WSpex-latest/TestService
>
> would cause a NPE.
>
> We've fixed 247 so that you now get a
>
> HTTP/1.1 503 Service Unavailable
>
> response, which is expected, since the webapp could not be
> started (due to the ClassCastException during execution of its context
> listener) and was therefore marked as unavailable.
>
> However, the underlying ClassCastException was never addressed,
> because 247 was just about the NPE!
>
> As you mention, this ClassCastException occurs only when bundling
> JAX-WS FCS and setting your classloader's "delegate" attribute to
> FALSE (in sun-web.xml).
>
> The ClassCastException suggests that in
>
> (com.sun.xml.ws.spi.runtime.SystemHandlerDelegateFactory) obj
>
> the
>
> com.sun.xml.ws.spi.runtime.SystemHandlerDelegateFactory
>
> extended by "obj" and the
>
> com.sun.xml.ws.spi.runtime.SystemHandlerDelegateFactory
>
> it is being cast to have been loaded by different classloaders.
>
> I think someone from jax-ws needs to take it from here.
>
>
> Jan
>
>> Thanks
>>
>> Vijay
>>
>> On Thu, 2006-08-10 at 10:09, Sameer Tyagi wrote:
>>
>>
>>> I m trying to use JAX-WS Fcs but bunding it in web-inf/lib and using
>>> delegate
>>> in sun-web.xml
>>> This works for tango and rearch but not for FcS bits....
>>>
>>> /s
>>>
>>>
>>>
>>> Vijay Ramachandran wrote:
>>>
>>>
>>>
>>>> Are you trying to use jaxws-rearch bits are jaxws2.0 bits ?
>>>>
>>>> Are you trying 109 based deployment or otherwise ?
>>>>
>>>> Including the jaxws mailing alias for their comment on this stack.
>>>>
>>>> Vijay
>>>>
>>>> On Thu, 2006-08-10 at 08:30, Sameer Tyagi wrote:
>>>>
>>>>
>>>>
>>>>
>>>>> Has this been resolved ?
>>>>> I just tried the latest build and tried to override the includes
>>>>> jars with other jars and
>>>>> get the same error again.
>>>>> I thought this had been fixed - looks like it has resurfaced ?
>>>>>
>>>>> Exception sending context initialized event to listener instance
>>>>> of class
>>>>> com.sun.xml.ws.transport.http.servlet.WSServletContextListener
>>>>> WSSERVLET11: failed to parse runtime descriptor:
>>>>> javax.xml.ws.WebServiceException: java.lang.ClassCastException:
>>>>> com.sun.xml.xwss.SystemHandlerDelegateFactory
>>>>> at
>>>>> com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:130)
>>>>>
>>>>> at
>>>>> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4236)
>>>>>
>>>>> at
>>>>> org.apache.catalina.core.StandardContext.start(StandardContext.java:4760)
>>>>>
>>>>> at com.sun.enterprise.web.WebModule.start(WebModule.java:292)
>>>>> at org.apache.catalina.core.ContainerBase.addChildInternal(Contai
>>>>>
>>>>>
>>>>> /s
>>>>>
>>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>
>

-- 
------------------------------------------------------------------------------
Accessline:    1-877-325-9504 
Internal:     x51601
Timezone : EDT - Eastern Standard Time, GMT -5:00
AIM : sameersjc
Blog : blogs.sun.com/sameert