Only 44 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Accessing EJB from another JVM  RSS feed

 
PhaniKiran Patruni
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i would like to know how to access an EJB from another JVM..
we are using WSPhere 5.0 and in that we are trying to access an EJB which is residing in another machine JVM....
Context context = new InitialContext();
Object homeObj = context.lookup("comp.ejb.SampleEJB");
When I am tryin access by the above code I am getting an error...
Can anybody give me a suggestion please
 
Gul Khan
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im not sure but i think it would be something like this
--------------------------------
Properties properties = new Properties();
properties.put("java.naming.factory.initial", "com.ibm.websphere.naming.WsnInitialContextFactory");
//IP of the machine hosting the beans and the port
properties.put("java.naming.provider.url", "iiop://127.0.0.1:2809");
InitialContext initialcontext = new InitialContext(properties);
--------------------------------
Plz let me know if it works.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using WebSphere Single-server, or WebSphere ND? The answer differs depending upon that choice.
Kyle
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!