• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLog

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,


while starting the JBoss Server
i get the following error
java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) for resolved class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature

how to resolve it?

thanks in advanced.
 
Ranch Hand
Posts: 859
IBM DB2 Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JBoss has already loaded the Class from a different jar.

I just fought through many of these replace xfire with cxf.

I way I fixed it was to turn verbose on using the jvm -verbose parameter.
Save the output to a text file and find out where the first instance is loaded.
The next one that breaks will tell you which jar to remove.

WP
 
William P O'Sullivan
Ranch Hand
Posts: 859
IBM DB2 Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In one case:

Caused by: java.lang.ClassNotFoundException: Unexpected error during load of: javax.xml.namespace.QName, msg=loader constraint violation: loader (instance of org/jboss/mx/loading/UnifiedClassLoader3) previously initiated loading for a different type with name "javax/xml/namespace/QName"
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:553)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:408)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 163 more
Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/mx/loading/UnifiedClassLoader3) previously initiated loading for a different type with name "javax/xml/namespace/QName"

So looking at the verbose output, I found:

[Loaded javax.xml.namespace.QName from C:\Program Files\Java\jdk1.6.0_23\jre\lib\rt.jar]

then ...

[Loaded javax.xml.namespace.QName from file:/C:/jboss-eap-4.3/jboss-as-483/server/xxxxxSNAPSHOT.war/WEB-INF/lib/stax-api-1.0.1.jar]
[Loaded java.lang.ClassCircularityError from C:\Program Files\Java\jdk1.6.0_23\jre\lib\rt.jar]
[Loaded javax.xml.namespace.QName from file:/C:/jboss-eap-4.3/jboss-as-483/server/xxxxxSNAPSHOT.war/WEB-INF/lib/stax-api-1.0.1.jar]

So, removing stax-api-1.0.1.jar from our webapp fixed this problem!!

WP
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"I way I fixed it was to turn verbose on using the jvm -verbose parameter."

Can you please write the complete command on Linux to turn the verbose mode on. I am using jboss eap7 and facing the same Linkage error. Want to know the details of the classes being loaded by EAP7 at run time. My EAR is deploying fine. I am getting this exception at Run time.

Thanks
 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

Which instruction are you using that produces that error message? You would usually use -v or --verbose or similar after the command and before its arguments to make it verbose.
 
reply
    Bookmark Topic Watch Topic
  • New Topic