1 Reply Latest reply on Aug 22, 2002 7:16 AM by morten Matras

    Entity not found,  Setting cmr field

    morten Matras Newbie

      "Houston we have a problem..."

      I have a One-Many relation (See below) between an exercise and a result bean:

      As I set an relation on a bean (Result), that has relations to another bean (Exercise), I get the following error:

      javax.ejb.NoSuchObjectLocalException: Entity not found: primaryKey=ep.exercises.ExerciseEJBPK@31

      But the entity is actually there. That I know since I write the name of it just on the line before.

      The code looks like this:
      //The exercise is found:
      exercise = ...Found via the collection of a third bean.
      //The exerciseResult is initialized:
      exerciseResult = ...

      System.out.println("Name: "+exercise.getName());

      The last line courses the failure.

      The output of this is typically:

      >>Name: Testopgave 1
      >>TransactionRolledbackLocalException, causedBy:
      >>javax.ejb.NoSuchObjectLocalException: Entity not found: primaryKey=ep.exercises.ExerciseEJBPK@31

      I stripped the message for not nessecary parts.

      Why does this failure arise?

      Morten Andersen

      I run on Jboss 3.0.1
      My relation between the two beans is deployed as:

      <cascade-delete />