facebook

fail to use CMP entity bean inside a stateless session bean

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #273070 Reply

    calsonli
    Member

    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

    #273116 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev

    Unfortunately I don’t have enough experience with CMP to help out, did you try asking on the JBoss forums?

    #273137 Reply

    calsonli
    Member

    Hi Riyad,

    It doesn’t matter. Anyway, thanks for your advice. I will try to ask the same question in JBoss forum.

    Regards,
    Calson

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: fail to use CMP entity bean inside a stateless session bean

You must be logged in to post in the forum log in