I've created very simple test application to demonstrate issue.
It works fine when normal servlet calls EJB:
| InitialContext ctx = new InitialContext();
| BPServerManagerHome home = (BPServerManagerHome) PortableRemoteObject
| .narrow(ctx.lookup("ejtest/BPServerManagerBean"),
| BPServerManagerHome.class);
| System.out.println("EJB call res: " + home.create().doit());
|
But the same code fails when it executed from Starter (ServletContextListener
immplementation):
| 20:16:48,622 ERROR [STDERR] javax.naming.NameNotFoundException: BPServerManagerBean
not bound
| 20:16:48,622 ERROR [STDERR] at
org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
| 20:16:48,622 ERROR [STDERR] at
org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
| 20:16:48,622 ERROR [STDERR] at
org.jnp.server.NamingServer.getObject(NamingServer.java:785)
| 20:16:48,622 ERROR [STDERR] at
org.jnp.server.NamingServer.lookup(NamingServer.java:443)
| 20:16:48,622 ERROR [STDERR] at
org.jnp.server.NamingServer.lookup(NamingServer.java:399)
| 20:16:48,622 ERROR [STDERR] at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:713)
| 20:16:48,622 ERROR [STDERR] at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:673)
| 20:16:48,622 ERROR [STDERR] at
javax.naming.InitialContext.lookup(InitialContext.java:351)
| 20:16:48,622 ERROR [STDERR] at Starter.contextInitialized(Starter.java:17)
| 20:16:48,622 ERROR [STDERR] at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
| 20:16:48,622 ERROR [STDERR] at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4393)
| 20:16:48,622 ERROR [STDERR] at
org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:367)
| 20:16:48,622 ERROR [STDERR] at
org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146)
| 20:16:48,622 ERROR [STDERR] at
org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:460)
| 20:16:48,622 ERROR [STDERR] at
org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
| 20:16:48,622 ERROR [STDERR] at
org.jboss.web.deployers.WebModule.start(WebModule.java:96)
|
I've put ear, sources and build script for this application here:
http://www.abisoft.biz/~nbelov/EJTest.zip
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4214254#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...