Only 49 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB 2.1 with JBOSS - EJB lookup from JNDI failing with NameNotFoundException bean name not bound  RSS feed

 
gates riley
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been stuck with this for a day or two now and I am getting very frustrated. I am sure there is something obvious wrong, but I can't seem to find it.

Thanks in advance for your help!!!


JBOSS.XML

<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
<jboss>
<enterprise-beans>
<session>
<ejb-name>com.gates.hhms.core.ejb.eventlogmgr.EventLogMgr</ejb-name>
<jndi-name>com.gates.hhms.core.ejb.eventlogmgr.EventLogMgrHome</jndi-name>
</session>
</enterprise-beans>
</jboss>


EJB-JAR.XML

<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar id="ejb-jar_ID">
<enterprise-beans>
<session id="EventLogMgr">
<ejb-name>com.gates.hhms.core.ejb.eventlogmgr.EventLogMgr</ejb-name>
<home>com.gates.hhms.core.ejb.eventlogmgr.EventLogMgrHome</home>
<remote>com.gates.hhms.core.ejb.eventlogmgr.EventLogMgr</remote>
<ejb-class>com.gates.hhms.core.ejb.eventlogmgr.EventLogMgrBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>com.gates.hhms.core.ejb.eventlogmgr.EventLogMgr</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>


Lookup code

try
{
JavalibLog.ejbLog(logFile,
LogFile.DEBUG, "#### JNDIName="+jndiName);

Object home = context.lookup(jndiName);

JavalibLog.ejbLog(logFile,
LogFile.DEBUG, "#### HHMSHomeHolder.lookupHome ... got home");

EJBHome ejbHome = (EJBHome)PortableRemoteObject.narrow(home, theClass);
return ejbHome;
}
catch (NamingException ne)
{
JavalibLog.log(LogFile.DEBUG, logFile.EJB_CATEGORY,"HomeFinder: Failed to load ", ne );
ne.printStackTrace();
}

JNDI Tree

Ejb 2.1 Module: "ucl_EventLogMgrBean.jar"
java:comp namespace of the com.gates.hhms.core.ejb.eventlogmgr.EventLogMgr bean:
+- env (class: org.jnp.interfaces.NamingContext)
+- TransactionSynchronizationRegistry[link -> java:TransactionSynchronizationRegistry] (class: javax.naming.LinkRef)

Other components with java:comp namespace
java: Namespace
+- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)
+- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
+- policyRegistration (class: org.jboss.security.plugins.JBossPolicyRegistration)
+- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
+- comp (class: javax.namingMain.Context)
+- TransactionPropagationContextExporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
+- ClusteredConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
+- TransactionManager (class: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate)
+- ClusteredXAConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
+- timedCacheFactory (class: javax.naming.Context)
Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy
+- hhms.txdatasource.dbpool (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
+- ConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
+- jaas (class: javax.naming.Context)
| +- HsqlDbRealm (class: org.jboss.security.plugins.SecurityDomainContext)
| +- profileservice (class: org.jboss.security.plugins.SecurityDomainContext)
+- TransactionPropagationContextImporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
+- Mail (class: javax.mail.Session)
+- XAConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
+- TransactionSynchronizationRegistry (class: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple)
+- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
+- securityManagement (class: org.jboss.security.integration.JNDIBasedSecurityManagement)

Global JNDI Namespace
+- com.gates.hhms.core.ejb.eventlogmgr.EventLogMgrHome (proxy: $Proxy100 implements interface com.gates.hhms.core.ejb.eventlogmgr.EventLogMgrHome,interface javax.ejb.Handle)
+- UserTransactionSessionFactory (proxy: $Proxy82 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
+- ucl (class: org.jnp.interfaces.NamingContext)
| +- SessionFactory (class: org.hibernate.impl.SessionFactoryImpl)
+- jmx (class: org.jnp.interfaces.NamingContext)
| +- rmi (class: org.jnp.interfaces.NamingContext)
| | +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] (class: javax.naming.LinkRef)
| +- invoker (class: org.jnp.interfaces.NamingContext)
| | +- RMIAdaptor (proxy: $Proxy83 implements interface org.jboss.jmx.adaptor.rmi.RMIAdaptor,interface org.jboss.jmx.adaptor.rmi.RMIAdaptorExt)
+- queue (class: org.jnp.interfaces.NamingContext)
| +- DLQ (class: org.jboss.jms.destination.JBossQueue)
| +- ExpiryQueue (class: org.jboss.jms.destination.JBossQueue)
+- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory)
+- ClusteredConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
+- ClusteredXAConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
+- ConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
+- ProfileService (class: AOPProxy$0)
+- console (class: org.jnp.interfaces.NamingContext)
| +- PluginManager (proxy: $Proxy84 implements interface org.jboss.console.manager.PluginManagerMBean)
+- topic (class: org.jnp.interfaces.NamingContext)
+- HiLoKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory)
+- com.gates.ucl.user.ejb.userdatamgr.UserDataMgrHome (proxy: $Proxy106 implements interface com.gates.ucl.user.ejb.userdatamgr.UserDataMgrHome,interface javax.ejb.Handle)
+- TomcatAuthenticators (class: java.util.Properties)
+- XAConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
+- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction


Exception

<2010-02-11 17:25:34,233> <DEBUG> <JLib - EJB> - <#### JNDIName=com.gates.hhms.core.ejb.eventlogmgr.EventLogMgrHome >
<2010-02-11 17:25:34,234> <DEBUG> <JLib - EJB> - <HomeFinder: Failed to load >
javax.naming.NameNotFoundException: com.gates.hhms.core.ejb.eventlogmgr.EventLogMgrHome not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.gates.javalib.ejb.HomeFinder.lookupHome(HomeFinder.java:103)
at com.gates.javalib.ejb.HomeFinder.lookupHome(HomeFinder.java:37)
at com.gates.hhms.HHMSHomeHolder.initialize(HHMSHomeHolder.java:240)
at com.gates.hhms.HHMSModule.initializeEJBHomes(HHMSModule.java:274)
at com.gates.hhms.initializer.HHMSModuleInitializer.initializeModule(HHMSModuleInitializer.java:131)
at com.gates.hhms.initializer.HHMSModuleInitializer.initialize(HHMSModuleInitializer.java:50)
at com.gates.hhms.HHMSRuntime.start(HHMSRuntime.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.gates.javalib.startup.servlet.StartupServlet.init(StartupServlet.java:55)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4122)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4421)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:312)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:144)
at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!