Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2112

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

    XMLWordPrintableJSON

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" />

      Attachments

        1. Eager_Bug.zip
          2 kB
          Reiner Lott

        Activity

          People

            curtisr7 Richard G. Curtis
            evomaster Reiner Lott
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: