javax.naming.NameNotFoundException: jms/RemoteConnectionFactory -- service jboss.naming.context.java.jboss.exported.jms.RemoteConnectionFactory

Solution Verified - Updated -

Issue

  • We are getting a NameNotFound exception. Also we are using the string jms/RemoteConnectionFactory. Here is the stack trace, when we tried to connect from a remote VM.
INFO: JBoss Remoting version 3.2.14.GA-redhat-1
javax.naming.NameNotFoundException: jms/RemoteConnectionFactory -- service jboss.naming.context.java.jboss.exported.jms.RemoteConnectionFactory
        at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:103)
        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:197)
        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:174)
        at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:127)
        at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

  • We are getting the below error on JBoss startup when deploying automatically at startup the application:
ERROR Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined in ServletContext nested exception is javax.naming.NameNotFoundException: jms/RemoteConnectionFactory
...

ERROR [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 66) Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: jms/RemoteConnectionFactory -- service jboss.naming.context.java.jboss.exported.jms.RemoteConnectionFactory
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
    at 
...
...

Caused by: javax.naming.NameNotFoundException: jms/RemoteConnectionFactory -- service jboss.naming.context.java.jboss.exported.jms.RemoteConnectionFactory
    at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:103)
    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:197)
    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:174)
    at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]
.....
  • It seems when the application is deployed, the connection factory is not yet available into JNDI tree. We have tried to startup jboss without the automatical deploy of application and then deploy it via CLI and the error didn't occur!
  • How could we solve this issue? Because we cannot deploy application via CLI.

Environment

  • Red Hat JBoss Enterprise Application Platform(EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.