The moose likes EJB and Other Java EE Technologies and the fly likes question about calling a no-ejb class's method in ejb method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply Bookmark "question about calling a no-ejb class Watch "question about calling a no-ejb class New topic
Author

question about calling a no-ejb class's method in ejb method

liang sun
Ranch Hand

Joined: May 12, 2001
Posts: 51
I call a no-ejb class's method in ejb method,

import a.wu;
.....
public void bean_method()
{
wu k=new wu();
k.show();
}
..........
complie success,but in runTIME, throws
java.rmi.RemoteException: EJB Exception: ;
nested exception is: java.lang.NoClassDefFoundError: a/wu��
( NOTE: you must konw classpath of Class a.wu have already been set,complie success )
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3878
It doesn't matter that you can compile the class -- that's a different classpath.
Make sure that your a.wu class is included inside the EJB JAR file along with your EJB classes and it should work fine.
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.


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.
Phil Sharp
Ranch Hand

Joined: Nov 08, 2001
Posts: 40
Need some more information on how wu is available in the deployed version.
Do you put it in the classpath of the application server? Alternatively you can use a J2EE application.
The following references might help:
http://www.onjava.com/pub/a/onjava/2001/06/26/ejb.html
http://www.onjava.com/pub/a/onjava/2001/07/25/ejb.html
Phil
liang sun
Ranch Hand

Joined: May 12, 2001
Posts: 51
sorry, i forgot to tell you that i run my project in JBUilder5.0
,I have already set classpath of Class a.wu in jbuilder 5.0��
liang sun
Ranch Hand

Joined: May 12, 2001
Posts: 51
I set path of Class a.wu to Classpath of application server.
but still can't solve question!
why?
Rahool Joshi
Greenhorn

Joined: Nov 19, 2001
Posts: 1
Originally posted by liang sun:
I set path of Class a.wu to Classpath of application server.
but still can't solve question!
why?

I think when you are not sure that your class is in the servers classpath, put your class in the lib of server or the directory where server classes are located.it should work..
Rahool
 
 
subject: question about calling a no-ejb class's method in ejb method
 
Threads others viewed
Exception
EJB 3.0 Interceptors question
(to Kyle Brown) question about calling a no-ejb class's method in ejb method
Cannot forward after response has been committed
EJB questions
developer file tools