Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Version 2.4.2 M5 - The query contains a malformed ending(@NamedQuery, IN Clause, OK in 2.3.3, Fails withHermes Parser )
Version 2.4.2 M5 - The query contains a malformed ending [message #1007878] Thu, 07 February 2013 21:56 Go to next message
Michel Rainville is currently offline Michel RainvilleFriend
Messages: 5
Registered: February 2013
Junior Member
Is there any syntax change in 2.4.2? Does anyone see where the trouble might be in the named query below? This query and all related code works in EclipseLink 2.3.3. I get the same result on Oracle 11gR2 or 10gR2, with Java 6u39 and Eclipse indigo.

The trouble is likely in
"(       TRIM(FROM u.userStatus)    IN :userStatusList  )"

because there is an identical named query just before this one, but without this clause.

, @NamedQuery(  name = "LastFirstID.findLikeUsernameByStatus" 
                     		, query = "SELECT  l  FROM  LastFirstID l " 
                                     +" WHERE  l.IDNumber IN (SELECT DISTINCT u.IDNumber "
                                     +"                         FROM Username u "
                                     +"                        WHERE ( ( LOWER(TRIM(FROM u.loginID   )) LIKE :usernamePattern )   " 
                                     +"                          AND      (       TRIM(FROM u.userStatus)    IN :userStatusList  ) ) )" 
            	                     +" ORDER  BY FUNC('TRANSLATE_CHAR', LOWER( FUNC('NVL', l.lastName, ' ') )), "
           	                         +"           FUNC('TRANSLATE_CHAR', LOWER( FUNC('NVL', l.firstName,' ') ))  " /* Ignore diacritical marks and case when ordering the names list */ 
           	                )

Quote:
[java] INFO: EclipseLink, version: Eclipse Persistence Services - 2.4.2.v20130207-ca8d1b6
[java] Feb 7, 2013 4:19:59 PM org.eclipse.persistence.session.file:/C:/Documents and Settings/mrainv/My Documents/Eclipse Projects/icsworkspace_v1_00_EL242M5/StarFinder/dist/StarFinder_V1_00.jar_DMAIN.MCGILL.CA_user=dev_admin.connection
[java] INFO: file:/C:/Documents and Settings/mrainv/My Documents/Eclipse Projects/icsworkspace_v1_00_EL242M5/StarFinder/dist/StarFinder_V1_00.jar_DMAIN.MCGILL.CA_user=dev_admin logout successful
[java] Feb 7, 2013 4:19:59 PM org.eclipse.persistence.session.file:/C:/Documents and Settings/mrainv/My Documents/Eclipse Projects/icsworkspace_v1_00_EL242M5/StarFinder/dist/StarFinder_V1_00.jar_DMAIN.MCGILL.CA_user=dev_admin.ejb
[java] SEVERE:
[java] Local Exception Stack:
[java] Exception [EclipseLink-0] (Eclipse Persistence Services - 2.4.2.v20130207-ca8d1b6): org.eclipse.persistence.exceptions.JPQLException
[java] Exception Description: Syntax error parsing [SELECT l FROM LastFirstID l WHERE l.IDNumber IN (SELECT DISTINCT u.IDNumber FROM Username u WHERE ( ( LOWER(TRIM(FROM u.loginID )) LIKE :usernamePattern ) AND ( TRIM(FROM u.userStatus) IN :userStatusList ) ) ) ORDER BY FUNC('TRANSLATE_CHAR', LOWER( FUNC('NVL', l.lastName, ' ') )), FUNC('TRANSLATE_CHAR', LOWER( FUNC('NVL', l.firstName,' ') )) ].
[java] [201, 348] The query contains a malformed ending.
[java] at org.eclipse.persistence.internal.jpa.jpql.HermesParser.buildException(HermesParser.java:150)
[java] at org.eclipse.persistence.internal.jpa.jpql.HermesParser.validate(HermesParser.java:325)
[java] at org.eclipse.persistence.internal.jpa.jpql.HermesParser.populateQueryImp(HermesParser.java:270)
[java] at org.eclipse.persistence.internal.jpa.jpql.HermesParser.buildQuery(HermesParser.java:157)
[java] at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:138)
[java] at org.eclipse.persistence.internal.jpa.JPAQuery.processJPQLQuery(JPAQuery.java:108)
[java] at org.eclipse.persistence.internal.jpa.JPAQuery.prepare(JPAQuery.java:92)
[java] at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:614)
[java] at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:575)
[java] at org.eclipse.persistence.internal.sessions.AbstractSession.processJPAQueries(AbstractSession.java:2244)
[java] at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:540)
[java] at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:777)
[java] at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:722)
[java] at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:215)
[java] at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:551)
[java] at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:186)
[java] at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:278)
[java] at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:304)
[java] at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:282)
[java] at ca.mcgill.ncs.starfinder.StarFinder.connectDatabase(StarFinder.java:4308)
[java] at ca.mcgill.ncs.starfinder.StarFinder.<clinit>(StarFinder.java:339)
[java] Feb 7, 2013 4:20:10 PM ca.mcgill.ncs.starfinder.StarFinder logNote
[java] SEVERE: Exiting, could not connect; Java message was: Exception [EclipseLink-28019] (Eclipse Persistence Services - 2.4.2.v20130207-ca8d1b6): org.eclipse.persistence.exceptions.EntityManagerSetupException
[java] Exception Description: Deployment of PersistenceUnit [DMAIN.MCGILL.CA] failed. Close all factories for this PersistenceUnit.
[java] Internal Exception: Exception [EclipseLink-0] (Eclipse Persistence Services - 2.4.2.v20130207-ca8d1b6): org.eclipse.persistence.exceptions.JPQLException
[java] Exception Description: Syntax error parsing [SELECT l FROM LastFirstID l WHERE l.IDNumber IN (SELECT DISTINCT u.IDNumber FROM Username u WHERE ( ( LOWER(TRIM(FROM u.loginID )) LIKE :usernamePattern ) AND ( TRIM(FROM u.userStatus) IN :userStatusList ) ) ) ORDER BY FUNC('TRANSLATE_CHAR', LOWER( FUNC('NVL', l.lastName, ' ') )), FUNC('TRANSLATE_CHAR', LOWER( FUNC('NVL', l.firstName,' ') )) ].
[java] [201, 348] The query contains a malformed ending.
Re: Version 2.4.2 M5 - The query contains a malformed ending [message #1008231 is a reply to message #1007878] Mon, 11 February 2013 16:16 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1039
Registered: July 2009
Senior Member
Try using the latest 2.5 nightly builds, and if the problem still exists please file a bug. As a workaround, you can use the ANTLR parser which was used by default in prior releases by specifying the "eclipselink.jpql.parser" persistence property with a value of "org.eclipse.persistence.queries.ANTLRQueryBuilder".

Best Regards,
Chris
Previous Topic:Eclipse link multiple SQL web services operations
Next Topic:container managed transactions + shared cache eviction
Goto Forum:
  


Current Time: Thu Dec 18 14:27:04 GMT 2014

Powered by FUDForum. Page generated in 0.02437 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software