[jboss-dev-forums] [JBoss AS7 Development] - Bootdelegation and Jaxb

Sunil Pandit do-not-reply at jboss.com
Fri Oct 21 15:49:31 EDT 2011


Sunil Pandit [http://community.jboss.org/people/spandit2] created the discussion

"Bootdelegation and Jaxb"

To view the discussion, visit: http://community.jboss.org/message/633109#633109

--------------------------------------------------------------
Hello Folks

I am deploying a OSGI bundle in Jboss AS 7. This Bundles uses JAXB . This bundle alos exposes JAXRS services using CXF DOSGI. So I have also deployed CXF DOSGI bundle .

My problem is when my bundle try to initialize the JAXB context , it throws a class cast exception . Further debugging revealed that JAXBConext is using BundleClassLoader to load the Context factory . 

com.sun.xml.bind.v2.runtime.JAXBContextImpl cannot be cast to javax.xml.bind.JAXBContext

To avoid this conflict , I am trying to get  my bundle to load JAXB either from Jboss AS7 or from the JDK 1.6 . 

I read some article that I can use bootdelegation and specify some packages ao that All these packages will be loaded by parent class loader .

I tried setting bootdelegation for javax.xml.bind.context and for com.sun.* but there is no change in behavior .

I am setting  using  -Dorg.osgi.framework.bootdelegation=sun.*,com.sun.*,javax.* 

I have also tried setting *org.osgi.framework.system.packages.extra in server configuration , but that doesn't help either.
*

Has anyone used this before ? 

Can someone share thoughts if I am on right track ?

Is there any other way to resolve this issue ?


Appreciate any insights.

Sunil
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/633109#633109]

Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20111021/2ac50d6b/attachment.html 


More information about the jboss-dev-forums mailing list