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()).createMa
rshaller();

 

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.jav
a:39)

        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.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

 

Reply via email to