Thanks to Helene. The mistake I've done was using the method ejbFindXXX. In these methods getEJBObject() is not available. Using other name (getChildren in my case) works well. Peter -----Original Message----- From: ext Hélene JOANIN [mailto:[EMAIL PROTECTED]] Sent: Monday, January 29, 2001 4:53 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: accessing getPrimaryKey() [EMAIL PROTECTED] wrote: > > Hi, > > I'm trying to cast > > Integer pk = (Integer)(entityContext.getEJBObject().getPrimaryKey()); > > in method "public Enumeration ejbFindChildren()...". This always fails with > EJBServer: > > postinvoke: System Exception in a home > method:java.lang.NullPointerException > > I tried instead also: > > (Integer)entityContext.getPrimaryKey() > > but this does exactly the same error. > > Is entityContext available only to ejbLoad()?? > > Thanks in advance, > > peter Hi Peter, In the chapter 9.1.6 "Operations allowed in the methods of the entity bean class" of the Enterprise Javabeans Specification v 1.1, the table 4 tells that the getEJBObject() and getPrimaryKey() methods of EntityContext are not allowed in the ejbFind() method of an entity bean. The EntityContext methods allowed in the method ejbFind() of an entity bean are: getEJBHome, getCallerPrincipal, getRollbackOnly, isCallerInRole, setRollBackOnly. Kind regards. Hélène. -- -=- Hélène JOANIN -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- mailto:[EMAIL PROTECTED] http://www.evidian.com Phone: 33.4.76.29.73.53 Fax: 33.4.76.29.76.00 Download our EJB Server JOnAS at http://www.objectweb.org ---- To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "unsubscribe jonas-users". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
