Hi all,

        I'm getting the following error:

[acc_library] javax.ejb.ObjectNotFoundException: Object with primary key
accessprj.Cpublicationpk@3 not found in storage
[acc_library]   at
org.jboss.ejb.plugins.jaws.jdbc.JDBCFindEntityCommand.findByP
rimaryKey(JDBCFindEntityCommand.java:88)
[acc_library]   at
org.jboss.ejb.plugins.jaws.jdbc.JDBCFindEntityCommand.execute
(JDBCFindEntityCommand.java:59)
[acc_library]   at
org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.findEntity(
JAWSPersistenceManager.java:130)
[acc_library]   at
org.jboss.ejb.plugins.CMPPersistenceManager.findEntity(CMPPersistenceManager
.java:270)
[acc_library]   at
org.jboss.ejb.EntityContainer.find(EntityContainer.java:419)
[acc_library]   at java.lang.reflect.Method.invoke(Native Method)

....

[acc_library]   at $Proxy24.findByPrimaryKey(Unknown Source)
[acc_library]   at
accessprj.acc_libraryBean.isPubAvailable(acc_libraryBean.java:644)

        I'm trying to access a field through an entity bean.

try {
        Context jndiContext = new InitialContext();
        Object publication_ref = jndiContext.lookup("publication");
        publicationHome publicationhome = (publicationHome)
javax.rmi.PortableRemoteObject.narrow(publication_ref,publicationHome.class)
;
        pubpk.pub_id=pub_id;
        try {
          pub = publicationhome.findByPrimaryKey(pubpk);
          quantity= pub.getQuantity();
        } catch (javax.ejb.FinderException fe) { fe.printStackTrace();
return available; }

      }
      catch (NamingException ne) {ne.printStackTrace();}
      catch (RemoteException re) {re.printStackTrace();}

my primary key class is as follows:

public class Cpublicationpk implements Serializable {
  public int pub_id;

  public int hashCode() {
    return pub_id;
  }

  public boolean equals(Object obj) {
    if (obj instanceof Cpublicationpk) {
      return (pub_id == ((Cpublicationpk)obj).pub_id);
    }
    return false;
  }
}

This happens with every row. What is wrong?? is something missing in JAWS??
With Inprise AppServer this code works fine.

        Best Regards,
        Carlos Ferrao


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to