2

I am trying to connect to an EJB on Websphere server using Context.lookup().

My code works fine when the application is hosted on a local Websphere server, but when I try to connect to the application which is installed on a remote server, I am getting following errors:

...

Caused by: org.omg.CORBA.TRANSIENT: initial and forwarded IOR inaccessible vmcid: 0x4942f000 minor code: 3591 completed: No

...

Caused by: java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine

...

My code:

String initialContextFactory="com.ibm.websphere.naming.WsnInitialContextFactory";
String providerUrl="iiop://localhost:9100";

Hashtable<String, String> environment=new Hashtable<String, String>();
environment.put(Context.INITIAL_CONTEXT_FACTORY,initialContextFactory);
environment.put(Context.PROVIDER_URL,providerUrl);

Context ctx=new InitialContext(environment);
obj=ctx.lookup("com.xyz.Test");
António Ribeiro
  • 4,129
  • 5
  • 32
  • 49
sAm
  • 319
  • 2
  • 20
  • Are you sure the port number is correct? The default port number for iiop on websphere is 2809 . This can be changed while profile creation. – Sampada Mar 22 '16 at 09:47
  • When I tried same code on my local WAS server, I user the ORB_LISTENER_ADDRESS port which is 9100. While using it for remote server, the ORB_LISTENER_ADDRESS port number is different, for which I am getting the error. So do you think I shall use 2809 which is BOOTSTRAP_ADDRESS port instead ORB_LISTENER_ADDRESS? And thanks for the edits. – sAm Mar 22 '16 at 09:55
  • I think using 2809 should help. – Sampada Mar 22 '16 at 10:01
  • Still facing same problem. I used 9812 which is BOOTSTRAP_ADDRESS port for the server. – sAm Mar 22 '16 at 10:09
  • Ok. found a similar issue. Have you tried this - http://stackoverflow.com/questions/6826111/unable-to-lookup-remote-ejb-on-websphere-8 ? – Sampada Mar 22 '16 at 10:13

0 Answers0