axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Veithen <andreas.veit...@gmail.com>
Subject Re: JAXB (2.1) and AXIS2 (1.5.1)
Date Wed, 13 Jan 2010 12:35:16 GMT
This probably means that JAXB is trying to look up ObjectFactory and
jaxb.index from the wrong class loader. This may happen if the JAXB
JARs are loaded by the application class loader, while the generated
code is loaded from the service class loader. One solution would be to
use the variant of the JAXBContext.newInstance method that takes a
class loader as parameter.

Andreas

On Wed, Jan 13, 2010 at 13:28, Oded Onn <Oded.Onn@mobixell.com> wrote:
> Hi,
>
>
>
> I am deploying a WS under tomcat 5.5 and Java JDK is 1.5.0_08. I use some
> external jars that include code which was generated with JAXB 2.1 (using Ant
> XJC Task). The code is built from the xml schema without any error using the
> same JAXB libs as used in Axis2:
>
> jaxb-xjc-2.1.7.jar
>
> activation-1.1.jar
>
> jaxb-api-2.1.jar
>
> jaxb-impl-2.1.7.jar
>
> jsr173_api.jar
>
>
>
> When calls (client requests) to the server are made, the code try to get a
> marshaller for a class that is derived from the schema
>
>
>
> myMarshaller =
> JAXBContext.newInstance(fromShema.class.getPackage().getName()).createMarshaller();
>
>
>
> Upon creation of the JAXBContext, the server throws the exception:
>
>
>
> java.lang.ExceptionInInitializerError
>
> . . .
>
> Caused by: java.lang.IllegalStateException: javax.xml.bind.JAXBException:
> "com.mobixell.mwc.acquisitionconfiguration.schema" doesnt contain
> ObjectFactory.class or jaxb.index
>
> . . .
>
> Caused by: javax.xml.bind.JAXBException:
> "com.mobixell.mwc.acquisitionconfiguration.schema" doesnt contain
> ObjectFactory.class or jaxb.index
>
>         at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:183)
>
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
>         at java.lang.reflect.Method.invoke(Method.java:585)
>
>         at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:133)
>
>         at javax.xml.bind.ContextFinder.find(ContextFinder.java:286)
>
>         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
>
>         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
>
>         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:244)
>
>         at
> com.mobixell.mwc.psm.AcquisitionDatabase.<init>(AcquisitionDatabase.java:69)
>
>         ... 14 more
>
>
>
> Originally, the auto-generated jars were not created with the jaxb.index
> file. I understand that it is not a must to have a jaxb.index if you have an
> ObjectFactory class. However, I tried adding the appropriate jaxb.index
> files anyway, and it still doesn’t work.
>
>
>
> Any ideas why Axis2 has problems with the JAXB generated classes? I am
> really lost on that one and would appreciate any help.
>
>
>
>
>
> Thanks!
>
> Oded
>
>

Mime
View raw message