You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Paul Fraser <pa...@qnenet.com> on 2021/12/15 10:08:50 UTC

Jaxb in Karaf environment problem

Hi,

Have created xsd file from xml file and used xjc to generate the java 
classes.

When run, the system reports "no ObjectFactory class file found" but it 
exists with the generated java classes produced by xjc.

Is there something about Karaf or Osgi with Jaxb that causes this problem?

Where should I be looking to fix this?

Karaf 4.3.3, Java 11

Regards

Paul Fraser



Re: Jaxb in Karaf environment problem

Posted by Paul Fraser <pa...@qnenet.com>.
Thanks, Richard,

All it needs is a gentle hint and someone taking the time to provide the 
hint.

Paul Fraser

On 15/12/21 11:13 pm, Richard Hierlmeier wrote:
> How do you create the JAXBContext?
>
> You have to use the newInstance-method with the class loader that has 
> access to the ObjectFactory class
>
>
> Regards
>
>  Richard
>
>
>
>
>
> Am Mi., 15. Dez. 2021 um 11:09 Uhr schrieb Paul Fraser 
> <paulf@qnenet.com <ma...@qnenet.com>>:
>
>     Hi,
>
>     Have created xsd file from xml file and used xjc to generate the java
>     classes.
>
>     When run, the system reports "no ObjectFactory class file found"
>     but it
>     exists with the generated java classes produced by xjc.
>
>     Is there something about Karaf or Osgi with Jaxb that causes this
>     problem?
>
>     Where should I be looking to fix this?
>
>     Karaf 4.3.3, Java 11
>
>     Regards
>
>     Paul Fraser
>
>

Re: Jaxb in Karaf environment problem

Posted by Richard Hierlmeier <rh...@googlemail.com>.
How do you create the JAXBContext?

You have to use the newInstance-method with the class loader that has
access to the ObjectFactory class


Regards

 Richard





Am Mi., 15. Dez. 2021 um 11:09 Uhr schrieb Paul Fraser <pa...@qnenet.com>:

> Hi,
>
> Have created xsd file from xml file and used xjc to generate the java
> classes.
>
> When run, the system reports "no ObjectFactory class file found" but it
> exists with the generated java classes produced by xjc.
>
> Is there something about Karaf or Osgi with Jaxb that causes this problem?
>
> Where should I be looking to fix this?
>
> Karaf 4.3.3, Java 11
>
> Regards
>
> Paul Fraser
>
>
>