java.lang.LinkageError: loader constraint violation: when resolving field "logger"

Solution Verified - Updated -

Issue

  • We are facing a Linkage error problem while deploying our JBI application of fuse.
  • The application has the following major jar versions:

    • Spring 3.3.Release
    • Hibernate: 4.2.1.Final
    • Hibernate validator: 4.2.0.Final
  • The following error message is obtained from the log file:

<component-task-result-details>
        <task-result-details>
            <task-id>deploy</task-id>
            <task-result>FAILED</task-result>
            <message-type>ERROR</message-type>
            <task-status-msg><msg-loc-info><loc-token/><loc-message>Could not deploy xbean service unit</loc-message></msg-loc-info></task-status-msg>
            <exception-info>
                <nesting-level>1</nesting-level>
                <msg-loc-info>
                    <loc-token />
                    <loc-message>Error creating bean with name 'transactionManager' defined in URL [jar:file:/opt/servicemix-example-6.0.0.redhat-024/data/jbi/example-service-assembly/example/example-camel-routing/lib/example-service-1.3.4-SNAPSHOT.jar!/database-config.xml]: Invocation of init method failed; nested exception is java.lang.LinkageError: loader constraint violation: when resolving field "logger" the class loader (instance of org/apache/xbean/classloader/JarFileClassLoader) of the referring class, org/springframework/transaction/support/AbstractPlatformTransactionManager, and the class loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) for the field's resolved type, org/apache/commons/logging/Log, have different Class objects for that type</loc-message>
                    <stack-trace><![CDATA[org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in URL [jar:file:/opt/servicemix-ssa-6.0.0.redhat-024/data/jbi/example-service-assembly/example/example-camel-routing/lib/example-service-1.3.4-SNAPSHOT.jar!/database-config.xml]: Invocation of init method failed; nested exception is java.lang.LinkageError: loader constraint violation: when resolving field "logger" the class loader (instance of org/apache/xbean/classloader/JarFileClassLoader) of the referring class, org/springframework/transaction/support/AbstractPlatformTransactionManager, and the class loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) for the field's resolved type, org/apache/commons/logging/Log, have different Class objects for that type
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)

Environment

  • Red Hat JBoss Fuse
    • 6.0
  • Spring Framework
  • Hibernate Core
  • Hibernate Validator

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content