AnsweredAssumed Answered

Mapped Statements collection does not contain value for...

Question asked by esteem on Sep 16, 2011
Latest reply on Sep 20, 2011 by jbarrez
i just use activiti5.7 + mybatis 3.04,and wen i run tests by
maven,i got errors:
### Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for org.activiti.persistence.selectJobsByConfiguration
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for org.activiti.persistence.selectJobsByConfiguration
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:80)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:72)
at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:182)
at org.activiti.engine.impl.persistence.entity.JobManager.findJobsByConfiguration(JobManager.java:122)
at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.removeObsoleteTimers(BpmnDeployer.java:169)
at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:132)
at org.activiti.engine.impl.persistence.deploy.DeploymentCache.deploy(DeploymentCache.java:37)
at org.activiti.engine.impl.persistence.entity.DeploymentManager.insertDeployment(DeploymentManager.java:39)
at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:58)
at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:30)
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.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:33)
at org.activiti.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:43)
at org.activiti.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:106)
at com.taobao.ad.ido.process.engine.impl.ProcessRuntimeImpl.deployProcess(ProcessRuntimeImpl.java:111)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy26.deployProcess(Unknown Source)

i found someone also encounter such problem : viewtopic.php?f=6&t=1852&start=0

i check the mapper and sources ,found:
JobManager:

public List<Job> findJobsByConfiguration(String jobHandlerType, String jobHandlerConfiguration) {
Map<String, String> params = new HashMap<String, String>();
params.put("handlerType", jobHandlerType);
params.put("handlerConfiguration", jobHandlerConfiguration);
return getDbSqlSession().selectList("org.activiti.persistence.selectJobsByConfiguration", params);
}

but our Job.xml :
<mapper namespace="org.activiti.engine.impl.persistence.entity.JobEntity"> ….

so ,i think this is the key point. hope this issue can be fix in future release.

and i modify the Job.xml ,and found it is ok,no errors.

I have an sample project show this problem.

The maven project you can find in the attachment. You should run mvn test in your cmd. Then you can get the error. But when import the project into eclispe and run the test SampleProcessTest.testBDUnAppealUnfreeze() ,the test will success.

Outcomes