How to fix ClassNotFoundException exception on org.jboss.naming.remote.client.InitialContextFactory class while executing a JMS client code using JMS API in BPMS 6 ?

Solution Verified - Updated -

Issue

  • BPMS 6 supports the use of JMS messages for starting and managing business processes as well as managing Human Tasks through command request messages [1]. However, when creating the InitialContext the standalone JMS client code throws java.lang.ClassNotFoundException on org.jboss.naming.remote.client.InitialContextFactory as shown below. How to fix this issue?
...
Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org.jboss.naming.remote.client.InitialContextFactory [Root exception is java.lang.ClassNotFoundException: org.jboss.naming.remote.client.InitialContextFactory]
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:674)
        at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
        at javax.naming.InitialContext.init(InitialContext.java:242)
        at javax.naming.InitialContext.<init>(InitialContext.java:216)
        at com.sample.test.remote.GetRemoteJMSConnection.getInitialContext(GetRemoteJMSConnection.java:152)
        ... 33 more
Caused by: java.lang.ClassNotFoundException: org.jboss.naming.remote.client.InitialContextFactory
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:270)
        at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:63)
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
        ... 371 more

[1] 17.3. JMS

Environment

  • Red Hat JBoss BPM Suite (BPMS)
    • 6.0.x

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