Issue #1531: NullpointerException at a normal select

Type: Bug ReoprtVersion: 2.5.6Priority: NormalStatus: ActiveReplies: 1
#1

When I run the following code:

EntityManager em = getEm();
Customer result = null;
try {
    logger.debug("Ident: "+ident);
    result = em.createQuery("Select c from Customer c where c.identifier=:id", Customer.class).setParameter("id", ident).getSingleResult();
} catch (javax.persistence.NoResultException nre) {
} finally {
     em.close();
}

I get the following error (you can also see the log message containing the String parameter at the top):

09:08:49.496 [http-bio-0.0.0.0-8080-exec-9] DEBUG s.t.c.o.OrganizationService - Ident: default
Oct 14, 2014 9:08:49 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [se.tjanstelogik.contentsite.SiteHtmlServlet] in context with path [/ContentSite] threw exception
[ObjectDB 2.5.6_02] Unexpected exception (Error 990)
  Generated by Java HotSpot(TM) 64-Bit Server VM 1.8.0 (on Mac OS X 10.9.5).
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.ENT.C(ENT.java:437)
at com.objectdb.o.ENT.C(ENT.java:378)
at com.objectdb.o.STA.ae(STA.java:819)
at com.objectdb.o.STM.D(STM.java:371)
at com.objectdb.o.OBC.ag(OBC.java:198)
at com.objectdb.o.OBM.close(OBM.java:196)
at se.tjanstelogik.contentsite.organization.OrganizationService.getCustomerByIdentifier(OrganizationService.java:154)
at se.tjanstelogik.contentsite.ContentServiceFilter.doBeforeProcessing(ContentServiceFilter.java:66)
at se.tjanstelogik.contentsite.ContentServiceFilter.doFilter(ContentServiceFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:123)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.__invoke(StandardHostValve.java:171)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:744)

Running the same query in the explorer generates no errors. I've attached a screenshot with the result of the same query (as you can see from the log/stacktrace, the query parameter is 'default').

This have been working for quite some time, I've also tried to run the DB doctor with the following result:

heintz@heintzmbp /usr/local/objectdb-2.5.6_02/bin> java -cp objectdb.jar com.objectdb.Doctor ../db/my_database_file.odb
ObjectDB Doctor [version 2.5.6_02]
Copyright (c) 2014, ObjectDB Software. All rights reserved.

Scanning the database file...
0MB (total)

Analyzing database structure...
10% 20% 30% 40% 50% 60% 70% 80% 90% 100%

-------------------------

No errors have been found
-------------------------

Client version: 2.5.6_02

Server version: 2.5.6_02

#2

The cause of this exception is unclear. The stack trace indicates an unexpected state of one of your persistable types, and if the same code worked well before, it could be the result of a recent schema evolution.

Particularly if you changed an entity class to non entity class, etc. it could be related.

Build 2.5.7_03 includes an attempt to provide a workaround to the specific exception in your stack trace. Please try it. With this new build you may have a similar exception in another place, so please keep reporting.

ObjectDB Support

Reply