users@glassfish.java.net

Re: JAXBContext ClassCastException from osgi bundle with full glassfish platform, but works with web profile glassfish

From: Sahoo <sanjeeb.sahoo_at_oracle.com>
Date: Thu, 20 Oct 2011 19:02:03 +0530

The difference between web and full profile is that web profile does not
have jaxb bundles. Since full profile contains jaxb bundles, jaxb
classes are found twice - once in jre and again in jaxb bundles. But,
the way bundles are installed, I never expect jaxb classes to be loaded
from endorsed directory, but the exception message shows otherwise. If
you can connect using the Gogo shell, then do the following:

telnet localhost 6666
-> inspect p c 2
-> inspect p r 2
-> inspect p r <your bundle id>
-> header <your bundle id>

It will also help if you can send me the instructions to reproduce.

Thanks,
Sahoo

On Thursday 20 October 2011 06:45 PM, forums_at_java.net wrote:
> Hello,
>
> Trying to deploy some bundle using JAXB, this bundle works perfectly on
> Glassfish 3.1.1 web profile version, but strangely, the same bundle on
> Glassfish 3.1.1 full platform give folloiwing exception:
>
> javax.xml.bind.JAXBException: ClassCastException: attempting to cast
> bundle://2.0:1/javax/xml/bind/JAXBContext.class to
> jar:file:/C:/progs/jee/glassfish/glassfish-3.1.1/glassfish3/glassfish/modules/endorsed/jaxb-api-osgi.jar!/javax/xml/bind/JAXBContext.class
>
>
> Does it ring some bell to someone ?
>
> Thanks, and regards,
>
> Arnaud
>
>
> --
>
> [Message sent by forum member 'amergey']
>
> View Post: http://forums.java.net/node/855100
>
>