OpenJPA
  1. OpenJPA
  2. OPENJPA-2112

NPE during eager-fetching of simple m:n (ManyToMany) relation

    Details

      Description

      Hi,

      in case of ManyToMany eager join unidirectional join, a nullpointer exception is thrown:

      Exception in thread "main" <openjpa-2.1.1-r422266:1148538 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: null
      FailedObject: select t from Itemlist t [java.lang.String]
      at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:1008)
      at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:907)
      at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1041)
      at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:280)
      at org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2381)
      at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:274)
      at org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject(InstanceResultObjectProvider.java:59)
      at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:36)
      at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1251)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1007)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:863)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:794)
      at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542)
      at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:315)
      at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:331)
      at de.meyerwerft.test.ItemTester.getItemlist_Items(ItemTester.java:102)
      at de.meyerwerft.test.ItemTester.main(ItemTester.java:19)
      Caused by: java.lang.NullPointerException
      at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.setInverseRelation(JDBCStoreManager.java:480)
      at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:440)
      at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:333)
      at org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:112)
      at org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57)
      at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:1027)
      at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:985)
      ... 16 more

      Given relations:

      • Itemlist
      • Item
      • Itemlist_Item

      Properties set:

      <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" />
      <property name="openjpa.RuntimeUnenhancedClasses" value="supported" />

      1. Eager_Bug.zip
        2 kB
        Reiner Lott

        Activity

        Hide
        Rick Curtis added a comment -

        I hate to say this but I the most timely solution to this problem is to not set openjpa.RuntimeUnenhancedClasses=supported. RuntimeUnenhancedClasses is a half baked feature that has numerous documented issues and no one is going to get to this anytime soon. Please take a look at these links [1][2] which detail other enhancement strategies.

        I'm closing this issue because we don't intend on making subclassing usable in the near future. We will reopen if/when we decide to tackle that work.

        Thanks,
        Rick

        [1] http://webspherepersistence.blogspot.com/2009/02/openjpa-enhancement.html
        [2] http://openjpa.apache.org/entity-enhancement.html

        Show
        Rick Curtis added a comment - I hate to say this but I the most timely solution to this problem is to not set openjpa.RuntimeUnenhancedClasses=supported. RuntimeUnenhancedClasses is a half baked feature that has numerous documented issues and no one is going to get to this anytime soon. Please take a look at these links [1] [2] which detail other enhancement strategies. I'm closing this issue because we don't intend on making subclassing usable in the near future. We will reopen if/when we decide to tackle that work. Thanks, Rick [1] http://webspherepersistence.blogspot.com/2009/02/openjpa-enhancement.html [2] http://openjpa.apache.org/entity-enhancement.html

          People

          • Assignee:
            Rick Curtis
            Reporter:
            Reiner Lott
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development