File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@EJB REMOTE

 
Dura Hurtado
Ranch Hand
Posts: 120
  • 0
  • 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: 610
IntelliJ IDE Java Linux
  • 0
  • 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?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic