EclipseLink Issue In WLS 12c JPQL Query Compilation Issue: Can't Be Resolved To A Valid Type (Doc ID 2062194.1)

Last updated on MARCH 07, 2017

Applies to:

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

Symptoms

After migrating an EclipseLink application from 10.3.6 to 12.1.3, the following exceptions were seen:

an exception occurred while executing method
javax.persistence.PersistenceException: Exception [EclipseLink-28013] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Unable to deploy PersistenceUnit [ServiceProcessorUP] in invalid state [DeployFailed].
Internal Exception: javax.persistence.PersistenceException: Exception [EclipseLink-28019] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Deployment of PersistenceUnit [ServiceProcessorUP] failed. Close all factories for this PersistenceUnit.
Internal Exception: Exception [EclipseLink-0] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Problem compiling [SELECT registry FROM ServiceRegistry AS registry WHERE registry.iccid = :iccid AND registry.activation = FALSE AND ( registry.state =:state1 OR registry.state =:state2) ORDER BY registry.useCaseId, registry.submissionDate, registry.id;].
[224, 236] The state field path 'registry.id;' cannot be resolved to a valid type.

The same code was running without issues on 10.3.6 (EclipseLink 2.3.1).

The field is in the ServiceRegistry entity class is defined like this:
  @Id
  @SequenceGenerator(name = "mySequence", sequenceName = "SEQ_ID", initialValue = 1, allocationSize = 50)
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "mySequence")
  @Column(name = "N_ID")
  protected Long id;

Exception stack
--------------------
Caused by: Exception [EclipseLink-0] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Problem compiling [SELECT registry FROM ServiceRegistry AS registry WHERE registry.iccid = :iccid AND registry.activation = FALSE AND ( registry.state =:state1 OR registry.state =:state2) ORDER BY registry.useCaseId, registry.submissionDate, registry.id;].
[224, 236] The state field path 'registry.id;' cannot be resolved to a valid type.
at org.eclipse.persistence.internal.jpa.jpql.HermesParser.buildException(HermesParser.java:155)
at org.eclipse.persistence.internal.jpa.jpql.HermesParser.validate(HermesParser.java:347)
at org.eclipse.persistence.internal.jpa.jpql.HermesParser.populateQueryImp(HermesParser.java:278)
at org.eclipse.persistence.internal.jpa.jpql.HermesParser.buildQuery(HermesParser.java:163)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:142)
at org.eclipse.persistence.internal.jpa.JPAQuery.processJPQLQuery(JPAQuery.java:221)
at org.eclipse.persistence.internal.jpa.JPAQuery.prepare(JPAQuery.java:182)
at org.eclipse.persistence.queries.DatabaseQuery.prepareInternal(DatabaseQuery.java:621)
at org.eclipse.persistence.internal.sessions.AbstractSession.processJPAQuery(AbstractSession.java:4309)
at org.eclipse.persistence.internal.sessions.AbstractSession.processJPAQueries(AbstractSession.java:4270)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:579)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:799)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.login(DatabaseSessionImpl.java:756)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:241)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:685)
... 148 more



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