Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I call EJB3 beans from another comuter?

 
Armen Arzumanyan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have JSF/EJB3 application what work in my localhost, but when I want call ejb3 beans from another comuter I got errors ....

javax.naming.CommunicationException [Root exception is java.rmi.NoSuchObjectException: no such object in table]
13:12:55,921 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:780)
13:12:55,921 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
13:12:55,921 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:351)
 
Vesa Tanhua-Tyrkk�
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

How have you configured your initial context?
JNDI lookup also depends on which application server you are using.
 
Armen Arzumanyan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my lookup under JBoss.....

Hashtable environment = new Hashtable();
environment.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
environment.put(Context.URL_PKG_PREFIXES, "org.jboss.naming rg.jnp.interfaces");
environment.put(Context.PROVIDER_URL, "jnp://some_IP:1099");
InitialContext context = new InitialContext(environment);
BeanRemote bean = (BeanRemote) context.lookup("ejb/MyBean/remote");
 
Vesa Tanhua-Tyrkk�
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked with jmx-console that there is such object in jndi table?
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
environment.put(Context.PROVIDER_URL, "jnp://some_IP:1099");


Which version of JBoss? And how do you start JBoss? For versions starting JBoss-4.2.x, you will have to use -b option while starting JBoss, for the server to be accessible remotely. See this for more details.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic