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

JDBCStoreManager.setInverseRelation throw NullPointerException when <property name="openjpa.RuntimeUnenhancedClasses" value="supported" />

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 2.0.0
    • None
    • UnenhancedClasses
    • None
    • apache-tomcat-7.0.5

    Description

      When <property name="openjpa.RuntimeUnenhancedClasses" value="supported" /> and entity has a OneToMany field with FetchType.EAGER

      @OneToMany(cascade = ALL, fetch = EAGER)
      private List<?> list;

      JDBCStoreManager.setInverseRelation try to get meta data from cache, but sub class is not in the cache when openjpa.RuntimeUnenhancedClasses is supported.

      nested exception is <openjpa-2.0.0-r422266:935683 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: null
      java.lang.NullPointerException
      at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.setInverseRelation(JDBCStoreManager.java:489)
      at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:449)
      at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:342)
      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:1005)
      at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:963)
      at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:885)
      at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1050)
      at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:280)
      at org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2344)
      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:1246)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1005)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:861)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:792)
      at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542)
      at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:288)
      at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:302)
      at org.springframework.orm.jpa.JpaTemplate$10.doInJpa(JpaTemplate.java:330)
      at org.springframework.orm.jpa.JpaTemplate$10.doInJpa(JpaTemplate.java:1)
      at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:183)
      at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:146)
      at org.springframework.orm.jpa.JpaTemplate.findByNamedParams(JpaTemplate.java:321)
      ...

      Attachments

        Activity

          People

            Unassigned Unassigned
            eshock eshock
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: