Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@EJB REMOTE

 
Dura Hurtado
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 611
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic