Using custom NettyAcceptorFactor (messaging-activemq)

16 views
Skip to first unread message

M K

unread,
Mar 17, 2026, 5:21:44 AM (5 days ago) Mar 17
to WildFly
Hello,

we implemented our own NettyAcceptorFactory and configured its usage in the standalone.xml as follows:

<subsystem xmlns="urn:jboss:domain:messaging-activemq:17.0">
    [...]
    <server name="default">
        [...]
        <acceptor name="stomp-acceptor" factory-class="tld.redacted.activemq.netty.NettyAcceptorFactory">
            [...]

The implementation is done in a custom module which is added like this:

<subsystem xmlns="urn:jboss:domain:ee:6.0">
    <global-modules>
        <module name="tld.redacted.activemq" slot="main" />

The module.xml looks like this:

<?xml version="1.0" encoding='UTF-8'?>
<module xmlns="urn:jboss:module:1.9" name="tld.redacted.activemq">
    <resources>
        <resource-root path="redacted-activemq.jar"/>
    </resources>

    <dependencies>
        <module name="javax.api"/>
        <module name="org.apache.activemq.artemis.client"/>
        <module name="org.apache.activemq.artemis"/>
        <module name="org.apache.commons.lang3"/>
        <module name="org.bouncycastle.bcprov"/>
        <module name="org.bouncycastle.bcpkix"/>
        <module name="org.jboss.logging"/>
        <module name="org.jboss.msc"/>
    </dependencies>
</module>

During WildFly startup the following error occurs:

2026-03-17 09:58:25,430 WARN  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 56) AMQ222080: Error creating acceptor: stomp-acceptor: java.lang.IllegalStateException: java.lang.ClassNotFoundException: tld.redacted.activemq.netty.NettyAcceptorFactory from [Module "org.wildfly.extension.messaging-activemq" from local module loader @7fc6de5b (finder: local module finder @21baa903 (roots: C:\redacted\server\modules,C:\redacted\server\modules\system\layers\base))]
at org.apache.active...@2.44.0//org.apache.activemq.artemis.utils.ClassloadingUtil.newInstanceFromClassLoader(ClassloadingUtil.java:62)
at org.apache.active...@2.44.0//org.apache.activemq.artemis.utils.ClassloadingUtil.newInstanceFromClassLoader(ClassloadingUtil.java:40)
at org.apache.ac...@2.44.0//org.apache.activemq.artemis.core.server.impl.ServiceRegistryImpl.lambda$loadClass$0(ServiceRegistryImpl.java:253)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
at org.apache.active...@2.44.0//org.apache.activemq.artemis.utils.sm.SecurityManagerShim.doPrivileged(SecurityManagerShim.java:144)
at org.apache.ac...@2.44.0//org.apache.activemq.artemis.core.server.impl.ServiceRegistryImpl.loadClass(ServiceRegistryImpl.java:253)
at org.apache.ac...@2.44.0//org.apache.activemq.artemis.core.server.impl.ServiceRegistryImpl.getAcceptorFactory(ServiceRegistryImpl.java:239)
at org.apache.ac...@2.44.0//org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl.createAcceptor(RemotingServiceImpl.java:257)
at org.apache.ac...@2.44.0//org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl.start(RemotingServiceImpl.java:229)
at org.apache.ac...@2.44.0//org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.initialisePart2(ActiveMQServerImpl.java:3540)
at org.apache.ac...@2.44.0//org.apache.activemq.artemis.core.server.impl.PrimaryOnlyActivation.run(PrimaryOnlyActivation.java:78)
at org.apache.ac...@2.44.0//org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:754)
at org.apache.ac...@2.44.0//org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:644)
at org.apache.ac...@2.44.0//org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.start(JMSServerManagerImpl.java:354)
at org.wildfly.extension.messaging-activemq//org.wildfly.extension.messaging.activemq.jms.JMSService.doStart(JMSService.java:194)
at org.wildfly.extension.messaging-activemq//org.wildfly.extension.messaging.activemq.jms.JMSService$1.run(JMSService.java:84)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.jbos...@3.9.2//org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
at org.jbos...@3.9.2//org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2651)
at org.jbos...@3.9.2//org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2630)
at org.jbos...@3.9.2//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1586)
at java.base/java.lang.Thread.run(Thread.java:840)
at org.jbos...@3.9.2//org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: java.lang.ClassNotFoundException: tld.redacted.activemq.netty.NettyAcceptorFactory from [Module "org.wildfly.extension.messaging-activemq" from local module loader @7fc6de5b (finder: local module finder @21baa903 (roots: C:\redacted\server\modules,C:\redacted\server\modules\system\layers\base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:201)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:408)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:396)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:115)
at org.apache.active...@2.44.0//org.apache.activemq.artemis.utils.ClassloadingUtil.loadWithCheck(ClassloadingUtil.java:86)
at org.apache.active...@2.44.0//org.apache.activemq.artemis.utils.ClassloadingUtil.getInstanceWithTypeCheck(ClassloadingUtil.java:72)
at org.apache.active...@2.44.0//org.apache.activemq.artemis.utils.ClassloadingUtil.newInstanceFromClassLoader(ClassloadingUtil.java:58)
... 23 more

It works if we add our module as a dependency to the messaging-activemq module. But we would like to avoid modifying a stock module if possible.

Is there another way? What would be the best or recommended way to make it work?

Thank you very much in advance!
Greetings
Manuel K

Emmanuel Hugonnet

unread,
Mar 18, 2026, 9:37:03 AM (3 days ago) Mar 18
to wil...@googlegroups.com
I'm afraid that's the only way to do it properly is to add it to the extension module.
Defining it as a global module only makes it available to the deployment but since it is the extension that creates the acceptor the class
must be available to the server .
Emmanuel

Le 17/03/2026 à 02:21, M K a écrit :
> Hello,
>
> we implemented our own /NettyAcceptorFactory /and configured its usage in the /standalone.xml/ as follows:
>
> <subsystem xmlns="urn:jboss:domain:messaging-activemq:17.0">
>     [...]
>     <server name="default">
>         [...]
>         <acceptor name="stomp-acceptor" factory-class="tld.redacted.activemq.netty.NettyAcceptorFactory">
>             [...]
>
> The implementation is done in a custom module which is added like this:
>
> <subsystem xmlns="urn:jboss:domain:ee:6.0">
>     <global-modules>
>         <module name="tld.redacted.activemq" slot="main" />
>
> The /module.xml/ looks like this:
> It works if we add our module as a dependency to the /messaging-activemq/ module. But we would like to avoid modifying a stock module if
> possible.
>
> Is there another way? What would be the best or recommended way to make it work?
>
> Thank you very much in advance!
> Greetings
> Manuel K
> --
> 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 visit https://groups.google.com/d/msgid/wildfly/c33dde10-edb4-4d79-95d9-4d126385ac4an%40googlegroups.com
> <https://groups.google.com/d/msgid/wildfly/c33dde10-edb4-4d79-95d9-4d126385ac4an%40googlegroups.com?utm_medium=email&utm_source=footer>.

M K

unread,
Mar 18, 2026, 11:40:29 AM (3 days ago) Mar 18
to WildFly
Thank you very much for your reply Emmanuel - then that's what we will do ;-).

Greetings
Manuel
Reply all
Reply to author
Forward
0 new messages