OpenJPA
  1. OpenJPA
  2. OPENJPA-912

Potential NPE in setInverseRelation

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0, 1.2.1, 1.3.0, 2.0.0-M1, 2.0.0-M2
    • Fix Version/s: 1.2.1, 1.3.0, 2.0.0-M2
    • Component/s: jdbc
    • Labels:
      None

      Issue Links

        Activity

        Hide
        Donald Woods added a comment -

        Applied to 1.2.x. Thanks Mike.

        Show
        Donald Woods added a comment - Applied to 1.2.x. Thanks Mike.
        Hide
        Michael Dick added a comment -

        I've never seen this failure in 1.2.x, TestChainEntities is working as is at the moment. Is there another change that might be in trunk & 1.3.x which exposed this behavior?

        I see where the NPE is possible, but I'd expect that to be deterministic behavior. If it's intermittent I'd like to know more about what causes it in Catalina's environment that I can't reproduce locally.

        Show
        Michael Dick added a comment - I've never seen this failure in 1.2.x, TestChainEntities is working as is at the moment. Is there another change that might be in trunk & 1.3.x which exposed this behavior? I see where the NPE is possible, but I'd expect that to be deterministic behavior. If it's intermittent I'd like to know more about what causes it in Catalina's environment that I can't reproduce locally.
        Hide
        Donald Woods added a comment -

        Michael, please review and consider applying to branches/1.2.x. Thanks.

        Show
        Donald Woods added a comment - Michael, please review and consider applying to branches/1.2.x. Thanks.
        Hide
        Donald Woods added a comment -

        NPE patch ported from Trunk to 1.2.x, as suggested by Catalina in connection to the OPENJPA-925 patch.

        Show
        Donald Woods added a comment - NPE patch ported from Trunk to 1.2.x, as suggested by Catalina in connection to the OPENJPA-925 patch.
        Hide
        Catalina Wei added a comment -

        For tacking purpose, documenting the NPE in JDBCStoreManager.setInverseRelation().

        TestCase : TestChainEntities.testChainEntities

        <openjpa-2.0.0-SNAPSHOT-r422266:740991 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: null
        at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:968)
        at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:862)
        at org.apache.openjpa.kernel.DelegatingBroker.find(DelegatingBroker.java:201)
        at org.apache.openjpa.persistence.EntityManagerImpl.find(EntityManagerImpl.java:459)
        at org.apache.openjpa.persistence.relations.TestChainEntities.getA(TestChainEntities.java:94)
        at org.apache.openjpa.persistence.relations.TestChainEntities.chainUpdate(TestChainEntities.java:55)
        at org.apache.openjpa.persistence.relations.TestChainEntities.testChainEntities(TestChainEntities.java:50)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at org.apache.openjpa.persistence.test.PersistenceTestCase.runBare(PersistenceTestCase.java:443)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at org.apache.openjpa.persistence.test.PersistenceTestCase.run(PersistenceTestCase.java:173)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:334)
        at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:980)
        Caused by: java.lang.NullPointerException
        at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.setInverseRelation(JDBCStoreManager.java:395)
        at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:366)
        at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:264)
        at org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:111)
        at org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57)
        at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:987)
        at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:945)
        ... 33 more

        Show
        Catalina Wei added a comment - For tacking purpose, documenting the NPE in JDBCStoreManager.setInverseRelation(). TestCase : TestChainEntities.testChainEntities <openjpa-2.0.0-SNAPSHOT-r422266:740991 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: null at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:968) at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:862) at org.apache.openjpa.kernel.DelegatingBroker.find(DelegatingBroker.java:201) at org.apache.openjpa.persistence.EntityManagerImpl.find(EntityManagerImpl.java:459) at org.apache.openjpa.persistence.relations.TestChainEntities.getA(TestChainEntities.java:94) at org.apache.openjpa.persistence.relations.TestChainEntities.chainUpdate(TestChainEntities.java:55) at org.apache.openjpa.persistence.relations.TestChainEntities.testChainEntities(TestChainEntities.java:50) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at org.apache.openjpa.persistence.test.PersistenceTestCase.runBare(PersistenceTestCase.java:443) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at org.apache.openjpa.persistence.test.PersistenceTestCase.run(PersistenceTestCase.java:173) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) at org.apache.maven.surefire.Surefire.run(Surefire.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:334) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:980) Caused by: java.lang.NullPointerException at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.setInverseRelation(JDBCStoreManager.java:395) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:366) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:264) at org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:111) at org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57) at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:987) at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:945) ... 33 more
        Hide
        Donald Woods added a comment -

        This also needs to be applied to branches/1.2.x, as it is related to OPENJPA-925.

        Show
        Donald Woods added a comment - This also needs to be applied to branches/1.2.x, as it is related to OPENJPA-925 .
        Hide
        Donald Woods added a comment -

        adding missing Fix Version values

        Show
        Donald Woods added a comment - adding missing Fix Version values
        Hide
        Catalina Wei added a comment -

        fix checked in trunk r741994,
        1.3.x r741995

        Show
        Catalina Wei added a comment - fix checked in trunk r741994, 1.3.x r741995

          People

          • Assignee:
            Michael Dick
            Reporter:
            Catalina Wei
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development