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");