• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

javax.naming. NoInitialContextException:

 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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) ]
 
Brahim Bakayoko
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Still need help on this one...
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Brahim Bakayoko
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
up..
Still need help...
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic