JAXBContext.newInstance(class) throws exception

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

JAXBContext.newInstance(class) throws exception

munishgupta.asr
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
Reply | Threaded
Open this post in threaded view
|

Re: JAXBContext.newInstance(class) throws exception

jbonofre
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é
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com