InternalError on multiple AND and JOIN Query

#1

Hi,

Using objectdb 2.2.8_06. Running the following query:

SELECT DISTINCT $1 FROM CDI $1 JOIN $1.contactDetails $2 JOIN $2.addresses $3 JOIN $3.attributeList $4 JOIN $2.phoneNumbers $5 JOIN $5.attributeList $6 WHERE ((($4.name='suburb') AND ($4.valueAsString='Los Angeles')) AND (($6.name='areacode') AND ($6.valueAsString='310')))

Getting:

[ObjectDB 2.2.8_06] Unexpected exception (Error 990)
  Generated by Java HotSpot(TM) 64-Bit Server VM 1.6.0_20 (on Linux 2.6.38-10-generic).
Please report this error on http://www.objectdb.com/database/issue/new
com.objectdb.o.InternalException: java.lang.NullPointerException: null
java.lang.NullPointerException
at com.objectdb.o.SQI.Uo(SQI.java:168)
at com.objectdb.o.RQI$h._j(RQI.java:316)
at com.objectdb.o.RQI.Uo(RQI.java:202)
at com.objectdb.o.MQI.Uo(MQI.java:161)
at com.objectdb.o.FQI.Uo(FQI.java:113)
at com.objectdb.o.GQI.Uo(GQI.java:221)
at com.objectdb.o.PRG.ao(PRG.java:1110)
at com.objectdb.o.PRG.ab(PRG.java:640)
at com.objectdb.o.QRM.US(QRM.java:259)
at com.objectdb.o.MST.US(MST.java:884)
at com.objectdb.o.WRA.US(WRA.java:286)
at com.objectdb.o.WSM.US(WSM.java:113)
at com.objectdb.o.QRR.g(QRR.java:225)
at com.objectdb.o.QRR.b(QRR.java:144)
at com.objectdb.jpa.JpaQuery.getResultList(JpaQuery.java:627)
at com.contextspace.ExampleTest.queryAttribute13(ExampleTest.java:461)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

 

I have attached a sample project demonstrating this exception. Please see unit test queryAttribute13.

Thanks

#2

I ran the test and couldn't get this exception.

Maybe you are running it on a different database?

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#3

Please check the Pom in the version of test I gave you. I have now run it with 2.28_07 and get the same behaviour. Here is the dump from 'mvn eclipse:eclipse':

 

List of artifacts without a source archive:
         o ch.qos.logback:logback-classic:0.9.28
         o ch.qos.logback:logback-core:0.9.28
         o org.slf4j:slf4j-api:1.6.1
         o com.googlecode.genericdao:dao:1.0.0
         o com.googlecode.genericdao:search:1.0.0
         o com.h2database:h2:1.3.155
         o com.objectdb:objectdb:2.2.8_07
         o junit:junit:4.8.2
         o org.apache.openjpa:openjpa:2.1.0
         o commons-lang:commons-lang:2.4
         o commons-collections:commons-collections:3.2.1
         o net.sourceforge.serp:serp:1.13.1
         o org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1.1
         o org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1.1
         o commons-pool:commons-pool:1.5.4
         o org.apache.geronimo.specs:geronimo-jpa_2.0_spec:1.1
         o org.easymock:easymock:3.0
         o cglib:cglib-nodep:2.2
         o org.objenesis:objenesis:1.2
         o org.springframework:spring-beans:3.0.5.RELEASE
         o org.springframework:spring-core:3.0.5.RELEASE
         o org.springframework:spring-asm:3.0.5.RELEASE
         o commons-logging:commons-logging:1.1.1
         o org.springframework:spring-context:3.0.5.RELEASE
         o org.springframework:spring-aop:3.0.5.RELEASE
         o aopalliance:aopalliance:1.0
         o org.springframework:spring-expression:3.0.5.RELEASE
         o org.springframework:spring-orm:3.0.5.RELEASE
         o org.springframework:spring-jdbc:3.0.5.RELEASE
         o org.springframework:spring-tx:3.0.5.RELEASE

Definitely using 2.28_07. Here is the output from 'mvn clean package':

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Example Objectdb test
[INFO]    task-segment: [clean, package]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting directory /home/pedwards/CONTEXTSPACE_workarea/objectdb_example/target
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] [compiler:compile {execution: default-compile}]
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 9 source files to /home/pedwards/CONTEXTSPACE_workarea/objectdb_example/target/classes
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] [compiler:testCompile {execution: default-testCompile}]
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /home/pedwards/CONTEXTSPACE_workarea/objectdb_example/target/test-classes
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: /home/pedwards/CONTEXTSPACE_workarea/objectdb_example/target/surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.contextspace.ExampleTest
09:30:08,686 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
09:30:08,687 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
09:30:08,687 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/home/pedwards/CONTEXTSPACE_workarea/objectdb_example/target/test-classes/logback.xml]
09:30:08,827 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
09:30:08,828 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
09:30:08,832 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [TIMEBASED_ROLLING_APPENDER]
09:30:08,854 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@10:25 - no applicable action for [ImmediateFlush], current pattern is [[configuration][appender][ImmediateFlush]]
09:30:08,878 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - No compression will be used
09:30:08,880 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern time_example-%d{yyyy-MM-dd}.log for the active file
09:30:08,884 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyy-MM-dd' from file name pattern 'time_example-%d{yyyy-MM-dd}.log'.
09:30:08,884 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight.
09:30:08,889 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Mon Jul 25 09:29:29 EST 2011
09:30:08,907 |-WARN in ch.qos.logback.core.rolling.RollingFileAppender[TIMEBASED_ROLLING_APPENDER] - This appender no longer admits a layout as a sub-component, set an encoder instead.
09:30:08,907 |-WARN in ch.qos.logback.core.rolling.RollingFileAppender[TIMEBASED_ROLLING_APPENDER] - To ensure compatibility, wrapping your layout in LayoutWrappingEncoder.
09:30:08,907 |-WARN in ch.qos.logback.core.rolling.RollingFileAppender[TIMEBASED_ROLLING_APPENDER] - See also http://logback.qos.ch/codes.html#layoutInsteadOfEncoder for details
09:30:08,908 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[TIMEBASED_ROLLING_APPENDER] - Active log file name: time_example.log
09:30:08,908 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[TIMEBASED_ROLLING_APPENDER] - File property is set to [time_example.log]
09:30:08,909 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
09:30:08,909 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [SIZE_BASED_ROLLING_APPENDER]
09:30:08,912 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@224c47db - No compression will be used
09:30:08,924 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[SIZE_BASED_ROLLING_APPENDER] - Active log file name: size_example.log
09:30:08,924 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[SIZE_BASED_ROLLING_APPENDER] - File property is set to [size_example.log]
09:30:08,924 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
09:30:08,926 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
09:30:08,928 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - This appender no longer admits a layout as a sub-component, set an encoder instead.
09:30:08,928 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - To ensure compatibility, wrapping your layout in LayoutWrappingEncoder.
09:30:08,928 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - See also http://logback.qos.ch/codes.html#layoutInsteadOfEncoder for details
09:30:08,928 |-INFO in ch.qos.logback.classic.joran.action.LevelAction - com.contextspace level set to DEBUG
09:30:08,928 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[com.contextspace]
09:30:08,930 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [SIZE_BASED_ROLLING_APPENDER] to Logger[com.contextspace]
09:30:08,930 |-INFO in ch.qos.logback.classic.joran.action.LevelAction - org.springframework level set to OFF
09:30:08,930 |-INFO in ch.qos.logback.classic.joran.action.LevelAction - ROOT level set to ERROR
09:30:08,930 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
09:30:08,930 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [SIZE_BASED_ROLLING_APPENDER] to Logger[ROOT]


<<TRIMMED DEBUG OUTPUT>>>


Tests run: 14, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.35 sec <<< FAILURE!

Results :

Failed tests:
  queryAttribute13(com.contextspace.ExampleTest)

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

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.

Please refer to /home/pedwards/CONTEXTSPACE_workarea/objectdb_example/target/surefire-reports for the individual test results.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7 seconds
[INFO] Finished at: Mon Jul 25 09:30:09 EST 2011
[INFO] Final Memory: 39M/351M
[INFO] ------------------------------------------------------------------------

 

 

#4

Ignore that. I get a NullPointer exception with 2.2.8_06. With 2.2.8_07 the error was due to data. So something was changed and it works happily in 2.2.8_07.


Post Reply

To post a reply and/or subscribe to update notifications - please login