Hi all,
I created a stateless session bean which is invoked in doGet method of a servlet. I tried to add CMP entity bean lookup method in a business method of this session bean. It ends up with a “Naming Exception”. The code snippet inside the business method of stateless session bean is as follows.
try {
// StaffLocalHome is the home interface of CMP entity bean Staff
StaffLocalHome staffHome = StaffUtil.getLocalHome();
StaffLocal staff = staffHome.findByPrimaryKey(new StaffPK(loginID));
StaffData staffData = staff.getValueObject();
….
catch (NamingException ne) {
returnCode = 1;
}
catch (FinderException fe) {
returnCode = -2;
}
catch (Exception e) {
returnCode = 2;
}
…
If I moved the above codes inside the servlet where stateless session bean is invoked, no problem of naming exception when looking up CMP entity bean. So, it seems that ejb-jar.xml, jboss.xml, web.xml and jboss-web.xml are correctly configured.
Could you advise where the problem is?
Thank you,
Calson