axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wazup80 <>
Subject JAXB integrating with AXIS2 - oader constraints violated when linking javax/xml/namespace/QName class
Date Tue, 24 Nov 2009 01:34:29 GMT


I'm new to webservices, and axis2 and I've been stuck on this for a while
and can't seem to fix this issue.  There are alot on the net on this topic,
but I have looked at everything and seem to have no luck.  I'm hoping
someone can help me on this.  

I'm running jboss5.0.0 with Axis2.1.4 and using JAXB and jdk1.5.21.  I have
a webservice that will gather info, and then call another webservice.  I'm
able to call the other webservice and get the data, but now i'm trying to
parse the data.  This is where it fails and where i'm using JAXB.  

I have everything compiled and in the jar file (xxx.aar file).  That
includes the services.xml file and the jaxb generated classes.

Here is where it's failing at:

JAXBContext jc = JAXBContext.newInstance(""); is the package that contains the JAXB classes generated from
the schema.  When i run this, i get" doesnt contain
ObjectFactory.class or jaxb.index. 

I read everywhere that it's a classloader issue, so I went ahead and tried
the following:

ClassLoader cl =;
JAXBContext jc = JAXBContext.newInstance("", cl);

That gave me loader constraints violated when linking
javax/xml/namespace/QName class

I went ahead and removed package from the jar file under
services and put it in axis2.war\WEB-INF\lib and used the
JAXBContext.newInstance("") and this time I only got loader
constraints violated when linking javax/xml/namespace/QName class

I tried removing some of the jars that were in axis2/web-inf/lib directory
that contained the namespace/QName class and that didn't do anything.  Some
of the jars were:

stax-api.jar from (jboss\lib\endorsed).

I've tried other things as well but I figured this email is long enough as
is.  In either case, I always get the loader constraint error.

One last thing to mention.  I have the same code tested in eclipse and it
works fine.  What I did was I loaded all the jar files that were needed from
axis2\lib and it worked fine.  What was interesting was I noticed that my
sdk contained rt.jar which contained the Qname class.  I wanted to see if my
eclipse was using this version of the class or if it was using it from the
axis2\lib jars.  So I removed the namespace package from the rt.jar and it
didn't work, even though I had the two jars stated above in my java build
path.  Not sure if this testing helps at all, but just wanted to point it

Any help would be appreciated.


View this message in context:
Sent from the Axis - User mailing list archive at

View raw message