JBoss EAP 7.4.0 java.lang.LinkageError: loader constraint violation

819 views
Skip to first unread message

Rihards Dzerkals

unread,
Jul 20, 2022, 10:40:10 AM7/20/22
to WildFly
Hello, could please someone help me out with this or give me a hint on what to do, I'm really stuck on this, I know that it's some problem with dependencies, but I can't figure out what to do.

some backstory:

So I'm using Jboss to connect to remote ActiveMQ Artemis cluster, the connection works fine, but the problem comes up when I'm trying to deploy my .ear file to Jboss. 
In my standalone-full-ha.xml I'm using a global-module :
            <global-modules>
                <module name="fi.prh.artemis.rar"/>
            </global-modules>

My ear file has 1 jar file inside.
SyncMQ.ear
|
--sync-trigger.consumer.jar

When deploying I'm getting error: 
17:33:58,683 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."SyncMQ.ear".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."SyncMQ.ear".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "SyncMQ.ear"
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:189)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
        at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
        at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.jboss.logging.DelegatingBasicLogger.log(Lorg/jboss/logging/Logger$Level;Ljava/lang/Object;Ljava/lang/Throwable;)V" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/hibernate/jpa/internal/EntityManagerMessageLogger_$logger, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for interface org/jboss/logging/BasicLogger have different Class objects for the type org/jboss/logging/Logger$Level used in the signature
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at org.jboss.logging.Logger$1.run(Logger.java:2554)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.jboss.logging.Logger.getMessageLogger(Logger.java:2529)
        at org.jboss.logging.Logger.getMessageLogger(Logger.java:2516)
        at org.hibernate.jpa.internal.HEMLogging.messageLogger(HEMLogging.java:45)
        at org.hibernate.jpa.internal.HEMLogging.messageLogger(HEMLogging.java:41)
        at org.hibernate.ejb.HibernatePersistence.<clinit>(HibernatePersistence.java:46)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.jboss.as.jpa.processor.PersistenceProviderHandler.deploy(PersistenceProviderHandler.java:75)
        at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:49)
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:182)
        ... 8 more

James Perkins

unread,
Jul 21, 2022, 12:21:45 PM7/21/22
to WildFly
Are you including Hibernate and and JBoss Logging in your EAR?

Rihards Dzerkals

unread,
Jul 22, 2022, 3:46:26 AM7/22/22
to WildFly
Hello, 
We are using log4j for logging, BUT we do have  jboss-logging-3.1.3.GA.jar in libs, can't find any hibernate logging .jars (maybe they are called somewhat else), but the problem is that this .jar is downloaded by another dependencie (which is unknown), we are using IvyIDEA to get dependencies. What are my choices ? Problably one of them is just to delete the .jar from ear's library, but I can't really do it, since it will get just get downloaded again, maybe there is some workaround ? I'm just really new to all of this JBoss stuff..

James Perkins

unread,
Jul 22, 2022, 11:22:17 AM7/22/22
to WildFly
Hello,
Ideally you don't want any of the provided JAR's in your EAR. JBoss EAP 7.4 is using a newer version of jboss-logging which is likely the issue. I don't really know anything about IvyIDEA, but is there a way to exclude dependencies during the build?

Rihards Dzerkals

unread,
Jul 26, 2022, 10:32:15 AM7/26/22
to WildFly
Hello, sorry for the late answer :).
There is a way to exclude dependencies in IvyIDEA -> I tried it out, first tried excluding commons-logging, that didn't work out, because build errors started to show up, then tried excluding jboss-logging, that didn't get rid of the deployment error as well, BUT IN THE END I fixed it (yeeey).
The fix was pretty easy, I just updated my org="org.hibernate" name="hibernate-entitymanager" rev="5.3.20.Final" jar version from 4.3.20 to 5.3.20 to match .jar which is in jbosses modules, not the ideal variant as I understand from your post, but at least it's deploying now and everything seems to work fine :). Feels really weird to work with jboss when you haven't done anything in it, was a fun "trip" into jboss'es world. 

Big thanks dude <3, at least I had an idea what to look for and what to try to do after reading your answer, if there is something I need to do or press please tell me (I mean like in stackoverflow you have to press on right answer or something).

James Perkins

unread,
Jul 26, 2022, 10:39:51 AM7/26/22
to WildFly
Nice. It is best to not include the dependencies in your deployment as the server does provide them, but if it's working it's working :)

There is nothing special you've got to do here.

Reply all
Reply to author
Forward
0 new messages