| Author |
javax.naming. NoInitialContextException:
|
Brahim Bakayoko
Ranch Hand
Joined: Aug 29, 2003
Posts: 155
|
|
1. All imports are well set 2. IDE = Websphere studio 5 3. output: (java.lang.String) failed! NamingException javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory. Root exception is java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory at java.net.URLClassLoader.findClass(URLClassLoader.java:240) Can anyone tell me how to properly set the jndi settings? Thanks! Also: everything works fine when the bean is used in a jsp or servlet either directly or through an access bean. The above code is for a remote client trying to access the bean. [ November 25, 2003: Message edited by: Brahim Bakayoko (Ivory Coast) ]
|
SCJP, SCWCD, SCBCD, IBM CSD WebSphere v5, <br />A+, MCP 2000 and 2000 server, CST, and few incompleted certification tracks.<br /> <br />Ivory Coast<br /> <br />Analyze your web Request/Response @ <a href="http://webtools.servehttp.com" target="_blank" rel="nofollow">http://webtools.servehttp.com</a> down for a while...
|
 |
Brahim Bakayoko
Ranch Hand
Joined: Aug 29, 2003
Posts: 155
|
|
|
Still need help on this one...
|
 |
Kyle Brown
author
Ranch Hand
Joined: Aug 10, 2001
Posts: 3879
|
|
I really wish I could say "go get my book", which does cover this, but it won't be in bookstores or Amazon for another two weeks yet. Sigh... Anyway, the major issue is that you can't create an EJB client in a "standard" Java project in WSAD. It has to be done in an Application Client project, which is part of the same EAR as your EJB classes. This will correctly set the classpaths to allow you to get to classes like InitialContext. Then, you have to make sure that you edit the Module dependencies to ensure that your application client project has a reference to your EJB Project. Finally, you have to make sure you run this as a Java application client, and not as a Java application from the Run... menu. That's the basics. Hopefully this will help. Kyle
|
Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
|
 |
Brahim Bakayoko
Ranch Hand
Joined: Aug 29, 2003
Posts: 155
|
|
Thanks. I'll make sure to pick up your new book. Creating a client application did not help however. Running the app within the web context: Where would I go to check on my COS naming settings? Also, I don't get the point of having the client app within the same EAR with the EJBs. This is counter-intuitive to the client being deployed independently. I want to use the client remotely using RMI-IIOP. [ November 29, 2003: Message edited by: Brahim Bakayoko (Ivory Coast) ]
|
 |
Brahim Bakayoko
Ranch Hand
Joined: Aug 29, 2003
Posts: 155
|
|
up.. Still need help...
|
 |
 |
|
|
subject: javax.naming. NoInitialContextException:
|
|
|