3 Replies Latest reply on Feb 27, 2002 8:59 PM by 3004

    'PersistenceCapableMetadata' in JDOFatalUserException

    3004
      Suddenly, one of our unit tests is throwing a JDOFatalUserException with
      this stack trace:

      javax.jdo.JDOFatalUserException: PersistenceCapableMetadata
      at
      javax.jdo.JDOImplHelper.newObjectIdInstance(JDOImplHelper.java:166)
      at
      com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.newObjectId(JDBCStoreManager.java:374)

      at
      com.solarmetric.kodo.runtime.PersistenceManagerImpl.makePersistentFilter(PersistenceManagerImpl.java:671)

      at
      com.solarmetric.kodo.runtime.PersistFCOFieldManager.setFirstClassObject(PersistFCOFieldManager.java:107)

      at
      com.solarmetric.kodo.runtime.PersistFCOFieldManager.setObject(PersistFCOFieldManager.java:75)

      at
      com.solarmetric.kodo.runtime.StateManagerImpl.providedObjectField(StateManagerImpl.java:1007)

      at
      com.commercehub.common.jdo.CTI_Order.jdoProvideField(CTI_Order.java)
      at
      com.solarmetric.kodo.runtime.StateManagerImpl.provideFields(StateManagerImpl.java:1305)

      at
      com.solarmetric.kodo.runtime.StateManagerImpl.persistFirstClassFields(StateManagerImpl.java:1254)

      at
      com.solarmetric.kodo.runtime.PNewState.preStore(PNewState.java:31)
      at
      com.solarmetric.kodo.runtime.StateManagerImpl.preStore(StateManagerImpl.java:334)

      at
      com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:319)

      at
      com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:245)

      at
      com.commercehub.common.jdo.CTI_OrderTest.testHollowCreateAndSave1(CTI_OrderTest.java:88)

      at
      com.commercehub.common.jdo.CTI_OrderTest$1.runTest(CTI_OrderTest.java:60)

      at junit.framework.TestCase.runBare(TestCase.java:140)

      At the point the exception is thrown, all we've done is create and fill
      in an object, pass it to the PersistenceManager.makePersistent(), and
      commit the transaction. (The enhancer ran over the class with no
      errors.) Clearly, we've changed something, but a hint on what's going on
      at that line in JDOImplHelper would be appreciated.

      Other possibly pertinent info: app identity, Oid class a static nested
      class of the persistent class.

      thanks,
      --
      Jerry Pulley
      Sr. Developer
      Commerce Technologies, Inc.
      21 Corporate Drive
      Clifton Park, NY 12065
      518.886.0700 x3876 Phone
      518.886.0701 Fax


        • 1. Re: 'PersistenceCapableMetadata' in JDOFatalUserException
          3004
          Jerry,

          JDOImplHelper is trying to locate its internally stored metadata for one
          of your persistent types associated with a new object reachable from the
          object being committed.

          Unfortunately, that particular JDOImplHelper method does not include the
          name of the class being looked up in the error message.

          The JDO spec requires that classes register themselves with the
          JDOImplHelper in their static initializer (the enhancer takes care of
          this). This method is performing a lookup in that registry, and throws
          the exception that you see when it cannot be found.

          So, it looks like one of your persistent types is not being registered
          with JDOImplHelper. This would actually imply that one of your
          persistent types has not been enhanced or was recompiled before
          execution, as the registration with JDOImplHelper happens in the static
          initialization block. Are you certain that none of your persistent types
          are unenhanced at this point?

          It would probably be very useful to have the name of the class that is
          failing. Could you modify your test to manually invoke makePersistent()
          on all the first-class objects that are fields of the test object? One
          of these makePersistent() invocations should fail in just the same way
          as the current failure, except that you will be able to detect which
          object failed by looking at which object you invoked makePersistent()
          on.

          Meanwhile, we should wrap that JDOImplHelper call and augment the
          information in the message.

          By the way, how are you invoking junit? That is, is it executing from
          ant, from the JUnit gui, etc.

          -Patrick

          --
          Patrick Linskey pcl@solarmetric.com
          SolarMetric Inc. http://www.solarmetric.com
          • 2. Re: 'PersistenceCapableMetadata' in JDOFatalUserException
            3004
            Thanks, Patrick. Yep, we had left one of several new classes out of
            system.prefs, so it wasn't getting enhanced. Beginner-level error, but not
            so easy to spot in a multi-developer environment.

            jp


            --
            Jerry Pulley
            Sr. Developer
            Commerce Technologies, Inc.
            21 Corporate Drive
            Clifton Park, NY 12065
            518.886.0700 x3876 Phone
            518.886.0701 Fax


            • 3. Re: 'PersistenceCapableMetadata' in JDOFatalUserException
              3004
              Jerry Pulley <jpulley@commercehub.com> writes:
              Thanks, Patrick. Yep, we had left one of several new classes out of
              system.prefs, so it wasn't getting enhanced. Beginner-level error, but not
              so easy to spot in a multi-developer environment.

              jp
              As of the 2.2.3 beta, I wrapped the JDOImplHelper exception in one of
              our own that includes the class name. That should help spot this type of
              problem in the future.

              -Patrick

              --
              Patrick Linskey pcl@solarmetric.com
              SolarMetric Inc. http://www.solarmetric.com