3 Replies Latest reply on Aug 9, 2002 4:50 AM by Christian Riege

    Entity Proxy NullPointerException

    michael meadows Newbie


      Below is a partial stack trace when a CMP entity bean is created:

      java.lang.NullPointerException
      at com.visualfiles.workflow.ActivityAutoCreateBean$Proxy.setOrgId()
      at com.visualfiles.workflow.ActivityAutoCreateBean. ejbCreate(ActivityAutoCreateBean.java:41)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      ...

      NullPointerException occurs within the proxy whenever a field in the compound primary key is set within the ejbCreate method. Other fields outside the primary key do not throw this exception.

      Other beans using the same compound primary key have been created successfully within the same application. No relevant differences between the working beans and the ActivityAutoCreateBean can be discerned in either code or deployment description. Needless to say that no errors were reported whilst deploying this bean.

      If these exceptions are caught and simply ignored within ejbCreate (avoiding rollback) then a record is created perfectly within the table associated with the entity. Although it would be unwise to ignore this exception especially since its cause is unknown.

      It is very possible that I have not correctly set up something either within the code or the deployment descriptor since I am not familiar with EJB2.0. However, all the beans except this one work and the errant bean passes the deployment validation.

      I'm not happy posting this simply because of the paucity of the information supplied. But I have attempted to understand the source regarding the generation of entity proxy classes and have come to the conclusion that this will take a very significant amount of time.

      Michael.