Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357948 - Null text range for message ID: QUERY_STATEMENT_UNDEFINED
Summary: Null text range for message ID: QUERY_STATEMENT_UNDEFINED
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.1 M2   Edit
Assignee: Karen Butzke CLA
QA Contact:
URL:
Whiteboard: wtp4x
Keywords:
: 357946 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-16 10:31 EDT by Nan Li CLA
Modified: 2011-10-06 12:48 EDT (History)
2 users (show)

See Also:


Attachments
stack trace (3.22 KB, text/plain)
2011-09-16 10:33 EDT, Nan Li CLA
no flags Details
sample project (3.78 KB, application/octet-stream)
2011-09-20 11:37 EDT, Nan Li CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nan Li CLA 2011-09-16 10:31:21 EDT
Build Identifier: Version: 4.1.0 Build id: I20110805-1200

When defining a query without specify query statement, an NPE will be throw complaining null text range like:

java.lang.NullPointerException: Null text range for message ID: QUERY_STATEMENT_UNDEFINED
	at org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages.buildMessage(DefaultJpaValidationMessages.java:52)
	at org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaQuery.validateQuery(AbstractJavaQuery.java:212)
	at org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaQuery.validate(AbstractJavaQuery.java:192)

Full stack trace is attached. Similar problem was found with validating generator name and EclipseLink converter name.


Reproducible: Always
Comment 1 Nan Li CLA 2011-09-16 10:33:19 EDT
Created attachment 203489 [details]
stack trace
Comment 2 Karen Butzke CLA 2011-09-19 08:26:12 EDT
Just to clarify, this is specific to eclipse platform 4.1/4.2? I can't reproduce with eclipse platform 3.7
Comment 3 Nan Li CLA 2011-09-19 09:02:41 EDT
Yes, I got this with Eclipse platform 4.1. I remember I didn't reproduce this problem with 3.7, but I launched both builds directly instead of targeting to them.
Comment 4 Nan Li CLA 2011-09-19 10:27:13 EDT
OK. I tried with launching Eclipse through target platforms. This problem only exists on 4.1.
Comment 5 Karen Butzke CLA 2011-09-20 11:03:14 EDT
Nan, I can't seem to reproduce this one, could you attach an example project that shows this error?
Comment 6 Nan Li CLA 2011-09-20 11:37:48 EDT
Created attachment 203696 [details]
sample project

Karen, I attach a sample project with which I can reproduce the problem. It's pretty simple. There are few things: 1) You need to target to 4.x platform. 2) you need to create a query without query statement through UI, not through directly typing in the editor. 3) The exception occurs once you save the file.4) This problem seems only appearing for Java. Let me know if you still cannot reproduce it. Thanks!
Comment 7 Karen Butzke CLA 2011-09-21 08:59:00 EDT
The thing I wasn't doing was adding the query through the JPA details view. I had no idea that would lead to different results, but now I can reproduce the issue. thanks!
Comment 8 Karen Butzke CLA 2011-09-21 09:31:53 EDT
*** Bug 357946 has been marked as a duplicate of this bug. ***
Comment 9 Karen Butzke CLA 2011-09-21 10:23:51 EDT
fixed for M2
Comment 10 Jolene Moffitt CLA 2011-10-06 12:48:04 EDT
Verified in Build I-3.4.0-20110922230524 

Verified you can add a query without a statement and save without errors. See
the link to view test steps for verification. http://wiki.eclipse.org/Dali_3.1_M2