Loading

An EJB Exception:The user-provided class "XXXX" needed by the EnterpriseBean could not be found or loaded.

----------

Problem:
----------
After delpoy an EJB application to Websphere server 7, there was an exception: "The user-provided class "XXXX" needed by the EnterpriseBean could not be found or loaded."
 
----------
Cause:
----------
this problem occurs because the stub/skeleton files of the EJB are no more compatable with the other code.If you do not regenerate the RMIC code every time you change either classes that are called inside the EJB, you get this problem, in some extreme cases delete the stub and skeleton classes for the EJB and generate them again, this should totally remove exception you are getting.
 
----------
Solution:
----------
1) Deploy your EJB.Jar from your ear file separately in WAS. This will generate deployment code in your EJB.jar.
2) Take the deployed EJB.Jar and put it in your original .ear file, overwriting the original EJB.Jar.
3) Now start up the .ear file and it should work.
 
----------
Note:
----------
"Deploy" the EJB in RAD7:
1. Select the EJB Project in the J2EE perspective view;
2. Righ-click on the EJB project;
3. Select "Prepare for preparement" in the context menu;
 
----------
Reference:
----------
posted @ 2012-02-14 15:41  zJun  阅读(1099)  评论(0编辑  收藏  举报