[jbosstools-issues] [JBoss JIRA] (JBIDE-12297) Infinite loop in JPA Validator with HQL syntax Query

Dmitry Geraskov (JIRA) jira-events at lists.jboss.org
Tue Aug 14 05:43:15 EDT 2012


    [ https://issues.jboss.org/browse/JBIDE-12297?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12711385#comment-12711385 ] 

Dmitry Geraskov edited comment on JBIDE-12297 at 8/14/12 5:41 AM:
------------------------------------------------------------------

This is Dali issue. Your project has Generic Platform, so our code is not involved. Please create the issue in [Dali Bugzilla|https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Dali%20JPA%20Tools]
                
      was (Author: dgeraskov):
    This is Dali issue. Your project has Generic Platform, so our code is not involved. Please create the issue in [Dali Bugzill|https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Dali%20JPA%20Tools]
                  
> Infinite loop in JPA Validator with HQL syntax Query
> ----------------------------------------------------
>
>                 Key: JBIDE-12297
>                 URL: https://issues.jboss.org/browse/JBIDE-12297
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: hibernate, UpStream
>    Affects Versions: 3.4.0.M1
>         Environment: eclipse-jee-juno released
> jboss-tools nightly build 3.4.0.v20120706-1104-H5102-M1
>            Reporter: Ian Carr
>            Assignee: Dmitry Geraskov
>             Fix For: 3.4.x
>
>
> Expect to get a warning about the (invalid) HQL syntax. Actually behaviour makes eclipse unresponsive.
> An Infinite loop in JPA AbstractExpression parse method when using hibernate syntax FromClause.
> wordParser contains the text: OUTER JOIN gr.client clnt WITH clnt.clientId = :clientId WHERE ro.ownerId = :ownerId
> Uses the hibernate WITH clause.
> Eclipse becomes unresponsive and has high CPU usage.
> breaking the running instance and checking paused threads get a loop around the following stack trace:
> Thread [Worker-3] (Suspended)	
> 	FromClause(AbstractExpression).parse(WordParser, String, boolean) line: 748	
> 	FromClause(AbstractFromClause).parse(WordParser, boolean) line: 191	
> 	SelectStatement(AbstractSelectStatement).parse(WordParser, boolean) line: 348	
> 	SelectStatement.parse(WordParser, boolean) line: 238	
> 	SelectStatementFactory.buildExpression(AbstractExpression, WordParser, String, JPQLQueryBNF, AbstractExpression, boolean) line: 55	
> 	JPQLExpression(AbstractExpression).parse(WordParser, String, ExpressionFactory, JPQLQueryBNF, AbstractExpression, boolean) line: 983	
> 	JPQLExpression(AbstractExpression).parseSingleExpression(WordParser, String, boolean) line: 1004	
> 	JPQLExpression.parse(WordParser, boolean) line: 307	
> 	JPQLExpression.<init>(CharSequence, JPQLGrammar, String, boolean) line: 129	
> 	JPQLExpression.<init>(CharSequence, JPQLGrammar, boolean) line: 91	
> 	DefaultJPQLQueryContext(JPQLQueryContext).initializeRoot() line: 700	
> 	DefaultJPQLQueryContext(JPQLQueryContext).setQuery(IQuery) line: 808	
> 	GenericJpaJpqlQueryHelper(AbstractJPQLQueryHelper).setQuery(IQuery) line: 435	
> 	GenericJpaJpqlQueryHelper(JpaJpqlQueryHelper).setQuery(NamedQuery, String) line: 223	
> 	GenericJpaJpqlQueryHelper(JpaJpqlQueryHelper).validate(NamedQuery, String, TextRange, int, List<IMessage>) line: 270	
> 	GenericJavaNamedQuery2_0.validateQuery_(JpaJpqlQueryHelper, List<IMessage>, IReporter) line: 112	
> 	GenericJavaNamedQuery2_0(AbstractJavaQuery<A>).validateQuery(JpaJpqlQueryHelper, List<IMessage>, IReporter, CompilationUnit) line: 226	
> 	GenericJavaNamedQuery2_0(AbstractJavaQuery<A>).validate(JpaJpqlQueryHelper, List<IMessage>, IReporter, CompilationUnit) line: 197	
> 	GenericPersistenceUnit(AbstractPersistenceUnit).validate(Query, JpaJpqlQueryHelper, List<IMessage>, IReporter) line: 2615	
> 	GenericPersistenceUnit(AbstractPersistenceUnit).validateQueries(List<IMessage>, IReporter) line: 2559	
> 	GenericPersistenceUnit(AbstractPersistenceUnit).validate(List<IMessage>, IReporter) line: 2249	
> 	GenericPersistence.validatePersistenceUnit(List<IMessage>, IReporter) line: 320	
> 	GenericPersistence.validate(List<IMessage>, IReporter) line: 272	
> 	GenericPersistenceXml.validate(List<IMessage>, IReporter) line: 281	
> 	GenericRootContextNode.validate(List<IMessage>, IReporter) line: 244	
> 	GenericJpaProject(AbstractJpaProject).validate(List<IMessage>, IReporter) line: 1491	
> 	GenericJpaProject(AbstractJpaProject).getValidationMessages(IReporter) line: 1481	
> 	InternalJpaProjectManager.buildValidationMessages_(IProject, IReporter) line: 553	
> 	InternalJpaProjectManager$BuildValidationMessagesCommand.execute() line: 542	
> 	CommandJobCommandAdapter.execute(IProgressMonitor) line: 39	
> 	JobCommandJob.run(IProgressMonitor) line: 42	
> 	Worker.run() line: 54	
> 	
> Class being parsed looks like:
> @Entity
> @Table(name="ResourceOwner")
> @NamedQueries({ 
> 	// NB: This is an HQL query as it uses the Hibernate conditional JOIN syntax ie WITH condition
> 	@NamedQuery(name = "FindResourceOwnerAndGrantsForROIdandClientId", 
> 			query = "SELECT ro,gr FROM ResourceOwner ro LEFT OUTER JOIN ro.grants gr LEFT OUTER JOIN gr.client clnt WITH clnt.clientId = :clientId WHERE ro.ownerId = :ownerId"), 
> 	@NamedQuery(name = "FindResourceOwnerAndGrantsForROIdandClientIdAndScopes", 
> 			query = "SELECT ro,gr FROM ResourceOwner ro LEFT OUTER JOIN ro.grants gr WITH gr.scopeId IN :scopes LEFT OUTER JOIN gr.client clnt WITH clnt.clientId = :clientId WHERE ro.ownerId = :ownerId"), 
> 	})
> public class ResourceOwner implements Serializable {
> 	...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list