4 Replies Latest reply on May 5, 2006 11:39 AM by eruiz

    Error parsing queries with jBPM 3.1

    polarbaerhh

      Hi,

      I recently changed from jBPM 3.0.2 to jBPM 3.1. When hibernate configures its SessionFactory, the following errors occur:

      2006-02-15 11:57:01,239 [main] ERROR org.hibernate.hql.PARSER (35) - *** ERROR: line 3:43: expecting "set", found 't'
      2006-02-15 11:57:04,036 [main] ERROR org.hibernate.hql.PARSER (35) - *** ERROR: line 3:43: expecting "set", found 't'
      2006-02-15 11:57:04,192 [main] ERROR org.hibernate.hql.PARSER (35) - *** ERROR: line 3:48: unexpected token: t
      2006-02-15 11:57:04,286 [main] ERROR org.hibernate.impl.SessionFactoryImpl (300) - Error in named query: SchedulerSession.deleteTimersForProcessInstance
      org.hibernate.hql.ast.QuerySyntaxError: unexpected token: t near line 3, column 48 [

      delete from org.jbpm.scheduler.exe.Timer t
      where t.processInstance = :processInstance

      ]
      at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:63)
      at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:215)
      at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:127)
      at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
      at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:427)
      at org.hibernate.impl.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:388)
      at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:291)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
      at de.innuce.database.toolbox.DBToolBox.GenerateAlterScript(DBToolBox.java:159)
      at de.innuce.database.toolbox.DBToolBox.GenerateAlterScriptForPostGres(DBToolBox.java:121)
      at de.innuce.database.GenerateAllUpdateScripts.main(GenerateAllUpdateScripts.java:36)
      Caused by: line 3:48: unexpected token: t
      at org.hibernate.hql.antlr.HqlBaseParser.deleteStatement(HqlBaseParser.java:242)
      at org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:139)
      at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:209)
      ... 9 more
      2006-02-15 11:57:04,302 [main] ERROR org.hibernate.impl.SessionFactoryImpl (300) - Error in named query: SchedulerSession.suspendTimersForToken
      org.hibernate.hql.ast.QuerySyntaxError: expecting "set", found 't' near line 3, column 43 [

      update org.jbpm.scheduler.exe.Timer t
      set t.isSuspended = true
      where t.token = :token

      ]
      at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:63)
      at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:215)
      at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:127)
      at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
      at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:427)
      at org.hibernate.impl.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:388)
      at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:291)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
      at de.innuce.database.toolbox.DBToolBox.GenerateAlterScript(DBToolBox.java:159)
      at de.innuce.database.toolbox.DBToolBox.GenerateAlterScriptForPostGres(DBToolBox.java:121)
      at de.innuce.database.GenerateAllUpdateScripts.main(GenerateAllUpdateScripts.java:36)
      Caused by: line 3:43: expecting "set", found 't'
      at antlr.Parser.match(Parser.java:211)
      at org.hibernate.hql.antlr.HqlBaseParser.setClause(HqlBaseParser.java:337)
      at org.hibernate.hql.antlr.HqlBaseParser.updateStatement(HqlBaseParser.java:183)
      at org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:133)
      at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:209)
      ... 9 more
      2006-02-15 11:57:04,317 [main] ERROR org.hibernate.impl.SessionFactoryImpl (300) - Error in named query: SchedulerSession.resumeTimersForToken
      org.hibernate.hql.ast.QuerySyntaxError: expecting "set", found 't' near line 3, column 43 [

      update org.jbpm.scheduler.exe.Timer t
      set t.isSuspended = false
      where t.token = :token

      ]
      at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:63)
      at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:215)
      at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:127)
      at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
      at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:427)
      at org.hibernate.impl.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:388)
      at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:291)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
      at de.innuce.database.toolbox.DBToolBox.GenerateAlterScript(DBToolBox.java:159)
      at de.innuce.database.toolbox.DBToolBox.GenerateAlterScriptForPostGres(DBToolBox.java:121)
      at de.innuce.database.GenerateAllUpdateScripts.main(GenerateAllUpdateScripts.java:36)
      Caused by: line 3:43: expecting "set", found 't'
      at antlr.Parser.match(Parser.java:211)
      at org.hibernate.hql.antlr.HqlBaseParser.setClause(HqlBaseParser.java:337)
      at org.hibernate.hql.antlr.HqlBaseParser.updateStatement(HqlBaseParser.java:183)
      at org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:133)
      at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:209)
      ... 9 more

      Any hints where I can start searching? Changed the antlr-2.7.5.jar to the one deliveres. I am using Hibernate 3.0.5.

      Thanks for any help.

      Marcus

        • 1. Re: Error parsing queries with jBPM 3.1
          bpoweski

          I ran into a similar problem, which database are you using?

          This happened to me when I had mistakenly forgot to configure the hibernate dialect to MySQL when I upgraded.

          • 2. Re: Error parsing queries with jBPM 3.1
            camunda

            The problem seems to be the hibernate version!

            Because I have the same problem but everything works fine in our SessionBean in JBoss I have the idea and it was right: Take the hibernate 3.1 Version (we have the one delivered with JBoss 4.0.3SP1) and it works!

            • 3. Re: Error parsing queries with jBPM 3.1
              kukeltje

              Yep, for me to. If I put the hibernate version that is in the jbpm/lib/hibernate jar in jboss 4.0.2 this error diasappears, but another error pops up. Just tried 4.0.3 and have no problem there.

              • 4. Re: Error parsing queries with jBPM 3.1
                eruiz

                The problem is the Hibernate version. The version 3.1 supports aliases in the update and delete sentences, the version 3.0 doesn't support it.

                If you need the Hibernate 3.0 remove the alias located in the following queries (file hibernate.config.xml) and rebuild the sources of the jbpm 3.1:

                - SchedulerSession.deleteTimersForProcessInstance
                - SchedulerSession.suspendTimersForToken
                - SchedulerSession.resumeTimersForToken

                For example, the query SchedulerSession.resumeTimersForToken changes from "update org.jbpm.scheduler.exe.Timer t set t.isSuspended = false where t.token = :token" to "update org.jbpm.scheduler.exe.Timer set isSuspended = false where token = :token"

                We have done it in this manner and it runs.