[jboss-user] [JNDI and Naming] - EJB Not Bound error: javax.naming.NamingException

Rameshwar Khedekar do-not-reply at jboss.com
Mon Dec 20 08:18:19 EST 2010


Rameshwar Khedekar [http://community.jboss.org/people/rameshwar.khedekar] created the discussion

"EJB Not Bound error: javax.naming.NamingException"

To view the discussion, visit: http://community.jboss.org/message/576797#576797

--------------------------------------------------------------
hi,

I have created my Enterprise App project in eclipse with one web module, three ejb jars(includes multiple ejbs) and other jars.
I have bundled three ejb jars and other jars in deployment assembly of web module(order.war) and then created Enterprise App Project with that web module(order.war only..)
I have created ear file by exporting above Enterprsie app and trying to deploy it,
     I got EJB not bound Error with javax.naming.NamingException.
     So I have checked with binding names that they are exist in naming space or not, with Context.list() and Context.listBindings() with "java:comp/env/ejb" string paramter. I got number of Names of ejbs that are there in jndi space.
     But when I am lookin up for each object that is in Name space, i get same excption and finally i get null object.


I am printing the log below...
Note: I am catching NamingException in code, so its not showing the "EJB not bound Error with javax.naming.NamingException".
But the problem is with ejb not bound only.


2010-12-19 19:35:21,003 INFO  [STDOUT] name_class_pair_element==>IRemoteLicensing
2010-12-19 19:35:21,003 INFO  [STDOUT] name_class_pair_element==>CommonEndUserManager
2010-12-19 19:35:21,004 INFO  [STDOUT] name_class_pair_element==>AvlHandleEjb
2010-12-19 19:35:21,004 INFO  [STDOUT] name_class_pair_element==>CustomerDirectory_ejbHome
2010-12-19 19:35:21,004 INFO  [STDOUT] name_class_pair_element==>AccountManagement_ejbHome
2010-12-19 19:35:21,004 INFO  [STDOUT] name_class_pair_element==>OutsourceAgentManager
2010-12-19 19:35:21,004 INFO  [STDOUT] Naming Exception option 1 with java:comp/env/ejb/IRemoteLicensing
2010-12-19 19:35:21,004 INFO  [STDOUT] Naming Exception option 2 with java:IRemoteLicensing
2010-12-19 19:35:21,004 INFO  [STDOUT] Naming Exception option 3 with java:/IRemoteLicensing
2010-12-19 19:35:21,004 INFO  [STDOUT] Naming Exception option 4 with java:/comp/env/ejb/IRemoteLicensing
2010-12-19 19:35:21,004 INFO  [STDOUT] Naming Exception option 5 with IRemoteLicensing
2010-12-19 19:35:21,004 INFO  [STDOUT] o==========>null
2010-12-19 19:35:21,004 ERROR [STDERR] java.lang.NullPointerException
2010-12-19 19:35:21,005 ERROR [STDERR]  at com.ingrammicro.ejb.EJBHomeFactoryImpl_Default._getHome(EJBHomeFactoryImpl_Default.java:108)
2010-12-19 19:35:21,005 ERROR [STDERR]  at com.ingrammicro.ejb.EJBHomeFactory.getHome(EJBHomeFactory.java:77)
2010-12-19 19:35:21,005 ERROR [STDERR]  at com.ingrammicro.app.avl.RemoteLicensingProxy.<init>(RemoteLicensingProxy.java:54)
2010-12-19 19:35:21,005 ERROR [STDERR]  at com.ingrammicro.app.avl.LicensingFactory.createLicensing(LicensingFactory.java:45)
2010-12-19 19:35:21,005 ERROR [STDERR]  at com.ingrammicro.nautilus.util.avl.AVLEJBWrapper.<init>(AVLEJBWrapper.java:23)
2010-12-19 19:35:21,005 ERROR [STDERR]  at com.ingrammicro.nautilus.util.avl.AVLEJBInitializer.getEJBConnectionFromSession(AVLEJBInitializer.java:114)
2010-12-19 19:35:21,005 ERROR [STDERR]  at com.ingrammicro.nautilus.util.avl.AVLEJBInitializer.initializeEJB(AVLEJBInitializer.java:88)
2010-12-19 19:35:21,005 ERROR [STDERR]  at com.ingrammicro.nautilus.c2lorder.OrderNewQuoteEvent.fire(OrderNewQuoteEvent.java:77)
2010-12-19 19:35:21,005 ERROR [STDERR]  at com.ingrammicro.nautilus.NautilusRequestSupport.processRequest(NautilusRequestSupport.java:62)
2010-12-19 19:35:21,005 ERROR [STDERR]  at com.ingrammicro.nautilus.c2lorder.C2LOrderController.processRequest(C2LOrderController.java:54)
2010-12-19 19:35:21,005 ERROR [STDERR]  at com.ingrammicro.nautilus.c2lorder.C2LOrderController.doGet(C2LOrderController.java:64)
2010-12-19 19:35:21,005 ERROR [STDERR]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
2010-12-19 19:35:21,005 ERROR [STDERR]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
2010-12-19 19:35:21,005 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
2010-12-19 19:35:21,005 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2010-12-19 19:35:21,005 ERROR [STDERR]  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
2010-12-19 19:35:21,005 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2010-12-19 19:35:21,005 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2010-12-19 19:35:21,005 ERROR [STDERR]  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
2010-12-19 19:35:21,005 ERROR [STDERR]  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
2010-12-19 19:35:21,005 ERROR [STDERR]  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
2010-12-19 19:35:21,005 ERROR [STDERR]  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
2010-12-19 19:35:21,006 ERROR [STDERR]  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
2010-12-19 19:35:21,006 ERROR [STDERR]  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
2010-12-19 19:35:21,006 ERROR [STDERR]  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
2010-12-19 19:35:21,006 ERROR [STDERR]  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
2010-12-19 19:35:21,006 ERROR [STDERR]  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
2010-12-19 19:35:21,006 ERROR [STDERR]  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
2010-12-19 19:35:21,006 ERROR [STDERR]  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
2010-12-19 19:35:21,006 ERROR [STDERR]  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
2010-12-19 19:35:21,006 ERROR [STDERR]  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
2010-12-19 19:35:21,006 ERROR [STDERR]  at java.lang.Thread.run(Thread.java:595)
2010-12-19 19:35:21,006 ERROR [STDERR] java.lang.NullPointerException: Could not create remote reference to the AVL EJB
2010-12-19 19:35:21,006 ERROR [STDERR]  at com.ingrammicro.app.avl.RemoteLicensingProxy.<init>(RemoteLicensingProxy.java:65)
2010-12-19 19:35:21,006 ERROR [STDERR]  at com.ingrammicro.app.avl.LicensingFactory.createLicensing(LicensingFactory.java:45)
2010-12-19 19:35:21,006 ERROR [STDERR]  at com.ingrammicro.nautilus.util.avl.AVLEJBWrapper.<init>(AVLEJBWrapper.java:23)
2010-12-19 19:35:21,006 ERROR [STDERR]  at com.ingrammicro.nautilus.util.avl.AVLEJBInitializer.getEJBConnectionFromSession(AVLEJBInitializer.java:114)
2010-12-19 19:35:21,006 ERROR [STDERR]  at com.ingrammicro.nautilus.util.avl.AVLEJBInitializer.initializeEJB(AVLEJBInitializer.java:88)
2010-12-19 19:35:21,006 ERROR [STDERR]  at com.ingrammicro.nautilus.c2lorder.OrderNewQuoteEvent.fire(OrderNewQuoteEvent.java:77)
2010-12-19 19:35:21,006 ERROR [STDERR]  at com.ingrammicro.nautilus.NautilusRequestSupport.processRequest(NautilusRequestSupport.java:62)
2010-12-19 19:35:21,006 ERROR [STDERR]  at com.ingrammicro.nautilus.c2lorder.C2LOrderController.processRequest(C2LOrderController.java:54)
2010-12-19 19:35:21,006 ERROR [STDERR]  at com.ingrammicro.nautilus.c2lorder.C2LOrderController.doGet(C2LOrderController.java:64)
2010-12-19 19:35:21,006 ERROR [STDERR]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
2010-12-19 19:35:21,006 ERROR [STDERR]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
2010-12-19 19:35:21,006 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
2010-12-19 19:35:21,006 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2010-12-19 19:35:21,007 ERROR [STDERR]  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
2010-12-19 19:35:21,007 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2010-12-19 19:35:21,007 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2010-12-19 19:35:21,007 ERROR [STDERR]  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
2010-12-19 19:35:21,007 ERROR [STDERR]  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
2010-12-19 19:35:21,007 ERROR [STDERR]  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
2010-12-19 19:35:21,007 ERROR [STDERR]  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
2010-12-19 19:35:21,007 ERROR [STDERR]  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
2010-12-19 19:35:21,007 ERROR [STDERR]  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
2010-12-19 19:35:21,007 ERROR [STDERR]  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
2010-12-19 19:35:21,007 ERROR [STDERR]  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
2010-12-19 19:35:21,007 ERROR [STDERR]  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
2010-12-19 19:35:21,007 ERROR [STDERR]  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
2010-12-19 19:35:21,007 ERROR [STDERR]  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
2010-12-19 19:35:21,007 ERROR [STDERR]  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
2010-12-19 19:35:21,007 ERROR [STDERR]  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
2010-12-19 19:35:21,007 ERROR [STDERR]  at java.lang.Thread.run(Thread.java:595)
2010-12-19 19:35:21,007 ERROR [org.apache.catalina.core.ContainerBase] Servlet.service() for servlet C2LOrderController threw exception
java.lang.NullPointerException
        at com.ingrammicro.nautilus.util.avl.AVLEJBWrapper.createNewCart(AVLEJBWrapper.java:167)
        at com.ingrammicro.nautilus.c2lorder.OrderNewQuoteEvent.fire(OrderNewQuoteEvent.java:77)
        at com.ingrammicro.nautilus.NautilusRequestSupport.processRequest(NautilusRequestSupport.java:62)
        at com.ingrammicro.nautilus.c2lorder.C2LOrderController.processRequest(C2LOrderController.java:54)
        at com.ingrammicro.nautilus.c2lorder.C2LOrderController.doGet(C2LOrderController.java:64)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:595)
2010-12-19 19:36:15,290 DEBUG [com.arjuna.ats.arjuna.logging.arjLogger] Periodic recovery - first pass <Sun, 19 Dec 2010 19:36:15>




web.xml contents:

<ejb-ref id="EjbRef_1050696167183">
  <ejb-ref-name>ejb/CustomerDirectory_ejbHome</ejb-ref-name>
  <ejb-ref-type>Session</ejb-ref-type>
  <home>com.ingrammicro.beans.customer.CustomerDirectoryHome</home>
  <remote>com.ingrammicro.beans.customer.CustomerDirectoryObject</remote>
  <ejb-link>CustomerDirectory</ejb-link>
</ejb-ref>

<ejb-ref id="EjbRef_1050696313339">
  <ejb-ref-name>ejb/IRemoteLicensing</ejb-ref-name>
  <ejb-ref-type>Session</ejb-ref-type>
  <home>com.ingrammicro.app.avl.ejb.IRemoteLicensingHome</home>
  <remote>com.ingrammicro.app.avl.ejb.IRemoteLicensingBean</remote>
  <ejb-link>IRemoteLicensing</ejb-link>
</ejb-ref>

<ejb-ref id="EjbRef_1050944096042">
  <ejb-ref-name>ejb/AccountManagement_ejbHome</ejb-ref-name>
  <ejb-ref-type>Session</ejb-ref-type>
  <home>com.ingrammicro.beans.acctmgmt.AccountManagementHome</home>
  <remote>com.ingrammicro.beans.acctmgmt.AccountManagementObject</remote>
  <ejb-link>AccountManagement</ejb-link>
</ejb-ref>
<ejb-ref id="EjbRef_1080190263908">
  <ejb-ref-name>ejb/CommonEndUserManager</ejb-ref-name>
  <ejb-ref-type>Session</ejb-ref-type>
  <home>com.ingrammicro.app.avl.enduser.ICommonEndUserManagerHome</home>
  <remote>com.ingrammicro.app.avl.enduser.ICommonEndUserManager</remote>
  <ejb-link>CommonEndUserManager</ejb-link>
</ejb-ref>
<ejb-ref id="EjbRef_1080005416629">
  <ejb-ref-name>ejb/AvlHandleEjb</ejb-ref-name>
  <ejb-ref-type>Session</ejb-ref-type>
  <home>com.ingrammicro.app.avl.event.handler.IAVLEventHandlerHome</home>
  <remote>com.ingrammicro.app.avl.event.handler.IAVLEventHandler</remote>
  <!-- <ejb-link>AvlHandleEjb.jar#AvlHandleEjb</ejb-link> -->
  <ejb-link>AvlHandleEjb</ejb-link>
</ejb-ref>
<ejb-ref>
  <ejb-ref-name>ejb/OutsourceAgentManager</ejb-ref-name>
  <ejb-ref-type>Session</ejb-ref-type>
  <home>com.ingrammicro.app.avl.outsourceagent.ejb.OutsourceAgentManagerHome</home>
  <remote>com.ingrammicro.app.avl.outsourceagent.ejb.OutsourceAgentManager</remote>
  <ejb-link>OutsourceAgentManager</ejb-link>
</ejb-ref>


jboss-web.xml contents:
<!-- Reference for EJB 1 -->
<ejb-ref>
  <ejb-ref-name>ejb/CustomerDirectory_ejbHome</ejb-ref-name>
  <ejb-link>CustomerDirectory</ejb-link>
  <jndi-name>CustomerDirectory</jndi-name>
</ejb-ref>

<!-- Reference for EJB 2 -->
<ejb-ref>
  <ejb-ref-name>ejb/IRemoteLicensing</ejb-ref-name>
  <ejb-link>IRemoteLicensing</ejb-link>
  <jndi-name>IRemoteLicensing</jndi-name>
</ejb-ref>

<!-- Reference for EJB 3 -->
<ejb-ref>
  <ejb-ref-name>ejb/AccountManagement_ejbHome</ejb-ref-name>
  <ejb-link>AccountManagement</ejb-link>
  <jndi-name>AccountManagement</jndi-name>
</ejb-ref>

<!-- Reference for EJB 4 -->
<ejb-ref>
  <ejb-ref-name>ejb/CommonEndUserManager</ejb-ref-name>
  <ejb-link>CommonEndUserManager</ejb-link>
  <jndi-name>CommonEndUserManager</jndi-name>
</ejb-ref>

<!-- Reference for EJB 5 -->
<ejb-ref>
  <ejb-ref-name>ejb/AvlHandleEjb</ejb-ref-name>
  <!-- <ejb-link>AvlHandleEjb.jar#AvlHandleEjb</ejb-link> -->
  <ejb-link>AvlHandleEjb</ejb-link>
  <jndi-name>AvlHandleEjb</jndi-name>
</ejb-ref>

<!-- Testing Additional Reference for EJB 6 -->
<ejb-ref>
  <ejb-ref-name>ejb/OutsourceAgentManager</ejb-ref-name>
  <ejb-link>OutsourceAgentManager</ejb-link>
  <jndi-name>OutsourceAgentManager</jndi-name>
</ejb-ref>



Created EAR Application with EJB jars and war module ie. Not bundled in deployment assembly of web module.
WE get EJB modules on jmx console. when we deploy ejb jars outside the .war, but we couldnt' get the login page.
Codes in other jars are not reflecting, EJB jars are not able to access the other jars:
EAR structure:
/ejb-jars
/other-jars
/web-war
If we bundled ejb jars inside war we get same ejb not bound error.
Tried with jboss jnp lookup with following code, but errors remained same:
Properties jndiProps = new Properties();
        jndiProps.setProperty(Context.INITIAL_CONTEXT_FACTORY,
        "org.jnp.interfaces.NamingContextFactory");
        jndiProps.setProperty(Context.URL_PKG_PREFIXES,
        "org.jboss.naming:org.jnp.interface");
        jndiProps.setProperty(Context.PROVIDER_URL, "jnp://imdalapp325:1099");
        
        Context ctx = new InitialContext(jndiProps);
String fullName = "java:comp/env/ejb/" + a_homeName;
        LOG.debug( "Looking up " + fullName );
        
        Object o = ctx.lookup( fullName );


Please Anyone could reply on this to solve the ejb not bound error..


Please kindly feel free to  ask any details you want to know to solve above problem..

Thanx....
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/576797#576797]

Start a new discussion in JNDI and Naming at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20101220/53729936/attachment-0001.html 


More information about the jboss-user mailing list