5 Replies Latest reply: Apr 20, 2012 9:21 AM by Abhijit Prusty RSS

javax.naming.NameNotFoundException: ConnectionFactory not bound

Shil K Newbie

Hi All,


I am configuring the conenction factory in JBoss 6 and I am just using the inbuilt connection factory called InVmConnection factory in my code but


I am still getting connection factory not bound.


Is there something specific which needs to be done for setting up the connection factory. Appreciate your response.





  • 1. Re: javax.naming.NameNotFoundException: ConnectionFactory not bound
    jaikiran pai Master

    You'll have to add more details including the exception stacktrace, any relevant code and the configurations.

  • 2. Re: javax.naming.NameNotFoundException: ConnectionFactory not bound
    Shil K Newbie

    Hi Jai,



    Actually in one of java class I am just using the inbuilt connection factory declared in hornetq-jms.xml and since the jndi name is java:/ConnectionFactory I am using that name but I getting the following exception. I dont know what am I missing.

    here is the stack trace :


    play.exceptions.JavaExecutionException: javax.naming.NameNotFoundException: ConnectionFactory not bound

    2011-06-28 17:40:25,711 INFO  [STDOUT] (http-  at play.mvc.ActionInvoker.invoke(ActionInvoker.java:290)

    2011-06-28 17:40:25,711 INFO  [STDOUT] (http-  at play.server.ServletWrapper$ServletInvocation.execute(ServletWrapper.java:476)

    2011-06-28 17:40:25,711 INFO  [STDOUT] (http-  at play.Invoker$Invocation.run(Invoker.java:187)

    2011-06-28 17:40:25,711 INFO  [STDOUT] (http-  at play.server.ServletWrapper$ServletInvocation.run(ServletWrapper.java:467)

    2011-06-28 17:40:25,711 INFO  [STDOUT] (http-  at play.Invoker.invokeInThread(Invoker.java:61)

    2011-06-28 17:40:25,711 INFO  [STDOUT] (http-  at play.server.ServletWrapper.service(ServletWrapper.java:117)

    2011-06-28 17:40:25,711 INFO  [STDOUT] (http-  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

    2011-06-28 17:40:25,711 INFO  [STDOUT] (http-  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)

    2011-06-28 17:40:25,711 INFO  [STDOUT] (http-  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)

    2011-06-28 17:40:25,711 INFO  [STDOUT] (http-  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

    2011-06-28 17:40:25,711 INFO  [STDOUT] (http-  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

    2011-06-28 17:40:25,711 INFO  [STDOUT] (http-  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)

    2011-06-28 17:40:25,726 INFO  [STDOUT] (http-  at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)

    2011-06-28 17:40:25,726 INFO  [STDOUT] (http-  at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)

    2011-06-28 17:40:25,726 INFO  [STDOUT] (http-  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)

    2011-06-28 17:40:25,726 INFO  [STDOUT] (http-  at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)

    2011-06-28 17:40:25,726 INFO  [STDOUT] (http-  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

    2011-06-28 17:40:25,726 INFO  [STDOUT] (http-  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

    2011-06-28 17:40:25,726 INFO  [STDOUT] (http-  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

    2011-06-28 17:40:25,726 INFO  [STDOUT] (http-  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

    2011-06-28 17:40:25,726 INFO  [STDOUT] (http-  at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)

    2011-06-28 17:40:25,726 INFO  [STDOUT] (http-  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)

    2011-06-28 17:40:25,726 INFO  [STDOUT] (http-  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

    2011-06-28 17:40:25,726 INFO  [STDOUT] (http-  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)

    2011-06-28 17:40:25,726 INFO  [STDOUT] (http-  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)

    2011-06-28 17:40:25,726 INFO  [STDOUT] (http-  at java.lang.Thread.run(Thread.java:619)

    2011-06-28 17:40:25,742 INFO  [STDOUT] (http- Caused by: com.axispoint.sep.bus.BusDestinationException: javax.naming.NameNotFoundException: JmsXA not bound

    2011-06-28 17:40:25,742 INFO  [STDOUT] (http-  at com.axispoint.sep.bus.BusDestinationImpl.subscribe(BusDestinationImpl.java:132)

    2011-06-28 17:40:25,742 INFO  [STDOUT] (http-  at controllers.Application.bindQueueListener(Application.java:51)

    2011-06-28 17:40:25,742 INFO  [STDOUT] (http-  at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:413)

    2011-06-28 17:40:25,742 INFO  [STDOUT] (http-  at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:408)

    2011-06-28 17:40:25,742 INFO  [STDOUT] (http-  at play.mvc.ActionInvoker.invoke(ActionInvoker.java:161)

    2011-06-28 17:40:25,742 INFO  [STDOUT] (http-  ... 25 more

  • 3. Re: javax.naming.NameNotFoundException: ConnectionFactory not bound
    Shil K Newbie

    Could anyone please help:


    I tried to use ThroughputConenctionfactory and when I try to do the look up it gives the following error


      ClassCastException occured : org.hornetq.jms.client.HornetQConnectionFactory cannot be cast to javax.jms.ConnectionFactory


    Can anyone plzz help or give some suggestions

  • 4. Re: javax.naming.NameNotFoundException: ConnectionFactory not bound
    Shil K Newbie

    I fixed it. It was jms.jar conflict. Applciation was using one more jms.jar in addition to the one provided by jboss

  • 5. Re: javax.naming.NameNotFoundException: ConnectionFactory not bound
    Abhijit Prusty Newbie

    I had a big issue with this problem spend around one week of time. With help of google and leads I found of solution which worked for me.


    if you using the JBOSS 6.1.0 version there is issue with hornet, it does't create queues properly. For test you can go to admin console, JMS MANAGER--->JMS QUEUES---> and delete any and try to re-create it wont, but connectiona fctory will be created without any issue.


    So, I downloaded JBOSS 6.0.0 verison, in this there is issue with creation of connection factory, but this can be created using the hornet-jms.xml adding this entry


    <connection-factory name="sspConnectionFactory">


             <connector-ref connector-name="in-vm"/>



             <entry name="/sspConnectionFactory"/>

             <entry name="/XAConnectionFactory"/>







    <queue name="insertUsageQueue">

          <entry name="/jms/insertUsageQueue"/>




       <queue name="callbackExchangeQueue">

          <entry name="/jms/callbackExchangeQueue"/>




       <queue name="emailCaseManagementQueue">

          <entry name="/jms/emailCaseManagementQueue"/>




       <queue name="emailPoisonQueue">

          <entry name="/jms/emailPoisonQueue"/>




    Note : first add the connectionfactory tags and put queues in queues place.



    After this also, your queue might not work, so what you do is go to admin console and create the queues from there. But dont, delete the entries under the hornet-jms.xml.


    And try to redeploy. Also, keep the jndiname syntax proper.

    like eg. <property name="jndiName"><value>/jms/insertUsageQueue</value></property> my jms is the root


    for your referce use this to find out the structure jndi is created


    Go to http://< server>:< port>/jmx-console (Ex: http://localhost:9999/jmx-console)

        - Search for service=JNDIView on the jmx-console page

        - Click on that link

        - On the page that comes up click on the Invoke button beside the list() method

        - The page that comes up will show the contents of the JNDI tree.