cancel
Showing results for 
Search instead for 
Did you mean: 

deploy - Error querying database

swa1
Champ in-the-making
Champ in-the-making
Hi,

when deploying I get the follow error:

[deploy-bar] SCHWERWIEGEND: Error while closing command context
[deploy-bar] org.apache.ibatis.exceptions.PersistenceException:
[deploy-bar] ### Error querying database.  Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for selectDbSchemaVersion
[deploy-bar] ### The error may exist in org/activiti/db/ibatis/variable.mapping.xml
[deploy-bar] ### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for selectDbSchemaVersion

Anybody an idea what could be the reason for that?

Thanks
Steffen
12 REPLIES 12

jbarrez
Star Contributor
Star Contributor
That seems very odd, because the mapping are part of the activiti jar.

How do you deploy?

swa1
Champ in-the-making
Champ in-the-making
Normally I deploy with Eclipse.

Now I tried to deploy the bar-file in Activiti Probe and that works.

jbarrez
Star Contributor
Star Contributor
It's already the second post that mentions this error - so there must be something wrong somewhere.

Could you explain how exactly you are deploying?

swa1
Champ in-the-making
Champ in-the-making
Well, I drag the build.xml to the ANT Section and then double-click the deploy-bar.
As a result there occurs the error an BUILD FAILED but the bar is created an I could upload it with Activiti Probe. THis way it works, so it is not so fatal. But really mysterious.

bartas
Champ in-the-making
Champ in-the-making
Hi,

I get the same error for activiti 5.1 and 5.2. When I start application on empty database with <property name="databaseSchemaUpdate" value="create-drop" /> schema is created and everything works ok, but if I restart application with <property name="databaseSchemaUpdate" value="true" /> I get the follow error:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'activitiUserServiceOsgi': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.activiti.engine.IdentityService com.beelaud.osgi.activiti.impl.UserServiceImpl.ident; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for selectProperty
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for selectProperty

and if I set <property name="databaseSchemaUpdate" value="false" /> I get:

SEVERE: Error while closing command context
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for selectDbSchemaVersion
### The error may exist in org/activiti/db/ibatis/variable.mapping.xml
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for selectDbSchemaVersion

Any idea ?

Bartek

jbarrez
Star Contributor
Star Contributor
Are you using OSGI? because I see some osgi packages in the stacktrace.

bartas
Champ in-the-making
Champ in-the-making
Yes, now I'm testing my application on Equinox 3.6.2RC4 with Spring DM 2.0.0.M1 and Spring Framework 3.0.5.RELEASE. I had to change my OSGI environment from Equinox 3.5.1.R35x because was problem with weaving in spring when I want to change api from 5.0 to 5.2. After several tests I noticed that with api 5.0 my application start ok, but when I call taskService.createTaskQuery().taskId(taskId).singleResult(); I get the follow error:

### Error querying database.  Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for selectTaskByQueryCriteria_mysql
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for selectTaskByQueryCriteria_mysql
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:77)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:69)
at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:154)
at org.activiti.engine.impl.db.DbTaskSession.findTasksByQueryCriteria(DbTaskSession.java:50)
at org.activiti.engine.impl.TaskQueryImpl.executeList(TaskQueryImpl.java:220)
at org.activiti.engine.impl.AbstractQuery.executeSingleResult(AbstractQuery.java:130)
at org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:113)
at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:22)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:37)
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.AbstractQuery.singleResult(AbstractQuery.java:87)

Maybe something wrong with bundles version or Import-Package/Export-Package?
reference:file:bundles/util/mybatis-3.0.4.jar@start,\
reference:file:bundles/util/drools-api-5.1.1.jar@start,\

bartas
Champ in-the-making
Champ in-the-making
I found where the problem is. I think that in activiti-engine.5.x.jar MANIFEST.MF should have set version for org.apache.ibatis Import-packages. Now in activiti dependency is used mybatis-3.0.1 package which has not properly set manifest, so I download mybatis-3.0.4. As it turns out activiti not working correctly with mybatis-3.0.4 and mybatis-3.0.5-SNAPSHOT bundles. I did export mybatis-3.0.1 packages by my own bundle and now everything works as it should do.

Bartek

frederikherema1
Star Contributor
Star Contributor
Bartek,

If I understand correctly, is there something wrong with the engine bundle's manifest we provide?