To connect to session bean from swing client
Posted on 2004-10-18
We are working on WSAD 5.1 and WAS. While connecting to an EJB in application server from Swing client using RMI/IIOP we are getting an error.
A communication failure occurred while attempting to obtain an initial context with the provider URL.
We tried using WSAD test server and WAS. We have created the EJB using WSAD and have build the files to create jar files and ear file. We are able to run the program using same machine as clent and test server in WSAD. While trying to run the application client jar file from a different client machine it is throwing exception. The piece of code used to access ejb is as mentioned below. Could you please guide us where we are going wrong, is it that we have missed some setting in server or WSAD, hope this is conceptually correct.
contextfactory = "com.ibm.websphere.naming.WsnInitialContextFactory";
providerurl = "corbaloc:iiop://126.96.36.199:2809";
properties = new java.util.Properties();
context = new InitialContext(properties);
objref = context.lookup("ejb/testpack/testHome");
testHome home = (testHome) objref;
Help in this regard will be much appreciated. If you need any further details please get back.