Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 357946

Summary: JPA validation stop working with invalid query statement
Product: [WebTools] Dali JPA Tools Reporter: Nan Li <nan.n.li>
Component: JPAAssignee: Neil Hauge <neil.hauge>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: karenfbutzke
Version: unspecified   
Target Milestone: 3.1 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard: wtp4x
Attachments:
Description Flags
stack trace none

Description Nan Li CLA 2011-09-16 10:10:25 EDT
Build Identifier: Version: 4.1.0 Build id: I20110805-1200

When creating a "named query" with invalid query statement, JPA validation will stop working with exceptions:

Exception 1: 
JPA Validator finished validating: file...

Exception 2:
java.lang.NullPointerException
	at org.eclipse.jpt.jpa.core.internal.jpql.JpaJpqlQueryHelper.buildProblem(JpaJpqlQueryHelper.java:135)
	at org.eclipse.jpt.jpa.core.internal.jpql.JpaJpqlQueryHelper.validate(JpaJpqlQueryHelper.java:232)
	at org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaNamedQuery2_0.validateQuery_(GenericJavaNamedQuery2_0.java:101)
	at org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaQuery.validateQuery(AbstractJavaQuery.java:221)

Full stack trace is attached. 

Reproducible: Always

Steps to Reproduce:
1. Create a named query for an entity
2. Go to JPA Details -> Queries and add a named query
3. Input query statement like "blabla" and save it
Comment 1 Nan Li CLA 2011-09-16 10:11:47 EDT
Created attachment 203488 [details]
stack trace
Comment 2 Neil Hauge CLA 2011-09-20 23:37:29 EDT
I am able to reproduce on 4.2 base.  I cannot reproduce on 3.8.
Comment 3 Karen Butzke CLA 2011-09-21 09:31:53 EDT
The fix for this is the same as bug 357948, so I am marking it as a duplicate.

*** This bug has been marked as a duplicate of bug 357948 ***