I get the same error (see below) if I use "iiop://localhost:900",
"iiop://localhost:9090", "iiop://<machine>localhost:900 ", or
"iiop://<machine>localhost:9090" to obtain the InitialContext. I have the
following jars in my classpath (c:/WebSphere/AppServer/lib/j2ee.jar,
c:/WebSphere/AppServer/lib/websphere.jar,
c:/WebSphere/AppServer/lib/ras.jar,
c:/WebSphere/AppServer/java/lib/tools.jar,
c:/WebSphere/AppServer/lib/ext/ibmorb.jar.
I am able to run the pre-build HelloEJB and Increment ejb-beans with NO
problems. I assume that something with my clients class path is not setup
correctly, but I can not figure out what it is.
Any help or direction on what I am doing wrong here would be appreciated.
Thanks
Kevin
my setup:
Windows2000
WAS 4.0
JBuilder 4.0
my code:
private InitialContext getInitialContext() throws NamingException {
try {
Properties h = new Properties();
h.put( Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory" );
h.put( Context.PROVIDER_URL, "iiop://localhost:900" );
return new InitialContext(h);
}
catch( NamingException ne ) {
log( ne.getMessage() );
ne.printStackTrace();
throw ne;
}
}
my error:
NamingException thrown: NULL returned when resolving initial
reference=NameService
javax.naming.ServiceUnavailableException: NULL returned when resolving
initial reference=NameService
at
com.ibm.ws.naming.util.WsnInitCtxFactory.getCosRootContext(WsnInitCtxFactory
.java:479)
at
com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactor
y.java:336)
at
com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContext(WsnInitCtxFactory
.java:199)
at
com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(WsnIniti
alContextFactory.java:79)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:668)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
at javax.naming.InitialContext.init(InitialContext.java:222)
at javax.naming.InitialContext.<init>(InitialContext.java:198)
at osclient.OSTestClient.getInitialContext(OSTestClient.java:108)
at osclient.OSTestClient.lookupHome(OSTestClient.java:88)
at osclient.OSTestClient.<init>(OSTestClient.java:36)
at osclient.OSTestClient.main(OSTestClient.java:59)Unable to look up the
beans home: NULL returned when resolving initial reference=NameService
%WAS_HOME%\deploytool\itp\plugins\com.ibm.etools.j2ee\runtime\ejs.jar;
%WAS_HOME%\deploytool\itp\plugins\com.ibm.etools.j2ee\runtime\ujc.jar;
and you can use "iiop://localhost:900" as the provider url if you
are running the client on the server machine itself, else you need to
specify the IP or host name of the server.
hope this solves your problem.
regards,
Jagadeesh
"Kevin Tucker" <TUC...@ONTOS.COM> wrote in message
news:9lr32a$ge2$1...@news.boulder.ibm.com...
Thanks
Kevin
Jagadeesh <jagad...@net-kraft.com> wrote in message
news:9lr3c1$rp8$1...@news.boulder.ibm.com...
I fix it, using the ibm JDK, not the sun JDK, which comes with
Jbuilder.
WAS 4.0 comes with an IBM JDK.
I run my test program from the command line using the guidelines
specified in the redbook sg246134
(you can get it from www.ibm.com/redbooks).
I hope it helps.
Lalo Steinmann
"Kevin Tucker" <TUC...@ONTOS.COM> wrote in message news:<9lr32a$ge2$1...@news.boulder.ibm.com>...
"Kevin Tucker" <TUC...@ONTOS.COM> wrote in message
news:9lri3v$14m0$1...@news.boulder.ibm.com...
My problem appears to because I was using the Borland JVM (JBuilder 4.0 -JDK
1.3), by switching to the IBM JVM I am now able to successfully create an
InitialContext object. I still don't know the reason why, but it does
work.
Thanks for your time and help.
Kevin
Jagadeesh <jagad...@net-kraft.com> wrote in message
news:9lsncv$1cfs$1...@news.boulder.ibm.com...