1 Reply Latest reply on Oct 26, 2002 5:57 AM by Jürgen Krannich

    Relationships between local and remote entities

    Bryan Rall Newbie

      Is it a problem to have a relationship from a remote entity to a local entity? I have a one to many relationship between Survey (remote) beans and Page (local) beans in my system. The remote side of the of the relationship "survey.getPages()" seems to work fine from inside the remote bean (it's not exposed as an interface method of course), but the other side page.getSurvey() throws a null pointer exception.

      java.lang.NullPointerException
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.getEntityEJBLocalObject(BaseLocalContainerInvoker.java:199)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.getInstanceValue(JDBCCMRFieldBridge.java:502)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.getValue(JDBCCMRFieldBridge.java:465)
      at org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke(EntityBridgeInvocationHandler.java:124)

      Any suggestions?

        • 1. Re: Relationships between local and remote entities
          Jürgen Krannich Newbie

          Hi Bryan,

          AFAIK the EJB-specs forbit to establish a container managed relationsship between two Beans with one or both of them beeing non-local. The return value of a CMR-method has to be a local interface. Obviously your page.getSurvey() does not return a local but a remote interface which is not allowed. So if you are using CMR your implementation cannot work.

          Greetings,
          Jürgen