Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
liang sun
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Phil Sharp
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I set path of Class a.wu to Classpath of application server.
but still can't solve question!
why?
 
Rahool Joshi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!