• Post Reply Bookmark Topic Watch Topic
  • New Topic

Distributed EJB Lookup Problem 2  RSS feed

 
Clarence Dyho
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

Instead of running Websphere on 2 physical servers (my earlier post), the project team now wants to run 2 instances of WebSphere on a single machine.

I have my web app running on one instance and my EJBs are deployed on another instance. My question is how can I lookup and create the EJBs on the other instance from my web app. I've tried using the JNDI name generated by Websphere but I kept on getting:

NamingException
First component in name <JNDI Name> not found.

My apologies if the problem sound so basic. I'm a newbie when it comes to EJBs as I've tried to stay away from them due to complexities such as this.
Thank you.

Clarence
 
aitor alzola
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If you have 2 servers on the same machine, you have change the ORB bootstrap port (see Server Configuration>>ports) of one of them, the 2 servers can not have the same port used. Normaly is the 2809 port, if you run the test client you can see it in the JNDI properties>>PROVIDER_URL. You have to specificate this in the lookup, something like this would run :

props.setProperty("java.naming.factory.initial", "com.ibm.websphere.naming.WsnInitialContextFactory" );
props.setProperty("java.naming.provider.url", iiop://my_URL:My_port/);
ic = new InitialContext(props);
nsObject = ic.lookup(jndiHomeName);
 
Clarence Dyho
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aitor, Thank you for your reply. It works now.

The problem lies with the hostname that I am using. I am using "localhost" instead of the hostname of my machine. Hence, when my webApp tried to look for the EJBs in the other server, it encountered localhost and attempted to look for the EJBs from within the local container. I then get a NamingException.

Again I appreciate all your help
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!