• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Error while running ejb client....

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am running my ejb client in WSAD 5.0.
Code for the client follows:-
-------------------------------------------------------------------
java.util.Hashtable props = new java.util.Hashtable();
props.put(InitialContext.PROVIDER_URL, "iiop://localhost:900/");
props.put(InitialContext.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
Context ctx = new InitialContext(props);
Object obj = ctx.lookup("ejb/com/ad/ejb/SimpleSessionHome");
SimpleSessionHome ptxhome = (SimpleSessionHome) PortableRemoteObject.narrow(obj,SimpleSessionHome.class);
-------------------------------------------------------------------
The ejb session bean also is running on the same WSAD 5.0 with WAS 4.0 runtime environment.
I am getting the following exception while executing my client application....................
Nested Exception is java.lang.NoClassDefFoundError: com.ad.ejb.SimpleSessionHome
I added the SimpleSession ejb-jar file to the java build path while compiling the application itself.
Any help is greatly appreciated.
--
Sailu
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by sailu:
I added the SimpleSession ejb-jar file to the java build path while compiling the application itself.

But have you included the jar file into the runtime classpath?
On a different note, "sailu" doesn't conform to our naming policy because we require both a first name (or initial) and a last name. You can change it here.
Thanks.
 
sailaja parepalli
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you please be more clear?
I included it in Java build path using properties->Java build path->libraries->Add external jars.
Do I have to do anything else other than this?
Thanks.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm. You shouldn't need to add your own project .jar file into the project's build path -- everything should already be in the source folders, and thus end up into the classpath when you're running something from within WSAD.
 
sailaja parepalli
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have creted and tested the ejb project with Universal test client first. It works fine. Then I created the application client project and have created the client to access the SimpleSession EJB. How do I access the ejb project classes (Remote Home, bean etc) without including the SimpleSession-ejb-jar.jar file in my application client build path?
Do I have to import or include it while creating the application client project itself? If yes, can you please tell me how to do it?
Thanks much.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, the client .jar file is needed in the classpath when running the client application.
How to do that with WSAD is beyond my skill set (I'm an Eclipse user but this is WSAD specific stuff).
 
sailaja parepalli
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank You.
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to IDE forum per moderator request.
 
My honeysuckle is blooming this year! Now to fertilize this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic