Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in calling entity bean from session bean

 
AmitCdac Grover
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all...

i am calling entity bean form session bean . i am getting the following error.
java.lang.NoClassDefFoundError .employee.EmpEntityHome


at run time session bean did not get enitybean home..

i have set all the class path..

follwing is the dir structure of my application

d:\demo\Jsp
d:\demo\WEB-INF\classes\servlet
d:\demo\WEB-INF\lib

d:\ejb\entity\classes\employee\.class files
d:\ejb\entity\src\employee\.java files

d:\ejb\session\classes\emp\.class files
d:\ejb\session\src\emp\.java files


i do the folling things..

1. deploy the entity bean i get the (entity.jar) and put the entity.jar into the lib folder then i the set classpath of that jar file. 2. deploy the session bean i get the (session.jar) and put that session.jar into the lib folder then i set classpath of that jar file.

now i i try to call the sessionbean form the servlet. it will give the above error which i have mentioned.

same code which i write in sessionbean if i write in the servlet and not use session bean give directly call from servlet to entity bean then it works fine if i use session bean between that it gives me error

i check the class path ,package i included many times. there is not problem

can i need to combine both the jar file into ear file,if so how can i make a ear file. i am using weblogic 7.0 .

plz help me out to solve this problem

Regards
amit grover
 
Mudi Appu
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because of you have deployed session beans and entity beans in separate jar files; classes of entity bean are not available to session beans and vise visa. The easy solution fro this is put entity.jar into the server class path. Other solution is package all EJBs (entity and session beans) together in one single EJB jar file. There are many more solutions´┐Ż. Try this first.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic