AnsweredAssumed Answered

Boundary Timer Event throwing SQLException - Invalid column

Question asked by ct1 on May 30, 2012
Latest reply on Jun 28, 2012 by ct1
Sirs:

While trying to use a bounday timer event, I am getting "SQLException: Invalid column name 'TRUE'."

I copied the loanrequest.bpmn20.xml file from the Activiti In Action source code into a project in Eclipse (Indigo Release 2).  I also put the Java program needed by the service task in the loanrequest process in a jar file on the Explorer classpath.  The timer is set to escalate the process from one user task to another user task if the first user task is not completed within one minute. 

I deployed it via the Activiti Explorer (5.9) on a Windows 7 PC.  I signed on to Activiti Explorer as fozzie, as instructed, and started the process.

That the process starts is noted in the log file.  The row created in the ACT_RU_JOB table is also shown below.  It is still there even after the log shows the stack trace and I stop tomcat to stop the cycle of exceptions. 

At the time the boundary timer event should escalate (cancel one user process and start another), the exception shown below is thrown.  Tomcat continues to throw this exception repeatedly until I either stop tomcat or delete the deployment.

Would you please have time to point out what I have done incorrectly?

Here is my copy of the loanrequest.bpmn20.xml file:


<?xml version="1.0" encoding="UTF-8"?>
<definitions id="taskAssigneeExample"
     xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:activiti="http://activiti.org/bpmn"
   targetNamespace="http://www.bpmnwithactiviti.org/loanrequest">
   
  <process id="loanrequest" name="Process to handle a loan request">
    <startEvent id="theStart">
      <extensionElements>
        <activiti:formProperty id="name" name="Name" required="true" type="string" />
        <activiti:formProperty id="emailAddress" name="Email address" required="true" type="string" />
        <activiti:formProperty id="income" name="Income" required="true" type="long" />
        <activiti:formProperty id="loanAmount" name="Loan amount" required="true" type="long" />
      </extensionElements>
    </startEvent>
    <sequenceFlow sourceRef="theStart" targetRef="checkCredit" />
      <scriptTask id="checkCredit" scriptFormat="groovy">
         <script>
            out:println "Checking credit for " + name;
            creditCheckOk = false;
            if((income / 2) > loanAmount){
               creditCheckOk = true;
            }
            out:println "Checked credit for " + name + " outcome is " + creditCheckOk;
         </script>
    </scriptTask>
    <sequenceFlow sourceRef="checkCredit" targetRef="createApplication" />
    <serviceTask id="createApplication"   activiti:class="org.bpmnwithactiviti.chapter5.CreateApplicationTask" />
    <sequenceFlow sourceRef="createApplication" targetRef="evaluateLoanRequest" />
    <userTask id="evaluateLoanRequest" name="Evaluate loan request" activiti:assignee="fozzie">
      <extensionElements>
        <activiti:formProperty id="customerName" name="Customer name" expression="${loanApplication.customerName}" writable="false"/>
        <activiti:formProperty id="income" name="Income of customer" expression="${loanApplication.income}" writable="false"/>
        <activiti:formProperty id="requestedAmount" name="Requested loan amount" expression="${loanApplication.requestedAmount}" writable="false"/>
        <activiti:formProperty id="creditCheckOk" name="Outcome of credit check" expression="${loanApplication.creditCheckOk}" writable="false"/>
        <activiti:formProperty id="requestApproved" name="Do you approve the request?" required="true" type="enum">
          <activiti:value id="true" name="Yes"/>
          <activiti:value id="false" name="No"/>
        </activiti:formProperty>
        <activiti:formProperty id="motivation" name="Motivation"/>
      </extensionElements>
    </userTask>
    <sequenceFlow sourceRef="evaluateLoanRequest" targetRef="approvalGateway" />
    <boundaryEvent id="escalationTimer" cancelActivity="true" attachedToRef="evaluateLoanRequest">
      <timerEventDefinition>
        <timeDuration>PT1M</timeDuration>
      </timerEventDefinition>
    </boundaryEvent>
    <sequenceFlow sourceRef="escalationTimer" targetRef="evaluateRequestByManager" />
    <userTask id="evaluateRequestByManager" name="Evaluate loan request by manager" activiti:candidateGroups="management">
      <extensionElements>
        <activiti:formProperty id="customerName" name="Customer name" expression="${loanApplication.customerName}" writable="false"/>
        <activiti:formProperty id="income" name="Income of customer" expression="${loanApplication.income}" writable="false"/>
        <activiti:formProperty id="requestedAmount" name="Requested loan amount" expression="${loanApplication.requestedAmount}" writable="false"/>
        <activiti:formProperty id="creditCheckOk" name="Outcome of credit check" expression="${loanApplication.creditCheckOk}" writable="false"/>
        <activiti:formProperty id="requestApproved" name="Do you approve the request?" required="true" type="enum">
          <activiti:value id="true" name="Yes"/>
          <activiti:value id="false" name="No"/>
        </activiti:formProperty>
        <activiti:formProperty id="motivation" name="Motivation"/>
      </extensionElements>
    </userTask>
    <sequenceFlow sourceRef="evaluateRequestByManager" targetRef="approvalGateway" />
    <exclusiveGateway id="approvalGateway" />
    <sequenceFlow sourceRef="approvalGateway" targetRef="informCustomer">
      <conditionExpression xsi:type="tFormalExpression">${requestApproved == false}</conditionExpression>
    </sequenceFlow>
    <sequenceFlow sourceRef="approvalGateway" targetRef="processRequest">
        <conditionExpression xsi:type="tFormalExpression">${requestApproved == true}</conditionExpression>
    </sequenceFlow>
    <serviceTask id="informCustomer" activiti:type="mail">
      <extensionElements>
        <activiti:field name="to" expression="${loanApplication.emailAddres}" />
        <activiti:field name="subject" stringValue="Loan Request Denied" />
        <activiti:field name="html">
          <activiti:expression>
            <![CDATA[
              <html>
                <body>
                  Hello ${loanApplication.customerName},<br/><br/>
                 
                  Your loan request has been denied for the following reason: ${motivation}.<br/><br/>
                 
                  Kind regards,<br/>
                 
                  The Loan Sharks Company.
                </body>
              </html>
            ]]>
          </activiti:expression>
        </activiti:field>     
      </extensionElements>
    </serviceTask>
    <sequenceFlow sourceRef="informCustomer" targetRef="theEnd" />
    <userTask id="processRequest" name="Process the loan request" activiti:assignee="fozzie" />
    <sequenceFlow sourceRef="processRequest" targetRef="theEnd" />
    <endEvent id="theEnd" />
  </process>
</definitions>



This is the exception that is thrown:

INFO: Server startup in 18183 ms
May 30, 2012 9:14:29 AM org.activiti.explorer.cache.TrieBasedUserCache loadUsers
INFO: Caching users 0 to 25
May 30, 2012 9:15:25 AM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource loanrequest.bpmn20.xml
May 30, 2012 9:15:25 AM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
May 30, 2012 9:15:25 AM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Checking credit for Charles Thomas                       <———————————–loan request process started
Checked credit for Charles Thomas outcome is true
name Charles Thomas
May 30, 2012 9:17:06 AM org.activiti.engine.impl.interceptor.CommandContext close   <—— Timer should escalate process.
SEVERE: Error while closing command context
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: java.sql.SQLException: Invalid column name 'TRUE'.   
### The error may involve org.activiti.engine.impl.persistence.entity.JobEntity.selectExclusiveJobsT
oExecute-Inline
### The error occurred while setting parameters
### Cause: java.sql.SQLException: Invalid column name 'TRUE'.
        at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:81
)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:73
)
        at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:182)
        at org.activiti.engine.impl.persistence.entity.JobManager.findExclusiveJobsToExecute(JobMana
ger.java:123)
        at org.activiti.engine.impl.cmd.AcquireJobsCmd.execute(AcquireJobsCmd.java:62)
        at org.activiti.engine.impl.cmd.AcquireJobsCmd.execute(AcquireJobsCmd.java:33)
        at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java
:24)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInte
rceptor.java:42)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        at org.activiti.engine.impl.jobexecutor.AcquireJobsRunnable.run(AcquireJobsRunnable.java:57)

        at java.lang.Thread.run(Thread.java:662)
Caused by: java.sql.SQLException: Invalid column name 'TRUE'.
        at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
        at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820)
        at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258)
        at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632)
        at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
        at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
        at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.execute(JtdsPreparedStatement.java:558)
        at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHand
ler.java:39)
        at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandle
r.java:55)
        at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:41)
        at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:243)
        at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:117)
        at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:72)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:79
)
        … 10 more
May 30, 2012 9:17:06 AM org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: java.sql.SQLException: Invalid column name 'TRUE'.
### The error may involve org.activiti.engine.impl.persistence.entity.JobEntity.selectExclusiveJobsT
oExecute-Inline
### The error occurred while setting parameters
### Cause: java.sql.SQLException: Invalid column name 'TRUE'.
        at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:81
)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:73
)
        at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:182)
        at org.activiti.engine.impl.persistence.entity.JobManager.findExclusiveJobsToExecute(JobMana
ger.java:123)
        at org.activiti.engine.impl.cmd.AcquireJobsCmd.execute(AcquireJobsCmd.java:62)
        at org.activiti.engine.impl.cmd.AcquireJobsCmd.execute(AcquireJobsCmd.java:33)
        at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java
:24)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInte
rceptor.java:42)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        at org.activiti.engine.impl.jobexecutor.AcquireJobsRunnable.run(AcquireJobsRunnable.java:57)

        at java.lang.Thread.run(Thread.java:662)
Caused by: java.sql.SQLException: Invalid column name 'TRUE'.
        at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
        at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820)
        at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258)
        at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632)
        at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
        at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
        at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.execute(JtdsPreparedStatement.java:558)
        at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHand
ler.java:39)
        at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandle
r.java:55)
        at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:41)
        at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:243)
        at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:117)
        at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:72)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:79
)
        … 10 more

This is what the row in the ACT_RU_JOB table contains:

908725   1   timer   NULL   NULL   1   908724   908710   3   NULL   NULL   2012-05-30 09:17:06.320   NULL   timer-transition   escalationTimer

Outcomes