Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can't access JNDI on Websphere AS

139 views
Skip to first unread message

Mykola Ostapchuk

unread,
Aug 13, 2003, 3:28:06 PM8/13/03
to
Hello,

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?

Balasubramanian Mangalaganesh

unread,
Aug 14, 2003, 11:59:13 AM8/14/03
to
Mykola,

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

Mykola Ostapchuk

unread,
Aug 14, 2003, 11:45:43 AM8/14/03
to
Hi 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...

Manglu

unread,
Aug 19, 2003, 6:03:13 AM8/19/03
to
Hi Mykola.

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

O

unread,
Aug 21, 2003, 12:12:15 PM8/21/03
to
Hey Mykola,
Have you figured out this problem? I'm getting exactly the same error
with the same minor code: 4942F301 when I try to look up an EJB
running on WAS 5.0 serverA from a servlet on WAS 5.0 serverB.
Your reply is appreciated.

Thanks

Omar

man...@yahoo.com (Manglu) wrote in message news:<2ae5cba9.03081...@posting.google.com>...

mcole1

unread,
Sep 8, 2003, 4:11:24 AM9/8/03
to
Hi,

We're having the same problem.

Did you or anyone else fix this ???

thanks,

Michelle

shlomok

unread,
Sep 8, 2003, 10:23:34 AM9/8/03
to
Hi,
What was the exception on the server side ? . check system.out and extract the error (if any).


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


shlomo

unread,
Sep 8, 2003, 10:43:12 AM9/8/03
to
1-Do you have global security enabled on the other server (the one
with the EJB )?

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>...

0 new messages