Issue #1531: NullpointerException at a normal select

Type: Bug ReoprtVersion: 2.5.6Priority: NormalStatus: ActiveReplies: 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 {

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-] 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
com.objectdb.o.InternalException: java.lang.NullPointerException: null
at com.objectdb.o.ENT.C(
at com.objectdb.o.ENT.C(
at com.objectdb.o.STM.D(
at com.objectdb.o.OBM.close(
at se.tjanstelogik.contentsite.organization.OrganizationService.getCustomerByIdentifier(
at se.tjanstelogik.contentsite.ContentServiceFilter.doBeforeProcessing(
at se.tjanstelogik.contentsite.ContentServiceFilter.doFilter(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.__invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
at org.apache.catalina.core.StandardHostValve.__invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.valves.AccessLogValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.AbstractHttp11Processor.process(
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$

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


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