[jboss-user] [EJB 3.0] - Re: Session bean lookup fails JBoss 5, worked in 4.0.5

lpmon do-not-reply at jboss.com
Mon Jul 21 16:38:20 EDT 2008

I have included excerpts from the log and JNDIView.  I am still stuck on this problem.

I notice that:

1) The "added bean" message for DBUtilBean is 1st (with expected jndi name)
2) The Seam "welcome" message is next
3) The failed lookup is next (this is now in a servlet)
4) then I see:  STARTED EJB: com.pearson.ejb3.session.DBUtilBean

If the SLSB must be started before it can be looked up then that explains the behavior.  But, I do not know how to force ordering.

I have tried changing the order of the modules in application.xml with no success.  

IMPORTANT: By changing from an @Startup Seam component to a startup servlet I was able to get my .jar and .war to deploy successfully.    The startup method, servlet.init(), still fails when trying to lookup DBUtilBean but this change allows me to get the app up and running.  Subsequent lookups using the same jndi name are successful!  It looks like the jndi lookups fail unless the entire bootup process has totally completed.  It is not a matter of using the correct jndi name or the latter lookup would fail too.  

2008-07-21 14:49:27,741 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) Created KernelDeployment for: ec20.jar
2008-07-21 14:49:29,007 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) installing bean: jboss.j2ee:ear=ec20.ear,jar=ec20.jar,name=DBUtilBean,service=EJB3
2008-07-21 14:49:29,007 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main)   with dependencies:
2008-07-21 14:49:29,007 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main)   and demands:
2008-07-21 14:49:29,007 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) 	persistence.units:ear=ec20.ear,jar=ec20.jar,unitName=ec20
2008-07-21 14:49:29,022 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) 	jboss.ejb:service=EJBTimerService
2008-07-21 14:49:29,038 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main)   and supplies:
2008-07-21 14:49:29,038 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) 	jndi:ec20/DBUtilBean/local-com.pearson.ejb3.session.DBUtil
2008-07-21 14:49:29,038 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) 	jndi:ec20/DBUtilBean/local
2008-07-21 14:49:29,038 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) 	Class:com.pearson.ejb3.session.DBUtil
2008-07-21 14:49:29,038 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) 	jndi:DBUtilBean
2008-07-21 14:49:29,038 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (main) Added bean(jboss.j2ee:ear=ec20.ear,jar=ec20.jar,name=DBUtilBean,service=EJB3) to KernelDeploym
07-21 14:49:52,538 INFO  [javax.servlet.ServletContextListener] (main) Welcome to Seam 2.0.3.CR1
2008-07-21 14:50:29,507 FATAL [com.pearson.util.LookupUtil] (main) for Interface: DBUtilBean context is null: false  (my logging for the exception)
javax.naming.NameNotFoundException: ec20 not bound
	at org.jnp.server.NamingServer.getBinding(NamingServer.java:542)
	at org.jnp.server.NamingServer.getBinding(NamingServer.java:550)
	at org.jnp.server.NamingServer.getObject(NamingServer.java:556)
	at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
	at javax.naming.InitialContext.lookup(InitialContext.java:351)
	at com.pearson.util.LookupUtil.lookupEJB(LookupUtil.java:61)
	at com.pearson.servlet.StartupServlet.init(StartupServlet.java:51)

2008-07-21 14:51:17,851 INFO  [org.jboss.ejb3.EJBContainer] (main) STARTED EJB: com.pearson.ejb3.session.DBUtilBean ejbName: DBUtilBean

Global JNDI Namespace

+- ec20 (class: org.jnp.interfaces.NamingContext)
  |   +- IButtonMgrBean (class: org.jnp.interfaces.NamingContext)
  |   |   +- local (proxy: $Proxy217 implements interface org.jboss.ejb3.proxy.JBossProxy,interface com.pearson.ejb3.session.IButtonMgr)
  |   +- DBUtilBean (class: org.jnp.interfaces.NamingContext)
  |   |   +- local (proxy: $Proxy186 implements interface org.jboss.ejb3.proxy.JBossProxy,interface com.pearson.ejb3.session.DBUtil)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4165747#4165747

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4165747

More information about the jboss-user mailing list