File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes LinkageError while defining class: javax.xml.namespace.QName Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "LinkageError while defining class: javax.xml.namespace.QName" Watch "LinkageError while defining class: javax.xml.namespace.QName" New topic
Author

LinkageError while defining class: javax.xml.namespace.QName

Gangadhara Rao
Greenhorn

Joined: Jun 02, 2007
Posts: 7
Hello All,

I am getting an exception i.e... Exception thrown : java.lang.LinkageError: LinkageError while defining class: javax.xml.namespace.QName.

I am using jaxb JWSDP 1.4, the jar files which I am using are::jaxb-libs.jar
jaxb-xjc.jar
jaxb-impl.jar
jaxb-qname.jar
jaxb-api.jar
jaxen-full.jar

My jaxb is working very much fine. Now the problem is I have a webservice to be consumed.I have generated client components using, RSA6.0.1.1 and in a webproject which uses servlet version 2.3 .

Many of the client component classes use javax.xml.namespace.QName and I found this class name in these jar files.
jaxb-libs.jar
jaxb-xjc.jar
jaxb-impl.jar
jaxb-api.jar
jaxen-full.jar.

When I am instatiating my proxy class to consume webservcie I am getting the following exception , I am just giving the trace..


Exception thrown : java.lang.LinkageError: LinkageError while defining class: javax.xml.namespace.QName
Could not be defined due to: Class javax/xml/namespace/QName violates loader constraints: parent and child already loaded different classes
This is often caused by having a class defined at multiple
locations within the classloader hierarchy. Other potential causes
include compiling against an older or newer version of the class
that has an incompatible method signature.
Dumping the current context classloader hierarchy:
==> indicates defining classloader
==>[0]
com.ibm.ws.classloader.CompoundClassLoader@3d6f0289....

WebSphere_PortalV5.1 Run time does contain, the jar files which has this QName class .

Please guide me as to how this problem can be resolved .

Thanks in advance..
Gangadhar
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14428
    
  23

Have you looked up LinkageError in the Java API documentation? The description of it says:

Subclasses of LinkageError indicate that a class has some dependency on another class; however, the latter class has incompatibly changed after the compilation of the former class.

It looks like you are mixing different versions of Java, or different versions of an XML parser. Are you compiling and running on a Sun JRE or on an IBM JRE? Check which XML parser you are using and if it conflicts with something else in your system. This can be complicated to find out, so you'll have to watch very carefully...


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: LinkageError while defining class: javax.xml.namespace.QName