aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes @EJB REMOTE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "@EJB REMOTE" Watch "@EJB REMOTE" New topic
Author

@EJB REMOTE

Dura Hurtado
Ranch Hand

Joined: Feb 16, 2011
Posts: 120
Hi I have type the code below in an EJB and I am trying to connect with another EJB in the same server:


Properties properties = new Properties();

properties.put("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
properties.put("java.naming.factory.url.pkgs",
"=org.jboss.namingrg.jnp.interfaces");

properties.put("java.naming.provider.url", "localhost:1099");
try{
Context ctx = new InitialContext(properties);
HolaMundoEJBREMOTORemote hello = null;

hello = (HolaMundoEJBREMOTORemote) ctx.lookup("HolaMundoEJBREMOTO/remote");


when I run the app(main), the error below appears:

ERROR [STDERR] javax.naming.NameNotFoundException: HolaMundoEJBREMOTO

Please ┬┐anybody knows what is happening?

Thanks.
Piotr Nowicki
Ranch Hand

Joined: Jul 13, 2010
Posts: 610

Hi,

1. Please use the code tags, as it makes the code a lot easier to read,
2. What are the classes or JNDI names of the EJB's you're trying to inject / use as a point of injection,
3. What EJB version are you using?


OCP Java SE 6 Programmer, OCM Java SE 6 Developer, OCE Java EE 6 JSPSD, OCE Java EE 6 EJBD, OCE Java EE 6 JPAD, Spring 3.0 Core Professional.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: @EJB REMOTE