OpenJPA
  1. OpenJPA
  2. OPENJPA-1293

JUnit test failure when using Derby 10.5.3.0

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M3
    • Fix Version/s: 2.0.0-beta
    • Component/s: third-party
    • Labels:
      None

      Description

      Only hit one test failure in o-p-j when using Derby 10.5.3.0 -

      Tests run: 15, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 9.901 sec <<< FAILURE!
      testVariableHaving(org.apache.openjpa.persistence.jdbc.query.TestJDBCGrouping) Time elapsed: 0.246 sec <<< ERROR!
      <openjpa-2.0.0-SNAPSHOT-r422266:813659M nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Java exception: ': java.lang.NullPointerException'.

      {SELECT MAX(t0.longField), t2.byteField FROM AllFieldTypes t0 INNER JOIN AllFieldTypes_AllFieldTypes t1 ON t0.id = t1.ALLFIELDTYPES_ID JOIN AllFieldTypes t2 ON (1 = 1) WHERE (t1.SELFONEMANY_ID = t2.id) GROUP BY t2.byteField HAVING SUM(t2.intField) = ?} [code=0, state=XJ001]
      at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4587)
      at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4540)
      at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
      at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
      at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
      at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.handleCheckedException(SelectResultObjectProvider.java:155)
      at org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.handleCheckedException(QueryImpl.java:2068)
      at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:40)
      at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1239)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1000)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:856)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:787)
      at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:525)
      at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:291)
      at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:303)
      at org.apache.openjpa.persistence.QueryImpl.getSingleResult(QueryImpl.java:322)
      at org.apache.openjpa.persistence.query.GroupingTestCase.testVariableHaving(GroupingTestCase.java:294)
      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:597)
      at junit.framework.TestCase.runTest(TestCase.java:154)
      at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.runTest(AbstractPersistenceTestCase.java:514)
      at junit.framework.TestCase.runBare(TestCase.java:127)
      at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.runBare(AbstractPersistenceTestCase.java:501)
      at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.runBare(AbstractPersistenceTestCase.java:477)
      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.AbstractPersistenceTestCase.run(AbstractPersistenceTestCase.java:177)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      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:597)
      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:597)
      at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
      at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
      Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Java exception: ': java.lang.NullPointerException'. {SELECT MAX(t0.longField), t2.byteField FROM AllFieldTypes t0 INNER JOIN AllFieldTypes_AllFieldTypes t1 ON t0.id = t1.ALLFIELDTYPES_ID JOIN AllFieldTypes t2 ON (1 = 1) WHERE (t1.SELFONEMANY_ID = t2.id) GROUP BY t2.byteField HAVING SUM(t2.intField) = ?}

      [code=0, state=XJ001]
      at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:248)
      at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$000(LoggingConnectionDecorator.java:70)
      at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection.prepareStatement(LoggingConnectionDecorator.java:282)
      at org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:187)
      at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator$ConfiguringConnection.prepareStatement(ConfiguringConnectionDecorator.java:155)
      at org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:187)
      at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$RefCountConnection.prepareStatement(JDBCStoreManager.java:1537)
      at org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:176)
      at org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:544)
      at org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:524)
      at org.apache.openjpa.jdbc.sql.SelectImpl.prepareStatement(SelectImpl.java:450)
      at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:391)
      at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:363)
      at org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:427)
      at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:230)
      at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:220)
      at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:94)
      at org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.open(QueryImpl.java:2027)
      at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:34)
      ... 39 more
      NestedThrowables:
      java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
      at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
      at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
      at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2204)
      at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:147)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(EmbedPreparedStatement20.java:82)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(EmbedPreparedStatement30.java:63)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(EmbedPreparedStatement40.java:40)
      at org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Driver40.java:105)
      at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java:1542)
      at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java:1395)
      at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:262)
      at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:307)
      at org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:189)
      at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection.prepareStatement(LoggingConnectionDecorator.java:279)
      at org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:187)
      at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator$ConfiguringConnection.prepareStatement(ConfiguringConnectionDecorator.java:155)
      at org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:187)
      at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$RefCountConnection.prepareStatement(JDBCStoreManager.java:1537)
      at org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:176)
      at org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:544)
      at org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:524)
      at org.apache.openjpa.jdbc.sql.SelectImpl.prepareStatement(SelectImpl.java:450)
      at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:391)
      at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:363)
      at org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:427)
      at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:230)
      at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:220)
      at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:94)
      at org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.open(QueryImpl.java:2027)
      at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:34)
      at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1239)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1000)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:856)
      at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:787)
      at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:525)
      at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:291)
      at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:303)
      at org.apache.openjpa.persistence.QueryImpl.getSingleResult(QueryImpl.java:322)
      at org.apache.openjpa.persistence.query.GroupingTestCase.testVariableHaving(GroupingTestCase.java:294)
      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:597)
      at junit.framework.TestCase.runTest(TestCase.java:154)
      at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.runTest(AbstractPersistenceTestCase.java:514)
      at junit.framework.TestCase.runBare(TestCase.java:127)
      at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.runBare(AbstractPersistenceTestCase.java:501)
      at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.runBare(AbstractPersistenceTestCase.java:477)
      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.AbstractPersistenceTestCase.run(AbstractPersistenceTestCase.java:177)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      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:597)
      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:597)
      at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
      at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
      Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
      ... 72 more
      Caused by: java.lang.NullPointerException
      at org.apache.derby.impl.sql.compile.ColumnReference.remapColumnReferencesToExpressions(ColumnReference.java:851)
      at org.apache.derby.impl.sql.compile.AggregateNode.getNewExpressionResultColumn(AggregateNode.java:560)
      at org.apache.derby.impl.sql.compile.GroupByNode.addAggregateColumns(GroupByNode.java:708)
      at org.apache.derby.impl.sql.compile.GroupByNode.addNewColumnsForAggregation(GroupByNode.java:553)
      at org.apache.derby.impl.sql.compile.GroupByNode.addAggregates(GroupByNode.java:240)
      at org.apache.derby.impl.sql.compile.GroupByNode.init(GroupByNode.java:184)
      at org.apache.derby.iapi.sql.compile.NodeFactory.getNode(NodeFactory.java:273)
      at org.apache.derby.impl.sql.compile.SelectNode.genProjectRestrict(SelectNode.java:1305)
      at org.apache.derby.impl.sql.compile.SelectNode.modifyAccessPaths(SelectNode.java:1974)
      at org.apache.derby.impl.sql.compile.DMLStatementNode.optimizeStatement(DMLStatementNode.java:323)
      at org.apache.derby.impl.sql.compile.CursorNode.optimizeStatement(CursorNode.java:556)
      at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:367)
      at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:88)
      at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:802)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:129)
      ... 65 more

      Results :

      Tests in error:
      testVariableHaving(org.apache.openjpa.persistence.jdbc.query.TestJDBCGrouping)

      Tests run: 15, Failures: 0, Errors: 1, Skipped: 0

        Issue Links

          Activity

            People

            • Assignee:
              Donald Woods
              Reporter:
              Donald Woods
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development