cancel
Showing results for 
Search instead for 
Did you mean: 

Problem calling historyService.createHistoricDetailQuery()

wolpert
Champ in-the-making
Champ in-the-making
Folks-

  Using activiti 5.4, I'm getting an error when I try to generate a createHistoricDetailQuery() request. Specific code calling is this:

historyService.createHistoricDetailQuery().activityInstanceId(instance.getId()).orderByTime().desc().list()

though I've tried different ways to call it, all with the same response. Any clues to guide me?

Exception trace is below:


org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error evaluating expression [historyService.createHistoricDetailQuery().activityInstanceId(instance.getId()).orderByTime().desc().list()] on line [114]:
### Error querying database.  Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for org.activiti.persistence.selectByteArrayById_postgres
### The error may involve org.activiti.persistence.selectHistoricDetailsByQueryCriteria_postgres-Inline
### The error occurred while setting parameters
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for org.activiti.persistence.selectByteArrayById_postgres

   at mnt_Fast_wolpert_repo_PhaseThree_code_nuke_grails_app_views_processInstance_show_gsp$_run_closure2_closure40.doCall(mnt_Fast_wolpert_repo_PhaseThree_code_nuke_grails_app_views_processInstance_show_gsp:105)

   at mnt_Fast_wolpert_repo_PhaseThree_code_nuke_grails_app_views_processInstance_show_gsp$_run_closure2.doCall(mnt_Fast_wolpert_repo_PhaseThree_code_nuke_grails_app_views_processInstance_show_gsp:83)

   at mnt_Fast_wolpert_repo_PhaseThree_code_nuke_grails_app_views_processInstance_show_gsp$_run_closure2.doCall(mnt_Fast_wolpert_repo_PhaseThree_code_nuke_grails_app_views_processInstance_show_gsp)

   at mnt_Fast_wolpert_repo_PhaseThree_code_nuke_grails_app_views_processInstance_show_gsp.run(mnt_Fast_wolpert_repo_PhaseThree_code_nuke_grails_app_views_processInstance_show_gsp:144)

   at java.lang.Thread.run(Thread.java:662)

Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for org.activiti.persistence.selectByteArrayById_postgres
### The error may involve org.activiti.persistence.selectHistoricDetailsByQueryCriteria_postgres-Inline
### The error occurred while setting parameters
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for org.activiti.persistence.selectByteArrayById_postgres

   at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)

   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:61)

   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:53)

   at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:171)

   at org.activiti.engine.impl.db.DbHistorySession.findHistoricDetailsByQueryCriteria(DbHistorySession.java:113)

   at org.activiti.engine.impl.HistoricDetailQueryImpl.executeList(HistoricDetailQueryImpl.java:82)

   at org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:126)

   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)

   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)

   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)

   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)

   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)

   at org.activiti.engine.impl.AbstractQuery.list(AbstractQuery.java:102)

   at org.activiti.engine.query.Query$list.call(Unknown Source)

   at mnt_Fast_wolpert_repo_PhaseThree_code_nuke_grails_app_views_processInstance_show_gsp$_run_closure2_closure40_closure55.doCall(mnt_Fast_wolpert_repo_PhaseThree_code_nuke_grails_app_views_processInstance_show_gsp:105)

   … 5 more

Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for org.activiti.persistence.selectByteArrayById_postgres

   at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:462)

   at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:349)

   at org.apache.ibatis.executor.resultset.FastResultSetHandler.getNestedQueryMappingValue(FastResultSetHandler.java:343)

   at org.apache.ibatis.executor.resultset.FastResultSetHandler.getPropertyMappingValue(FastResultSetHandler.java:235)

   at org.apache.ibatis.executor.resultset.FastResultSetHandler.applyPropertyMappings(FastResultSetHandler.java:221)

   at org.apache.ibatis.executor.resultset.FastResultSetHandler.getRowValue(FastResultSetHandler.java:196)

   at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleRowValues(FastResultSetHandler.java:145)

   at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSet(FastResultSetHandler.java:121)

   at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSets(FastResultSetHandler.java:98)

   at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:40)

   at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:55)

   at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:41)

   at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:94)

   at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:72)

   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:59)

   … 18 more
11 REPLIES 11

jbarrez
Star Contributor
Star Contributor
Are you using the out of the box Activiti. More specifically, are you using a different version of MyBatis?

wolpert
Champ in-the-making
Champ in-the-making
Its stock activiti, but via the grails-activiti-plugin. It should be the same version of MyBatis that ships with activiti 5.4.

jbarrez
Star Contributor
Star Contributor
We have a test suite, which would certainly have catched this error.
Any chance you can retry it on a stock activiti without Grails?

wolpert
Champ in-the-making
Champ in-the-making
The grails plugin uses activiti-engine-5.4.jar and mybatis-3.0.1.jar… is this the correct version?

wolpert
Champ in-the-making
Champ in-the-making
I can verify that the grails activiti plugin works fine. Specifically, using the 5.4 version of the grails activiti plugin and the sample vacation app, adding the historyDetailQuery() usage doesn't cause the same problem. So its probably something I'm doing…

But what could I do that causes this error? What should I look for?

wolpert
Champ in-the-making
Champ in-the-making
One question on the test case… does it run for each database supported? I.E., postgres in my case?

wolpert
Champ in-the-making
Champ in-the-making
(Sorry for writing so many separate posts)

I can't find the test case you have that executes createHistoricDetailQuery() with live data. Can you point it out to me?

limcheekin
Champ on-the-rise
Champ on-the-rise
(Sorry for writing so many separate posts)

I can't find the test case you have that executes createHistoricDetailQuery() with live data. Can you point it out to me?

Hi Ned,

Please look into test cases shipped with Activiti 5.4 distribution instead activiti examples in the grails plugin. Sorry to tell you that I didn't upgrade the activiti examples to 5.4 due to time constraints.

Best regards,
Chee Kin

wolpert
Champ in-the-making
Champ in-the-making
Actually, I did do that. I couldn't find any example that called createHistoricDetailQuery() in the svn repo here:

http://svn.codehaus.org/activiti/activiti/tags/activiti-5.4/modules/activiti-engine/src/test/java/or...

I may have missed it, so I figure I'd ask… but searching for Detail or detail comes up blank…so it looks like its not tested. I'll download the whole src and give it a grep…