You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by "munishgupta.asr" <mu...@gmail.com> on 2019/10/22 14:19:00 UTC

JAXBContext.newInstance(class) throws exception

Hi All,

before KARAF upgrade to 4.2.7, our product was able to use JAXBContext calls
without any issue.

for example
JAXBContext.newInstance(ABC.Class) was working fine.

After upgrade, this call was throwing null pointer exception.

I changed that to JAXBContext.newInstance(ABC.Class.getName()) and it throws
the exception now.
javax.xml.bind.JAXBException: Provider class
com.sun.xml.internal.bind.v2.ContextFactory could not be instantiated:
javax.xml.bind.JAXBException: "MyPackage.ABC" doesnt contain
ObjectFactory.class or jaxb.index	

Have you guys any idea about this if it has been faced before?
Can you suggest any clues to resolve it?

Regards
Munish



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: JAXBContext.newInstance(class) throws exception

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

Can you please paste the MANIFEST and the code of your bundle that use it ?

Regards
JB

On 22/10/2019 16:19, munishgupta.asr wrote:
> Hi All,
> 
> before KARAF upgrade to 4.2.7, our product was able to use JAXBContext calls
> without any issue.
> 
> for example
> JAXBContext.newInstance(ABC.Class) was working fine.
> 
> After upgrade, this call was throwing null pointer exception.
> 
> I changed that to JAXBContext.newInstance(ABC.Class.getName()) and it throws
> the exception now.
> javax.xml.bind.JAXBException: Provider class
> com.sun.xml.internal.bind.v2.ContextFactory could not be instantiated:
> javax.xml.bind.JAXBException: "MyPackage.ABC" doesnt contain
> ObjectFactory.class or jaxb.index	
> 
> Have you guys any idea about this if it has been faced before?
> Can you suggest any clues to resolve it?
> 
> Regards
> Munish
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com