File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes Error while running ejb client.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Error while running ejb client...." Watch "Error while running ejb client...." New topic
Author

Error while running ejb client....

sailaja parepalli
Ranch Hand

Joined: Jan 23, 2003
Posts: 33
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


Sailu<br />IBM 486, SCJP, Brainbench CJP
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
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.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
sailaja parepalli
Ranch Hand

Joined: Jan 23, 2003
Posts: 33
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
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
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

Joined: Jan 23, 2003
Posts: 33
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
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
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

Joined: Jan 23, 2003
Posts: 33
Thank You.
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

Moving to IDE forum per moderator request.


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error while running ejb client....