Bean With Primary Key Not Found In Home

Discussions

EJB programming & troubleshooting: Bean With Primary Key Not Found In Home

  1. Bean With Primary Key Not Found In Home (1 messages)

    I am getting the following Exception when I am tyring to create new record with my entity bean.

    java.lang.Exception: Bean with primary key: 'sg.gov.mcds.ccls.ipadebarcase.IpaDebarCaseEntPK@48d7949f' not found in home: 'IpaDebarCaseEnt' and therefore wasn't updated.

    Here is my Primary key's Definition :-
    package ipadebarcase;
    public class IpaDebarCaseEntPK implements java.io.Serializable {
    public String debarcaserefNo;
    public IpaDebarCaseEntPK() {}
    public IpaDebarCaseEntPK(String debarcaserefNo) {
    this.debarcaserefNo=debarcaserefNo;

    }
    public String getDebarCaseRefNo() {
    return debarcaserefNo;
    }
    public void setDebarCaseRefNo(String debarcaserefNo) {
    this.debarcaserefNo=debarcaserefNo;
    }
    public boolean equals(Object obj) {
    if(obj instanceof IpaDebarCaseEntPK)
    return(debarcaserefNo.equals(((IpaDebarCaseEntPK)obj).debarcaserefNo));
    else
    return false;
    }
    public int hashCode() {
    return debarcaserefNo.hashCode();
    }
    }

    My Signature of create method in Home interface is
    public IpaDebarCaseEnt create(String debarcaserefNo,String debarpersonId ,String debartypeCd,String debarpersonNm,java.sql.Date debarfrmDt,java.sql.Date debartoDt ,String debarReason ,String adRmrks,java.sql.Date adrmrksDt, String doctypeCd,String docstatusCd,String addUsrId) throws RemoteException, CreateException;

    And ejbCreate Method in my Bean class is
    public IpaDebarCaseEntPK ejbCreate(String debarcaserefNo, String debarpersonId ,String debartypeCd, String debarpersonNm, java.sql.Date debarfrmDt,java.sql.Date debartoDt , String debarReason ,String adRmrks,java.sql.Date adrmrksDt,String doctypeCd,String docstatusCd, String addUsrId) throws CreateException {
         /*
          body
         */
        return null;
    }
     I am using weblogic 5.1.
     I have checked my deployement descriptors. there is nothing wrong in it. I have compared it with the deployment descriptors of other similar beans, it is same as other deployment descriptors.

    Please suggest something to solve this problem
    Thank You,
    Sameer.
  2. Which service pack are you using with Weblogic 5.1? There was a problem with early versions similar to this. If you're not using SP8, I'd suggest upgrading to that, and trying it again.

    Also, make sure that you actually *are* using SP8 if you think you are. It's very easy to pick up an earlier version by mistake (as I've done a number of times!!).

    Cheers,
    Rick