Query Failed To Prepare Due To NPE Using Eclipselink 2.3.1 (Doc ID 2154047.1)

Last updated on AUGUST 02, 2016

Applies to:

Oracle TopLink - Version 11.1.1.6.0 to 12.1.1.0 [Release Oracle11g to 12c]
Information in this document applies to any platform.

Symptoms

Following exception is seen with EclipseLink when user load is high:

Exception [EclipseLink-6168] (Eclipse Persistence Services - 2.3.1.v20111018-r10243): org.eclipse.persistence.exceptions.QueryException
Exception Description: Query failed to prepare, unexpected error occurred: [java.lang.NullPointerException].
Internal Exception: java.lang.NullPointerException
Query: ReadAllQuery(name="DmDrug.findAvailableDrugsByItemCode" referenceClass=DmDrug sql="SELECT t0.ITEM_CODE, t0.BASE_UNIT, t0.CLINICAL_TRIAL, t0.COMMODITY_GROUP, t0.COMMODITY_TYPE, t0.DANGEROUS_DRUG, t0.DRUG_CATEGORY, t0.DRUG_KEY, t0.DRUG_NAME, t0.FORM_CODE, t0.HQ_SUSPEND, t0.HQ_SUSPEND_CODE, t0.HQ_SUSPEND_DATE, t0.ITEM_CREATE_DATE, t0.LEGAL_CLASS, t0.MOE_DATA_READY_DATE, t0.SAMPLE_ITEM, t0.SFI_ITEM, t0.STRENGTH, t0.THERA_GROUP, t0.UPDATE_DATE, t0.UPDATE_USER, t0.UPDATE_VERSION, t0.VOLUME_UNIT, t0.VOLUME_VALUE FROM DM_DRUG t0, MS_WORKSTORE_DRUG t1 WHERE (((((t0.ITEM_CODE = ?) AND (t0.ITEM_CODE = t1.ITEM_CODE)) AND (t1.DISP_HOSP_CODE = ?)) AND (t1.DISP_WORKSTORE = ?)) AND (t1.ITEM_STATUS = ?))")
  at org.eclipse.persistence.exceptions.QueryException.prepareFailed(QueryException.java:1555)
  at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:625)
  at org.eclipse.persistence.queries.ObjectLevelReadQuery.checkPrepare(ObjectLevelReadQuery.java:823)
  at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:575)
  at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:812)
  at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1040)
  at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:392)
  at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1128)
  at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2871)
  at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1516)
  at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1498)
  at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1463)
  at org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:485)
  at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultList(EJBQueryImpl.java:742)
  at ab.org.cd.model.pms.dms.biz.DrugMasterManagerBean.getDrugDiluent(DrugMasterManagerBean.java:698)
  at ab.org.cd.model.pms.dms.biz.DrugMasterManagerBean.isDrugNoDiluentRequired(DrugMasterManagerBean.java:673)
::::::::::::::
Caused by: java.lang.NullPointerException
 at org.eclipse.persistence.internal.expressions.DataExpression.copyCollection(DataExpression.java:132)
 at org.eclipse.persistence.internal.expressions.ObjectExpression.postCopyIn(ObjectExpression.java:470)
 at org.eclipse.persistence.expressions.Expression.registerIn(Expression.java:3597)
 at org.eclipse.persistence.expressions.ExpressionBuilder.registerIn(ExpressionBuilder.java:350)
 at org.eclipse.persistence.expressions.Expression.copiedVersionFrom(Expression.java:966)
 at org.eclipse.persistence.internal.expressions.BaseExpression.postCopyIn(BaseExpression.java:63)
 at org.eclipse.persistence.internal.expressions.DataExpression.postCopyIn(DataExpression.java:350)
 at org.eclipse.persistence.internal.expressions.ObjectExpression.postCopyIn(ObjectExpression.java:469)
 at org.eclipse.persistence.internal.expressions.QueryKeyExpression.postCopyIn(QueryKeyExpression.java:245)
 at org.eclipse.persistence.expressions.Expression.registerIn(Expression.java:3597)
 at org.eclipse.persistence.expressions.Expression.copiedVersionFrom(Expression.java:966)
 at org.eclipse.persistence.internal.expressions.CompoundExpression.postCopyIn(CompoundExpression.java:263)
 at org.eclipse.persistence.expressions.Expression.registerIn(Expression.java:3597)
 at org.eclipse.persistence.expressions.Expression.copiedVersionFrom(Expression.java:966)
 at org.eclipse.persistence.internal.expressions.CompoundExpression.postCopyIn(CompoundExpression.java:263)
 at org.eclipse.persistence.expressions.Expression.registerIn(Expression.java:3597)
 at org.eclipse.persistence.expressions.Expression.copiedVersionFrom(Expression.java:966)
 at org.eclipse.persistence.internal.expressions.CompoundExpression.postCopyIn(CompoundExpression.java:263)
 at org.eclipse.persistence.expressions.Expression.registerIn(Expression.java:3597)
 at org.eclipse.persistence.expressions.Expression.copiedVersionFrom(Expression.java:966)
 at org.eclipse.persistence.internal.expressions.CompoundExpression.postCopyIn(CompoundExpression.java:263)
 at org.eclipse.persistence.expressions.Expression.registerIn(Expression.java:3597)
 at org.eclipse.persistence.expressions.Expression.copiedVersionFrom(Expression.java:966)
 at org.eclipse.persistence.internal.expressions.CompoundExpression.postCopyIn(CompoundExpression.java:263)
 at org.eclipse.persistence.expressions.Expression.registerIn(Expression.java:3597)
 at org.eclipse.persistence.expressions.Expression.copiedVersionFrom(Expression.java:966)
 at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.buildBaseSelectionCriteria(ExpressionQueryMechanism.java:133)
 at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.buildBaseSelectStatement(ExpressionQueryMechanism.java:198)
 at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.buildBaseSelectStatement(ExpressionQueryMechanism.java:185)
 at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.buildNormalSelectStatement(ExpressionQueryMechanism.java:501)
 at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.prepareSelectAllRows(ExpressionQueryMechanism.java:1616)
 at org.eclipse.persistence.queries.ReadAllQuery.prepareSelectAllRows(ReadAllQuery.java:707)
 at org.eclipse.persistence.queries.ReadAllQuery.prepare(ReadAllQuery.java:644)
 at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:613)
 ... 156 more



Analysis
It is a multi-threaded application.


Environment
Eclipse Persistence Services - 2.3.1.v20111018-r10243
TopLink 11.1.1.6.0
Linux x86-64 RHEL 5
WebLogic 10.3.6

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms