• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Linkage Error with LOG4j

 
madhup narain
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting the following error while bringing up the JBOSS server. Can anyone help me locate what the exact issue is

java.lang.LinkageError:
loader constraint violation:
when resolving method "javax.xml.parsers.DocumentBuilder.setErrorHandler(Lorg/xml/sax/ErrorHandler;)V"
the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, org/apache/log4j/xml/DOMConfigurator,
and the class loader (instance of <bootloader>) for resolved class, javax/xml/parsers/DocumentBuilder,
have different Class objects for the type org/xml/sax/ErrorHandler used in the signature
 
Joachim Rohde
Ranch Hand
Posts: 433
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see any issues which would let you think this is a problem with Log4J. But I guess that you have a version clash (means: the same JAR in different versions). Find out which JAR in your deployment contains the class "javax.xml.parsers.DocumentBuilder", check then if you have this JAR in two different versions in your setup (most IDEs provide you a dependency graph if you are using Maven) and throw one version out.
 
madhup narain
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my JBoss 5.1 server uses the JRE 6 System library.
After digging through the JAR's i see that the DocumentBuilder is present in rt.jar.

I havent been able to find any JARS in the JBOSS that contain the same DocumentBuilder java file. Do you think i should try plugging out rt.jar from my JRE
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would not recommend that no . What version of Java are you using?
 
madhup narain
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JRE version that i am using on my JBOSS is :
Java(TM) SE Run-time Environment (build 1.6.0_23-b05)

Can you help find out what JBOSS library may be causing this linkage error ?
I can try to list out the JBOSS JARS that are loaded in the server, would that help ?
 
Joachim Rohde
Ranch Hand
Posts: 433
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Martijn Verburg wrote:I would not recommend that no .

Maybe you should also mention, why! ;-)
"rt" stands for runtime and contains the compiled classes of your Java runtime environment. That's why it's not a good idea to delete it.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joachim, right you are! Apologies for the short replies at the moment, I'm having to use dictation software while I give my arms a rest for a few weeks.

Madhup, have you deployed any apps? Jboss 5.1 with JDK 1.6.0_23 should run just fine.

I'm also going to move this to the Jboss Forum.
 
madhup narain
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply guys!!!

Ok. here is the thing -
We are migrating one of our JSF applications from RAD-Iplanet-WAS to ECLIPSE-Apache-JBOSS combination.
Since our application was dependent on some of the WAS libraries we had to do some changes to the JAR's.

At present the application compiles and executes allright on the JBOSS server, but we are seeing the error mentioned above.
Hope you get the picture of the migration


 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chances are that a JAR you have in your app is clashing with the JDK6 version of that class, it's usually a xerces or xalan JAR if I remember correctly. You'll want to make sure that your CLASSPATH isolation is working correctly and/or remove that clashing JAR
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic