4 Replies Latest reply on Dec 14, 2011 3:05 PM by plmc41

    NameNotFoundException with "Not Bound" message

    memunis

      I have a stateless EJB application packaged as jar file, where ejb-jar.xml, jboss.xml & persistence.xml files are there.  I am using the lookup in a web application as below:

      I am doing lookup as:

                      InitialContext ic = new InitialContext();

                      Object ref = ic.lookup("InduspnUserAdminReadInterface");

                      UserAdminReadInt localUserAdminRead = (UserAdminReadInt)PortableRemoteObject.narrow(ref,UserAdminReadInt.class);

       

       

      My web application has web.xml & jboss-web.xml files (Pls find attachment).  in jboss-4.0.5 it is working fine with my code.  when I deployed in jboss6.1.0 Final, it is giving the NameNotFoundException with "not bound"

       

       

       

      **************************************

       

       

       

      2011-11-22 20:23:11,742 ERROR [STDERR] (http-0.0.0.0-8080-5) javax.naming.NameNotFoundException: InduspnUserAdminReadInterface not bound

      2011-11-22 20:23:11,743 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)

      2011-11-22 20:23:11,743 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)

      2011-11-22 20:23:11,743 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.jnp.server.NamingServer.getObject(NamingServer.java:785)

      2011-11-22 20:23:11,743 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.jnp.server.NamingServer.lookup(NamingServer.java:443)

      2011-11-22 20:23:11,743 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728)

      2011-11-22 20:23:11,743 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)

      2011-11-22 20:23:11,743 ERROR [STDERR] (http-0.0.0.0-8080-5)    at javax.naming.InitialContext.lookup(InitialContext.java:392)

      2011-11-22 20:23:11,743 ERROR [STDERR] (http-0.0.0.0-8080-5)    at com.induspn.servlet.InduspnAdminServlet.doPost(InduspnAdminServlet.java:132)

      2011-11-22 20:23:11,743 ERROR [STDERR] (http-0.0.0.0-8080-5)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)

      2011-11-22 20:23:11,744 ERROR [STDERR] (http-0.0.0.0-8080-5)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

      2011-11-22 20:23:11,744 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)

      2011-11-22 20:23:11,744 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)

      2011-11-22 20:23:11,744 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

      2011-11-22 20:23:11,744 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

      2011-11-22 20:23:11,744 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)

      2011-11-22 20:23:11,744 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)

      2011-11-22 20:23:11,744 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)

      2011-11-22 20:23:11,744 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)

      2011-11-22 20:23:11,745 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)

      2011-11-22 20:23:11,745 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159)

      2011-11-22 20:23:11,745 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

      2011-11-22 20:23:11,745 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

      2011-11-22 20:23:11,745 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

      2011-11-22 20:23:11,745 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)

      2011-11-22 20:23:11,745 ERROR [STDERR] (http-0.0.0.0-8080-5)    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)

       

       

       

       

      ******************************

        • 1. Re: NameNotFoundException with "Not Bound" message
          mp911de

          Hi Munna,

          do you know the jmx-console and the JNDIView service? These tools will help you to check, what is contained in the JNDI. The jmx-console is preinstalled on your JBoss (usually http://localhost:8080/jmx-console).

           

          Best regards,

          Mark

          • 2. Re: NameNotFoundException with "Not Bound" message
            memunis

            Thanks.  But my JNDI view shows as below:

            how could I correct my JNDI name.. can you help me identify where the issue is?

             

            java: Namespace

             

              
              +- hibernateDatasource (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
              +- securityManagement (class: org.jboss.security.integration.JNDIBasedSecurityManagement)
              +- comp (class: javax.naming.Context)
              |   +- TransactionSynchronizationRegistry[link -> java:TransactionSynchronizationRegistry] (class: javax.naming.LinkRef)
              |   +- UserTransaction[link -> UserTransaction] (class: javax.naming.LinkRef)
              |   +- env (class: org.jnp.interfaces.NamingContext)
              |   |   +- security (class: org.jnp.interfaces.NamingContext)
              |   |   |   +- securityMgr[link -> java:/jaas/jboss-web-policy] (class: javax.naming.LinkRef)
              |   |   |   +- subject[link -> java:/jaas/jboss-web-policy/subject] (class: javax.naming.LinkRef)
              |   |   |   +- realmMapping[link -> java:/jaas/jboss-web-policy/realmMapping] (class: javax.naming.LinkRef)
              |   |   |   +- security-domain[link -> java:/jaas/jboss-web-policy] (class: javax.naming.LinkRef)
              |   |   |   +- authorizationMgr[link -> java:/jaas/jboss-web-policy/authorizationMgr] (class: javax.naming.LinkRef)
              |   +- ORB[link -> java:/JBossCorbaORB] (class: javax.naming.LinkRef)
              |   +- BeanManager (class: org.jnp.interfaces.MarshalledValuePair)
              |   +- ModuleName (class: java.lang.String)
              +- XAConnectionFactory (class: org.hornetq.jms.client.HornetQXAConnectionFactory)
              +- JmsXA (class: org.hornetq.ra.HornetQRAConnectionFactoryImpl)
              +- MySqlSnapProfile (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
              +- MySqlVasReadProfile (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
              +- policyRegistration (class: org.jboss.security.plugins.JBossPolicyRegistration)
              +- TransactionPropagationContextImporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
              +- app (class: javax.naming.Context)
              |   +- jmx-console (class: org.jnp.interfaces.NamingContext)
              |   +- AppName (class: java.lang.String)
              +- Mail (class: javax.mail.Session)
              +- TransactionPropagationContextExporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
              +- ProfileService (class: org.jboss.profileservice.AbstractProfileService)
              +- MySqlSnapReadProfile (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
              +- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
              +- jaas (class: javax.naming.Context)
              |   +- jmx-console (class: org.jboss.security.plugins.SecurityDomainContext)
              |   +- jboss-ejb-policy (class: org.jboss.security.plugins.SecurityDomainContext)
              |   +- hornetq (class: org.jboss.security.plugins.SecurityDomainContext)
              +- TransactionSynchronizationRegistry (class: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple)
              +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
              +- ConnectionFactory (class: org.hornetq.jms.client.HornetQXAConnectionFactory)
              +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
              +- TransactionManager (class: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate)
              +- timedCacheFactory (class: javax.naming.Context)
            Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy cannot be cast to javax.naming.NamingEnumeration
              +- module (class: javax.naming.Context)
              |   +- TransactionSynchronizationRegistry[link -> java:TransactionSynchronizationRegistry] (class: javax.naming.LinkRef)
              |   +- UserTransaction[link -> UserTransaction] (class: javax.naming.LinkRef)
              |   +- env (class: org.jnp.interfaces.NamingContext)
              |   |   +- security (class: org.jnp.interfaces.NamingContext)
              |   |   |   +- securityMgr[link -> java:/jaas/jboss-web-policy] (class: javax.naming.LinkRef)
              |   |   |   +- subject[link -> java:/jaas/jboss-web-policy/subject] (class: javax.naming.LinkRef)
              |   |   |   +- realmMapping[link -> java:/jaas/jboss-web-policy/realmMapping] (class: javax.naming.LinkRef)
              |   |   |   +- security-domain[link -> java:/jaas/jboss-web-policy] (class: javax.naming.LinkRef)
              |   |   |   +- authorizationMgr[link -> java:/jaas/jboss-web-policy/authorizationMgr] (class: javax.naming.LinkRef)
              |   +- ORB[link -> java:/JBossCorbaORB] (class: javax.naming.LinkRef)
              |   +- BeanManager (class: org.jnp.interfaces.MarshalledValuePair)
              |   +- ModuleName (class: java.lang.String)
              +- internal (class: org.jnp.interfaces.NamingContext)
              |   +- EJBContext (class: javax.ejb.EJBContext)
              |   +- TimerService (class: javax.ejb.TimerService)
              +- MySqlVasProfile (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
              +- global (class: org.jnp.interfaces.NamingContext)
              |   +- jmx-console (class: org.jnp.interfaces.NamingContext)
              |   +- ozcommons (class: org.jnp.interfaces.NamingContext)
              |   +- freemarker (class: org.jnp.interfaces.NamingContext)
              |   +- ROOT (class: org.jnp.interfaces.NamingContext)
              |   +- twitter4j-core-2.1.3-SNAPSHOT (class: org.jnp.interfaces.NamingContext)
              |   +- trial (class: org.jnp.interfaces.NamingContext)
              |   +- admin-console (class: org.jnp.interfaces.NamingContext)
              |   +- induspn (class: org.jnp.interfaces.NamingContext)
              |   |   +- XoteWriteEJB!com.induspn.server.XoteWriteInt[link -> InduspnXoteWriteInterface] (class: javax.naming.LinkRef)
              |   |   +- UserAdminReadEJB!com.induspn.server.UserAdminReadInt[link -> InduspnUserAdminReadInterface] (class: javax.naming.LinkRef)
              |   |   +- XotesTimerEJB!com.induspn.server.XotesTimerInt[link -> InduspnXotesTimerInterface] (class: javax.naming.LinkRef)
              |   |   +- XoteReadEJB[link -> InduspnXoteReadInterface] (class: javax.naming.LinkRef)
              |   |   +- UserAdminWriteEJB!com.induspn.server.UserAdminWriteInt[link -> InduspnUserAdminWriteInterface] (class: javax.naming.LinkRef)
              |   |   +- UserAdminWriteEJB[link -> InduspnUserAdminWriteInterface] (class: javax.naming.LinkRef)
              |   |   +- UserAdminReadEJB[link -> InduspnUserAdminReadInterface] (class: javax.naming.LinkRef)
              |   |   +- XoteWriteEJB[link -> InduspnXoteWriteInterface] (class: javax.naming.LinkRef)
              |   |   +- XotesTimerEJB[link -> InduspnXotesTimerInterface] (class: javax.naming.LinkRef)
              |   |   +- XoteReadEJB!com.induspn.server.XoteReadInt[link -> InduspnXoteReadInterface] (class: javax.naming.LinkRef)
              |   +- reports (class: org.jnp.interfaces.NamingContext)
              |   +- uuid-key-generator (class: org.jnp.interfaces.NamingContext)
              |   +- http-invoker (class: org.jnp.interfaces.NamingContext)
              |   |   +- invoker (class: org.jnp.interfaces.NamingContext)
              |   +- abimporter (class: org.jnp.interfaces.NamingContext)
              |   +- vasadmin (class: org.jnp.interfaces.NamingContext)
              |   +- cdi (class: org.jnp.interfaces.NamingContext)
            • 3. Re: NameNotFoundException with "Not Bound" message
              memunis

              Hi,

              Now I am getting the error in my Java:Namespace:

               

                +- hibernateDatasource (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
                +- securityManagement (class: org.jboss.security.integration.JNDIBasedSecurityManagement)
                +- comp (class: javax.naming.Context)
                |   +- TransactionSynchronizationRegistry[link -> java:TransactionSynchronizationRegistry] (class: javax.naming.LinkRef)
                |   +- UserTransaction[link -> UserTransaction] (class: javax.naming.LinkRef)
                |   +- env (class: org.jnp.interfaces.NamingContext)
                |   |   +- security (class: org.jnp.interfaces.NamingContext)
                |   |   |   +- securityMgr[link -> java:/jaas/jboss-web-policy] (class: javax.naming.LinkRef)
                |   |   |   +- subject[link -> java:/jaas/jboss-web-policy/subject] (class: javax.naming.LinkRef)
                |   |   |   +- realmMapping[link -> java:/jaas/jboss-web-policy/realmMapping] (class: javax.naming.LinkRef)
                |   |   |   +- security-domain[link -> java:/jaas/jboss-web-policy] (class: javax.naming.LinkRef)
                |   |   |   +- authorizationMgr[link -> java:/jaas/jboss-web-policy/authorizationMgr] (class: javax.naming.LinkRef)
                |   +- ORB[link -> java:/JBossCorbaORB] (class: javax.naming.LinkRef)
                |   +- BeanManager (class: org.jnp.interfaces.MarshalledValuePair)
                |   +- ModuleName (class: java.lang.String)
                +- XAConnectionFactory (class: org.hornetq.jms.client.HornetQXAConnectionFactory)
                +- JmsXA (class: org.hornetq.ra.HornetQRAConnectionFactoryImpl)
                +- MySqlSnapProfile (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
                +- MySqlVasReadProfile (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
                +- policyRegistration (class: org.jboss.security.plugins.JBossPolicyRegistration)
                +- TransactionPropagationContextImporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
                +- app (class: javax.naming.Context)
                |   +- jmx-console (class: org.jnp.interfaces.NamingContext)
                |   +- AppName (class: java.lang.String)
                +- Mail (class: javax.mail.Session)
                +- TransactionPropagationContextExporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
                +- ProfileService (class: org.jboss.profileservice.AbstractProfileService)
                +- MySqlSnapReadProfile (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
                +- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
                +- jaas (class: javax.naming.Context)
                |   +- jmx-console (class: org.jboss.security.plugins.SecurityDomainContext)
                |   +- jboss-ejb-policy (class: org.jboss.security.plugins.SecurityDomainContext)
                |   +- hornetq (class: org.jboss.security.plugins.SecurityDomainContext)
                +- TransactionSynchronizationRegistry (class: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple)
                +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
                +- ConnectionFactory (class: org.hornetq.jms.client.HornetQXAConnectionFactory)
                +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
                +- TransactionManager (class: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate)
                +- timedCacheFactory (class: javax.naming.Context)
              Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy cannot be cast to javax.naming.NamingEnumeration
                +- module (class: javax.naming.Context)
                |   +- TransactionSynchronizationRegistry[link -> java:TransactionSynchronizationRegistry] (class: javax.naming.LinkRef)
                |   +- UserTransaction[link -> UserTransaction] (class: javax.naming.LinkRef)
                |   +- env (class: org.jnp.interfaces.NamingContext)
                |   |   +- security (class: org.jnp.interfaces.NamingContext)
                |   |   |   +- securityMgr[link -> java:/jaas/jboss-web-policy] (class: javax.naming.LinkRef)
                |   |   |   +- subject[link -> java:/jaas/jboss-web-policy/subject] (class: javax.naming.LinkRef)
                |   |   |   +- realmMapping[link -> java:/jaas/jboss-web-policy/realmMapping] (class: javax.naming.LinkRef)
                |   |   |   +- security-domain[link -> java:/jaas/jboss-web-policy] (class: javax.naming.LinkRef)
                |   |   |   +- authorizationMgr[link -> java:/jaas/jboss-web-policy/authorizationMgr] (class: javax.naming.LinkRef)
                |   +- ORB[link -> java:/JBossCorbaORB] (class: javax.naming.LinkRef)
                |   +- BeanManager (class: org.jnp.interfaces.MarshalledValuePair)
                |   +- ModuleName (class: java.lang.String)
                +- internal (class: org.jnp.interfaces.NamingContext)
                |   +- EJBContext (class: javax.ejb.EJBContext)
                |   +- TimerService (class: javax.ejb.TimerService)
                +- MySqlVasProfile (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
                +- global (class: org.jnp.interfaces.NamingContext)
                |   +- jmx-console (class: org.jnp.interfaces.NamingContext)
                |   +- ozcommons (class: org.jnp.interfaces.NamingContext)
                |   +- freemarker (class: org.jnp.interfaces.NamingContext)
                |   +- ROOT (class: org.jnp.interfaces.NamingContext)
                |   +- twitter4j-core-2.1.3-SNAPSHOT (class: org.jnp.interfaces.NamingContext)
                |   +- trial (class: org.jnp.interfaces.NamingContext)
                |   +- admin-console (class: org.jnp.interfaces.NamingContext)
                |   +- induspn (class: org.jnp.interfaces.NamingContext)
                |   |   +- XoteWriteEJB!com.induspn.server.XoteWriteInt[link -> InduspnXoteWriteInterface] (class: javax.naming.LinkRef)
                |   |   +- UserAdminReadEJB!com.induspn.server.UserAdminReadInt[link -> InduspnUserAdminReadInterface] (class: javax.naming.LinkRef)
                |   |   +- XotesTimerEJB!com.induspn.server.XotesTimerInt[link -> InduspnXotesTimerInterface] (class: javax.naming.LinkRef)
                |   |   +- XoteReadEJB[link -> InduspnXoteReadInterface] (class: javax.naming.LinkRef)
                |   |   +- UserAdminWriteEJB!com.induspn.server.UserAdminWriteInt[link -> InduspnUserAdminWriteInterface] (class: javax.naming.LinkRef)
                |   |   +- UserAdminWriteEJB[link -> InduspnUserAdminWriteInterface] (class: javax.naming.LinkRef)
                |   |   +- UserAdminReadEJB[link -> InduspnUserAdminReadInterface] (class: javax.naming.LinkRef)
                |   |   +- XoteWriteEJB[link -> InduspnXoteWriteInterface] (class: javax.naming.LinkRef)
                |   |   +- XotesTimerEJB[link -> InduspnXotesTimerInterface] (class: javax.naming.LinkRef)
                |   |   +- XoteReadEJB!com.induspn.server.XoteReadInt[link -> InduspnXoteReadInterface] (class: javax.naming.LinkRef)
                |   +- reports (class: org.jnp.interfaces.NamingContext)
                |   +- uuid-key-generator (class: org.jnp.interfaces.NamingContext)
                |   +- http-invoker (class: org.jnp.interfaces.NamingContext)
                |   |   +- invoker (class: org.jnp.interfaces.NamingContext)
                |   +- abimporter (class: org.jnp.interfaces.NamingContext)
                |   +- vasadmin (class: org.jnp.interfaces.NamingContext)
                |   +- cdi (class: org.jnp.interfaces.NamingContext)
              • 4. Re: NameNotFoundException with "Not Bound" message
                plmc41

                We had a similar error... the issue was with our ejb-jar.xml file.

                 

                Take a look at how jboss loads your jar file.

                For example:

                 

                review the server.log for how your jar file is loaded. Notice the name mismatch in mine RefundPolicyRequestPlugin vs RefundPolicyPlugin

                 

                2011-12-14 19:12:56,394 INFO [org.jboss.ejb.deployers.EjbDeployer] installing bean: ejb/RefundPolicyRequestPlugin.jar#RefundPolicyPlugin,uid1280009145

                2011-12-14 19:12:56,395 INFO [org.jboss.ejb.deployers.EjbDeployer] with dependencies:

                2011-12-14 19:12:56,395 INFO [org.jboss.ejb.deployers.EjbDeployer] and supplies:

                2011-12-14 19:12:56,395 INFO [org.jboss.ejb.deployers.EjbDeployer] jndi:RefundPolicyPlugin

                 

                Our error was with our ejb-jar.xml file (we changed the name to RefundPolicyRequestPlugin and failed to change the ejb-jar.xml file

                <enterprise-beans>

                <session>

                <ejb-name>RefundPolicyPlugin</ejb-name>

                 

                JBOSS 5 and 6 are more restrictive in their naming then jboss 4 was. Hope this helps.