I have 2 PCs under Win 2000 in local network, both have Websphere AS 5.0. I
have a Session bean deployed on one of them. I'm trying to access this bean
from another PC and get the next error:
javax.naming.ServiceUnavailableException: A communication failure occurred
while attempting to obtain an initial context using the provider url:
"iiop://bar:2809". Make sure that the host and port information is correct
and that the server identified by the provider url is a running name server.
If no port number is specified, the default port number 2809 is used. Other
possible causes include the network environment or workstation network
configuration. [Root exception is org.omg.CORBA.TRANSIENT: Connection
refused: connect:host=localhost,port=1465 minor code: 4942F301 completed:
No]
I've compiled EJB with IBM's JDK. I can ping "bar" server from another
server. When I run "telnet bar 2809" from "client" - it creates a
connection. I have client EJB in Classpass on client PC (The same ejb-jar as
on the server - only without *.*Bean class and deployment descriptor,
right?).
Here's the code on the client:
Hashtable jndiProps = new Hashtable();
jndiProps.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
jndiProps.put(Context.PROVIDER_URL, "iiop://bar:2809");
Context initCtx = new InitialContext(jndiProps);
java.lang.Object ejbHome = initCtx.lookup("myInfoRoot");
I can access EJB successfully locally, with the same code as above.
Any suggestions what's wrong in my approach?
give this a try.
Run the dumpNameSpace from the second machine and ask him to use the bar
and 2809 as the host and port just to see if the dumpNameSpace can
communicate with the "bar" Server.
HTH,
Manglu
I've tried dumpNameSpace to "bar" server - it returns the same Exception:
javax.naming.ServiceUnavailableException.
I don't understand how it happens - I can ping "bar", can telnet on port
2809... Is there something else I don't know?
Thanks a lot!
Regards,
Mykola
"Balasubramanian Mangalaganesh" <man...@NOSPAM-eutama.com> wrote in message
news:3F3BB1D...@NOSPAM-eutama.com...
I am surprised that the dumpNameSpace does not work considering the
fact that you mentioned that a local lookup works.
dumpNameSpace should be exactly the same as the local look up call for
you.Is it possible that somebody else other than the bootstrap guy
using hte 2809 port?
THe Server config ports should shed some light on this.
Are your running the dumpNameSpace in the same server (the BarServer)?
Try this as well,
Change the BootStrap port for your server to say 3333 and run the
dumpNameSpace on that port.
Keep us posted if you manage to overcome the problem.
Manglu
Thanks
Omar
man...@yahoo.com (Manglu) wrote in message news:<2ae5cba9.03081...@posting.google.com>...
We're having the same problem.
Did you or anyone else fix this ???
thanks,
Michelle
I use this code for a local/remote server access. use it and see if you get any error :
private java.util.Hashtable environment = null;
private javax.naming.Context remoteJndiCtx = null;
private javax.naming.Context localJndiCtx = null;
private void initAllContext(String url) {
environment = new java.util.Hashtable();
environment.put(javax.naming.Context.PROVIDER_URL, url);
environment.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
try {
System.out.println("creating initial context to a remote server...");
remoteJndiCtx = new InitialContext(environment);
if (null != remoteJndiCtx) {
System.out.println("creating initial context to a remote server done...");
System.out.println(remoteJndiCtx.toString());
}
System.out.println("creating initial context to a local server...");
localJndiCtx = new InitialContext();
if (null != localJndiCtx) {
System.out.println("creating initial context to a local server done...");
}
} catch (NamingException e) {
System.out.println(e);
}
}
2-Are you failing in obtaining the initial context or when doing an
EJB home lookup ?
:)
mcole1 <m.c...@hic.gov.au> wrote in message news:<745734437.1063008684531.JavaMail.wasadmin@swg3ws006>...