[jboss-user] [JNDI/Naming/Network] - PROJECTNAME/FooBean/remote JNDI naming?
maroy
do-not-reply at jboss.com
Tue Jun 12 08:30:01 EDT 2007
I'm having the following issue. An application written for JBoss tries to refer to its beans when locating them through JNDI using the following pattern:
| ctx = new InitialContext(System.getProperties());
| ctx.addToEnvironment("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
| ctx.addToEnvironment("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
| ctx.addToEnvironment("java.naming.provider.url", "localhost:1099");
| FooBean = (FooBean) ctx.lookup("PROJECTNAME/FooBean/remote");
|
and the bean is not found. if I reset the last call to:
| FooBean = (FooBean) ctx.lookup("FooBean/remote");
|
it finds it without problems.
on startup, JBoss initializes all beans automagically according to the log:
| 14:10:13,159 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
| 14:10:13,168 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=PROJECTNAME.jar,name=FooBean,service=EJB3 with dependencies:
| 14:10:13,342 INFO [EJBContainer] STARTED EJB: com.foo.bar.FooBean ejbName: FooBean
|
how can I make the code work as in the original setup, i.e. make the JDNI refer to these objects by the name "PROJECTNAME/FooBean/remote"?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4053496#4053496
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4053496
More information about the jboss-user
mailing list