Wildfly 22 MDB class linking Issue in JMS

227 views
Skip to first unread message

[ V ]

unread,
Oct 10, 2023, 12:34:21 AM10/10/23
to WildFly
  Hi, 

I'm trying to deploy an old EJB application on Wildfly 22.0 but while deploying it gives below error with respect to the MDB class.
But the catch is I deployed the same EAR package on Wildfly 20.0 and it runs fine over there. Do i need to make any changes in the standlaon-full.xml configurations or there's chance of any conflict in the dependencies? The jboss dependencies in the EJB module are also mentioned below :

java.lang.NoClassDefFoundError: Failed to link com/a/b/ejb/OrderProcessorMDB (Module "deployment.foxweb-ear.ear.foxweb-ejb-13.0.8.jar" from Service Module Loader): javax/jms/MessageListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:756) at java.lang.ClassLoader.defineClass(ClassLoader.java:832) at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:424) at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:555) at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:339) at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126) at org.jboss.modules.Module.loadModuleClass(Module.java:753) at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at org.jboss.as.ee.utils.ClassLoadingUtils.loadClass(ClassLoadingUtils.java:21) at org.jboss.as.ejb3.deployment.processors.dd.DeploymentDescriptorMethodProcessor.handleSessionBean(DeploymentDescriptorMethodProcessor.java:119) at org.jboss.as.ejb3.deployment.processors.dd.DeploymentDescriptorMethodProcessor.deploy(DeploymentDescriptorMethodProcessor.java:74) at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:182) ... 8 more

JBoss dependencies :

<dependencyManagement>

<dependencies>

<dependency>

<groupId>org.jboss.spec</groupId>

<artifactId>jboss-javaee-6.0</artifactId>

<version>${jboss-javaee-version}</version>

<type>pom</type>

<scope>import</scope>

</dependency>

<dependency>

<groupId>org.jboss.as</groupId>

<artifactId>jboss-as-jms-client-bom</artifactId>

<version>${jboss-as-jms-client-bom-version}</version>

<type>pom</type>

<scope>import</scope>

</dependency>

</dependencies>

</dependencyManagement>

<dependencies>

<dependency>

<groupId>org.jboss.spec.javax.ejb</groupId>

<artifactId>jboss-ejb-api_3.1_spec</artifactId>

<version>${jboss-ejb-api_3.1_spec-version}</version>

<scope>provided</scope>

</dependency>


<dependency>

<groupId>org.jboss.ejb3</groupId>

<artifactId>jboss-ejb3-ext-api</artifactId>

<version>${jboss-ejb3-ext-api-version}</version>

</dependency>


<dependency>

<groupId>org.jboss.spec</groupId>

<artifactId>jboss-javaee-6.0</artifactId>

<version>${jboss-javaee-version}</version>

<type>pom</type>

<scope>provided</scope>

</dependency>


<dependency>

<groupId>org.jboss.spec.javax.jms</groupId>

<artifactId>jboss-jms-api_1.1_spec</artifactId>

<version>${jboss-jms-api-version}</version>

<scope>provided</scope>

</dependency>

<dependency>

<groupId>org.jboss.spec.javax.jms</groupId>

<artifactId>jboss-jms-api_1.1_spec</artifactId>

<version>${jboss-jms-api-version}</version>

<scope>provided</scope>

</dependency>


<dependency>

<groupId>org.jboss</groupId>

<artifactId>jboss-remote-naming</artifactId>

<version>1.0.7.Final</version>

<scope>provided</scope>

</dependency>

</dependencies>



The above pom file entries are as it is in the old application. 

Thanks

Emmanuel Hugonnet

unread,
Oct 10, 2023, 3:06:05 AM10/10/23
to wil...@googlegroups.com
Could you check that there is no jms api jar in your ear / jar ?
Emmanuel


Le 10/10/2023 à 06:34, [ V ] a écrit :
>   Hi,
>
> I'm trying to deploy an old EJB application on Wildfly 22.0 but while deploying it gives below error with respect to the MDB class.
> But the catch is I deployed the same EAR package on Wildfly 20.0 and it runs fine over there. Do i need to make any changes in the
> standlaon-full.xml configurations or there's chance of any conflict in the dependencies? The jboss dependencies in the EJB module are also
> mentioned below :
>
> java.lang.NoClassDefFoundError: Failed to link com/a/b/ejb/OrderProcessorMDB (Module "deployment.foxweb-ear.ear.foxweb-ejb-13.0.8.jar"
> from Service Module Loader): *javax/jms/MessageListener* at java.lang.ClassLoader.defineClass1(Native Method) at
> --
> You received this message because you are subscribed to the Google Groups "WildFly" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/wildfly/840f5ef6-98c2-4338-82ed-4e5b1086bd8bn%40googlegroups.com
> <https://groups.google.com/d/msgid/wildfly/840f5ef6-98c2-4338-82ed-4e5b1086bd8bn%40googlegroups.com?utm_medium=email&utm_source=footer>.

[ V ]

unread,
Oct 10, 2023, 3:45:11 AM10/10/23
to WildFly
Hi Emmanuel, 

Thanks for reverting on this so quickly. 

Well, there is this "jboss-jms-api_1.1_spec" dependency in the EJB project that is mentioned in the pom. This might be the potential jar but I tried exluding it from the ejb project in jboss deployment descriptor but it still shows the same error to me. 

I checked and compared both the standalone-full.xml configs and i see difference ther for both WF 22 and 20  for "urn:jboss:domain:messaging-activemq" subsystem configs as shown below. Do i need to make any adjustments in there to make my project deployed and work properly, is this relevant?

WF 22.0 

<subsystem xmlns="urn:jboss:domain:messaging-activemq:12.0">
            <remote-connector name="artemis" socket-binding="messaging-activemq">
                <param name="use-nio" value="true"/>
                <param name="use-nio-global-worker-pool" value="true"/>
            </remote-connector>
            <pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="artemis" transaction="xa" user="guest" password="guest"/>
</subsystem>


WF 20.0

<subsystem xmlns="urn:jboss:domain:messaging-activemq:10.0">
            <server name="default">
                <statistics enabled="${wildfly.messaging-activemq.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
                <security-setting name="#">
                    <role name="guest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>
                </security-setting>
                <address-setting name="#" dead-letter-address="jms.queue.DLQ" expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760" page-size-bytes="2097152" message-counter-history-day-limit="10"/>
                <http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/>
                <http-connector name="http-connector-throughput" socket-binding="http" endpoint="http-acceptor-throughput">
                    <param name="batch-delay" value="50"/>
                </http-connector>
                <in-vm-connector name="in-vm" server-id="0">
                    <param name="buffer-pooling" value="false"/>
                </in-vm-connector>
                <http-acceptor name="http-acceptor" http-listener="default"/>
                <http-acceptor name="http-acceptor-throughput" http-listener="default">
                    <param name="batch-delay" value="50"/>
                    <param name="direct-deliver" value="false"/>
                </http-acceptor>
                <in-vm-acceptor name="in-vm" server-id="0">
                    <param name="buffer-pooling" value="false"/>
                </in-vm-acceptor>
                <jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/>
                <jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/>
                <connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/>
                <connection-factory name="RemoteConnectionFactory" entries="java:jboss/exported/jms/RemoteConnectionFactory" connectors="http-connector"/>
                <pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/>
            </server>
        </subsystem>

Emmanuel Hugonnet

unread,
Oct 10, 2023, 4:00:48 AM10/10/23
to wil...@googlegroups.com
There is a big change in your configuration as the 20 has the embedded artemis broker while 22 tries to connect to a remote artemis broker.
Try to reuse the same configuration file in 22 as in 20.
In my humble opinion you should also move to 26.
Emmanuel

Le 10/10/2023 à 09:45, [ V ] a écrit :
> Hi Emmanuel,
>
> Thanks for reverting on this so quickly.
>
> Well, there is this "jboss-jms-api_1.1_spec" dependency in the EJB project that is mentioned in the pom. This might be the potential jar
> but I tried exluding it from the ejb project in jboss deployment descriptor but it still shows the same error to me.
>
> I checked and compared both the standalone-full.xml configs and i see difference ther for both WF 22 and 20  for
> "urn:jboss:domain:messaging-activemq" subsystem configs as shown below. Do i need to make any adjustments in there to make my project
> deployed and work properly, is this relevant?
>
> *_WF 22.0 _*
> *_
> _*
> <subsystem xmlns="urn:jboss:domain:messaging-activemq:12.0">
>             <remote-connector name="artemis" socket-binding="messaging-activemq">
>                 <param name="use-nio" value="true"/>
>                 <param name="use-nio-global-worker-pool" value="true"/>
>             </remote-connector>
>           <pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="artemis"
> transaction="xa" user="guest" password="guest"/>
> </subsystem>
>
>
> *_WF 20.0_*
> *
> *
> > <groupId>org.jboss.as <http://org.jboss.as></groupId>
> <https://groups.google.com/d/msgid/wildfly/840f5ef6-98c2-4338-82ed-4e5b1086bd8bn%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
> --
> You received this message because you are subscribed to the Google Groups "WildFly" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/wildfly/af24426b-0cbb-4af4-a493-010085238586n%40googlegroups.com
> <https://groups.google.com/d/msgid/wildfly/af24426b-0cbb-4af4-a493-010085238586n%40googlegroups.com?utm_medium=email&utm_source=footer>.

[ V ]

unread,
Oct 10, 2023, 4:53:10 AM10/10/23
to WildFly
Well, I had tried to place the same activmq subsystem configs in WF 22 as present in WF 20 but it didn't work right away. I think something else also needs to be taken care. Do you have link to official documentation pertaining to it?

My project is on Java 8 so moving to WF 26 is a big leap for now. 

Emmanuel Hugonnet

unread,
Oct 10, 2023, 4:58:03 AM10/10/23
to wil...@googlegroups.com

Brad Maxwell

unread,
Oct 10, 2023, 4:49:28 PM10/10/23
to WildFly
All of those dependencies should be provided as they are in WF.  The only time they should not be provided is if they are not in WF.  The dependency management looks out of date, WF 22, WF26 are Jakarta EE 8 not Java EE 6.  The JMS spec API changed from 1.1 to 2.0, though you should make sure there after building the app that there are no jars with these classes javax.jms.Message / javax.jms.MessageListener in the app and that you do not have a jboss-deployment-structure.xml in the app modifying the classloading to cause the issue as by default even if you packaged jms-api.jar it should get ignored unless you modified the classloading behavior.

[ V ]

unread,
Oct 11, 2023, 3:39:14 AM10/11/23
to WildFly
Well I've tried the latest dependencies as you mentined but didn't put them under 'provided' scope, i'll try that now. Also wouldn't marking all the dependencies scope to 'provided' would exclude the jars from the Project build automatically? 

Also, I do have jboss-deployment-structure.xml in the app and can exclude the module having javax.jms.MessageListener in them. I didn't get the last line, should i be making changes in thr jboss-deployment-structure.xml or i shouldn't be doing it?

Reply all
Reply to author
Forward
0 new messages