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

initial context factory

0 views
Skip to first unread message

Josh Cimino

unread,
Nov 1, 2001, 4:40:06 PM11/1/01
to
I'm new to Websphere....
 
I think I've installed an ejb correctly. Now how do I connect to it? Should I use 'com.ibm.websphere.naming.WsnInitialContextFactory' as the initial context factory? What's the URL to connect to?
 
Also, does Websphere come with any sample source code? I can't seem to find any.
 
Thanks in advance,
 

Josh Cimino
Software Developer

Mxi Technologies Ltd.
1430 Blair Place, Suite 800
Ottawa, ON, Canada
K1J 9N2

E: josh....@mxi.com
T: 613.747.4698 ext 479
F: 613.747.1909
www.mxi.com

"From the flight line to the bottom line"

Hari Rajagopal

unread,
Nov 1, 2001, 4:50:09 PM11/1/01
to
localhost:900 which is the iiop port I believe
Here is a code snippet
 
 

try {

                       Properties props = new Properties();

                       props.put(Context.INITIAL_CONTEXT_FACTORY,                               "com.ibm.websphere.naming.WsnInitialContextFactory");

                       props.put(Context.PROVIDER_URL, "iiop://localhost:900");

                      

                       InitialContext _theCtx = new InitialContext(props);

                      

                       System.out.println("Got the initial context");

Martin West

unread,
Nov 2, 2001, 5:28:32 AM11/2/01
to
In addition you need the environemmnt, classpath etc setup correctly, I
cloned the dumpNameSpace script to run my external application which loaded
stuff into the websphere jndi context, also
beware that the websphere JNDI is not peristant in the basic websphere.
regards Martin West

"Josh Cimino" <josh_...@hotmail.com> wrote in message
news:9rsfmd$dug$1...@news.boulder.ibm.com...

I'm new to Websphere....

I think I've installed an ejb correctly. Now how do I connect to it? Should
I use 'com.ibm.websphere.naming.WsnInitialContextFactory' as the initial
context factory? What's the URL to connect to?

Also, does Websphere come with any sample source code? I can't seem to find
any.

Thanks in advance,


David Artus

unread,
Nov 2, 2001, 8:04:30 AM11/2/01
to
There are many samples delivered with websphere. Make sure that you
download
the full Info Centre and then go exploring. You need to visit the right
place in the
Info Centre in order to install the example code.

Also download the redbooks from www.redbooks.ibm.com

Also look at the articles on www.webspherepro.com

There is ample material in the above to get you going.

Josh Cimino wrote:

> I'm new to Websphere.... I think I've installed an ejb correctly. Now
> how do I connect to it? Should I use
> 'com.ibm.websphere.naming.WsnInitialContextFactory' as the initial
> context factory? What's the URL to connect to? Also, does Websphere
> come with any sample source code? I can't seem to find any. Thanks in
> advance,

> -----------------------------------------------------------------------

Josh Cimino

unread,
Nov 2, 2001, 8:57:15 AM11/2/01
to
Should there also be the following line when getting an initial context?
 
props.put( Context.SECURITY_PRINCIPAL, "username" );
props.put( Context.SECURITY_CREDENTIALS, "password" );
 
Thanks,
 
 
"Hari Rajagopal" <grim...@yahoo.com> wrote in message news:9rsgbu$eca$1...@news.boulder.ibm.com...

Josh Cimino

unread,
Nov 2, 2001, 10:34:26 AM11/2/01
to
When I try to get an initial context, I get the following error:
 
javax.naming.ServiceUnavailableException: NULL returned when resolving initial reference=NameService
 at com.ibm.ws.naming.util.WsnInitCtxFactory.getCosRootContext(WsnInitCtxFactory.java:452)
 at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:337)
 at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContext(WsnInitCtxFactory.java:200)
 at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(WsnInitialContextFactory.java:80)
 at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:665)
 at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
 at javax.naming.InitialContext.init(InitialContext.java:222)
 at javax.naming.InitialContext.<init>(InitialContext.java:198)
I'm assuming this is because the NameService is not enabled. So how do I enable the NameService?
 
Thanks,
 
"Hari Rajagopal" <grim...@yahoo.com> wrote in message news:9rsgbu$eca$1...@news.boulder.ibm.com...
0 new messages