cancel
Showing results for 
Search instead for 
Did you mean: 

There is no getter for property named 'limitBefore' in 'class org.activiti.engine.impl.ProcessInstanceQueryImpl'

joao_p_silva
Champ in-the-making
Champ in-the-making
When using a
ProcessInstanceQuery
to list all process instances that match a given process definition key, and contain a certain variable value, i.e.:


List<ProcessInstance> procs = processEngine.getRuntimeService()
  .createProcessInstanceQuery().processDefinitionKey("key")
  .variableValueEquals("var", value)
  .list();


We are occasionally being faced with the following Exception:


### Error querying database.  Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'limitBefore' in 'class org.activiti.engine.impl.ProcessInstanceQueryImpl'
### Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'limitBefore' in 'class org.activiti.engine.impl.ProcessInstanceQueryImpl'
        at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98)
        at org.activiti.engine.impl.db.DbSqlSession.selectListWithRawParameter(DbSqlSession.java:284)
        at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:275)
        at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:265)
        at org.activiti.engine.impl.persistence.entity.ExecutionEntityManager.findProcessInstanceByQueryCriteria(ExecutionEntityManager.java:112)
        at org.activiti.engine.impl.ProcessInstanceQueryImpl.executeList(ProcessInstanceQueryImpl.java:197)
        at org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:139)
        at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:61)
        at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
        at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
        at org.activiti.engine.impl.AbstractQuery.list(AbstractQuery.java:113)
        at …
        … 7 more
Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'limitBefore' in 'class org.activiti.engine.impl.ProcessInstanceQueryImpl'
        at org.apache.ibatis.reflection.Reflector.getGetInvoker(Reflector.java:377)
        at org.apache.ibatis.reflection.MetaClass.getGetInvoker(MetaClass.java:167)
        at org.apache.ibatis.reflection.wrapper.BeanWrapper.getBeanProperty(BeanWrapper.java:149)
        at org.apache.ibatis.reflection.wrapper.BeanWrapper.get(BeanWrapper.java:45)
        at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:113)
        at org.apache.ibatis.scripting.xmltags.DynamicContext$ContextMap.get(DynamicContext.java:89)
        at org.apache.ibatis.scripting.xmltags.DynamicContext$ContextAccessor.getProperty(DynamicContext.java:107)
        at org.apache.ibatis.ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1657)
        at org.apache.ibatis.ognl.ASTProperty.getValueBody(ASTProperty.java:92)
        at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
        at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:210)
        at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:333)
        at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:413)
        at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:395)
        at org.apache.ibatis.scripting.xmltags.OgnlCache.getValue(OgnlCache.java:45)
        at org.apache.ibatis.scripting.xmltags.TextSqlNode$BindingTokenParser.handleToken(TextSqlNode.java:50)
        at org.apache.ibatis.parsing.GenericTokenParser.parse(GenericTokenParser.java:50)
        at org.apache.ibatis.scripting.xmltags.TextSqlNode.apply(TextSqlNode.java:31)
        at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:29)
        at org.apache.ibatis.scripting.xmltags.DynamicSqlSource.getBoundSql(DynamicSqlSource.java:37)
        at org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:265)
        at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:79)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104)
        … 24 more


We are, however, unable to find a deterministic way to reproduce this issue. In fact, if we restart the process, and run the same process instance query again, no exception is thrown. Do you have any suggestions regarding what could be causing this issue?

Our version of Activiti is 5.13.
4 REPLIES 4

frederikherema1
Star Contributor
Star Contributor
Those properties should be provided to myBatis (and the DbSqlSessionFactory), when the process-engine is initialized:

if(databaseType != null) {
          properties.put("limitBefore" , DbSqlSessionFactory.databaseSpecificLimitBeforeStatements.get(databaseType));
          properties.put("limitAfter" , DbSqlSessionFactory.databaseSpecificLimitAfterStatements.get(databaseType));
          properties.put("limitBetween" , DbSqlSessionFactory.databaseSpecificLimitBetweenStatements.get(databaseType));
          properties.put("limitOuterJoinBetween" , DbSqlSessionFactory.databaseOuterJoinLimitBetweenStatements.get(databaseType));
          properties.put("orderBy" , DbSqlSessionFactory.databaseSpecificOrderByStatements.get(databaseType));
          properties.put("limitBeforeNativeQuery" , ObjectUtils.toString(DbSqlSessionFactory.databaseSpecificLimitBeforeNativeQueryStatements.get(databaseType)));
        }

So it's due to the lack of those "global" properties that myBatis looks at the actual query-object to retrieve them.

Double-check your process-engine configuration and make sure the "databaseType" is supplied.

kary
Champ in-the-making
Champ in-the-making
Hi I am new to activiti. While configuring process engine, I am facing the same problem. Could you help me with this issue.

Error querying database.  Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'limitBefore' in 'class org.activiti.engine.impl.db.ListQueryParameterObject'
### Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'limitBefore' in 'class org.activiti.engine.impl.db.ListQueryParameterObject'
My understanding is that the "databaseType" should be picked up based on the driver configuration in the datasource while loading the processEngineConfiguration.
Below is the process engine bean configuration.


<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
    <property name="dataSource" ref="dataSource" />
    <property name="transactionManager" ref="transactionManager" />
    <property name="history" value="audit" />
    <property name="databaseSchemaUpdate" value="false" />
    <property name="jobExecutorActivate" value="true" />
    <property name="processDefinitionCacheLimit" value="10" />
    <property name="processEngineName" value="default"></property>
    <property name="customSessionFactories">
      <list>
        <bean class="com.uprr.bpm.rest.services.ldap.LDAPUserManagerFactory">
          <constructor-arg ref="ldapConnectionParams" />
        </bean>
        <bean class="com.uprr.bpm.rest.services.ldap.LDAPGroupManagerFactory">
          <constructor-arg ref="ldapConnectionParams" />
        </bean>
      </list>
    </property>
  </bean>

trademak
Star Contributor
Star Contributor
Hi,

No, you have to explicitly set the databaseType. That's why you get this limitBefore error message.

Best regards,

kary
Champ in-the-making
Champ in-the-making
I did not set the dabaseType but the problem got solved when we actually increased the database processes. So I wonder if we really need to set the databaseType?

Regards,
Kary
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.