[jboss-user] [JNDI/Naming/Network] - Re: New EJB causes JNDI failure on existing EJB?
I've managed to fix it, but I don't understand how! I mentioned before that application 2 on machine 2 contained a jndi.properties (to allow it to talk to machine 1). When I renamed this to application2.properties, the problem was solved. I can only assume that this jndi.properties in application 2 was preventing the ejbs in application 1 from making themselves available to JNDI. I don't quite understand why this should be. I could understand if application 1 wanted to do an outward JNDI lookup and read the jndi.properties in application 2 by mistake. But I don't understand why it should affect inward JNDI. If anyone is able to explain why a jndi.properties should have this kind of effect, I'd be interested to find out - but I'm just grateful it's fixed. Thanks Jaikiran for your help. Heather View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113023#4113023 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113023 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JNDI/Naming/Network] - Re: New EJB causes JNDI failure on existing EJB?
"hmccartney" wrote : | I should have said that in MyWorkerBean I have specified the JNDI name with: | public @Stateless | | @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) | | @RemoteBinding(jndiBinding = "MyWorkerBean/remote") | | class MyWorkerBean implements MyWorker { | | Does the rule about prefixing the JNDI name with the name of the ear still apply in this case? | | Well in that case, the prefix will not be added. So you should have been able to lookup using MyWorkerBean/remote jndi-name. I would check the jndi listing through the jmx-console to make sure the jndi-name of the bean. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112598#4112598 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112598 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JNDI/Naming/Network] - Re: New EJB causes JNDI failure on existing EJB?
Thanks very much for your reply. The lookup is being done after the deployment of the application. Both applications on both machines are packaged as ears containing several ejb3 and jar files. So on machine 2 we have MyApp1.ear and MyApp2.ear. MyWorkerBean is in Worker.ejb3 inside MyApp1.ear. I should have said that in MyWorkerBean I have specified the JNDI name with: public @Stateless | @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) | @RemoteBinding(jndiBinding = "MyWorkerBean/remote") | class MyWorkerBean implements MyWorker { Does the rule about prefixing the JNDI name with the name of the ear still apply in this case? I don't have access to the test system at the minute but I'll try using MyWorker myWorker = (MyWorker) context.lookup("MyApp1/MyWorkerBean/remote"); instead as soon as I get the chance. I'll also double-check the JNDI tree in the JMX console. Thanks again for your suggestions. Heather View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112522#4112522 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112522 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JNDI/Naming/Network] - Re: New EJB causes JNDI failure on existing EJB?
When is the lookup being done? Is it done when the server is starting up? Or is it after the deployment of your application has been done successfully? anonymous wrote : javax.naming.NameNotFoundException: MyWorkerBean not bound How are you packaging the application? Is it just a jar file or an ear? If it's an ear then you will have to prefix the name of the ear file to the JNDI name. For example, if your application is MyApp.ear and the bean implementation classname is MyWorkerBean and your are looking up the remote interface, then the default lookup string will be: | MyWorker myWorker = (MyWorker) context.lookup("MyApp/MyWorkerBean/remote"); And the most important thing to do when you run into a NameNotFoundException is to look at the JNDI tree through the jmx-console of JBoss. That will show you the exact lookup string you have to use. For more details, you can refer http://jaitechwriteups.blogspot.com/2007/10/why-do-i-get-namenotfoundexception.html View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112163#4112163 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112163 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user