cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti v5.21 mail server configuration issue

leostra
Champ in-the-making
Champ in-the-making
Hi all,
I'm trying to use a EMail Task in my BPMN process. Then i need to configure my Activiti v5.21 to use my mail server (no gmail web server).

Reading the documentation and the forum i'm very confused. How can i configure the mail server in the version 5.21? i use both the activiti-explorer and activiti-rest web application but i think the configuration method is the same.

i tried the following methods:

- the activiti-cfg.jar  containing the activiti.cfg.xml config file and put it into the lib path. The config was ignored and the engine try to use the defoult localhost:25 mail server.

- the activiti.cfg.xml in the classes folder. Also in this case the engine ignore it and use the default localhost mail server.

- modify the activiti-custom-context.xml present in classes folder as follow:


  <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
   <property name="mailServerHost" value="myMailServer" />
   <property name="mailServerPort" value="25" />
   <property name="mailServerUseSSL" value="false" />
   <property name="mailServerUseTLS" value="false" />
   <property name="mailServerDefaultFrom" value="activiti@activiti.org" />
   <property name="mailServerUsername" value="myUsername" />
   <property name="mailServerPassword" value="myPassword" />
  </bean>



In this case, the activiti-explorer and the activiti-rest web application do not startup and in the tomcat console i read the follow stacktrace:


org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'demoDataConfiguration': Injection of autowired dependencies failed; nest
ed exception is org.springframework.beans.factory.BeanCreationException: Could n
ot autowire field: protected org.activiti.engine.IdentityService org.activiti.ex
plorer.conf.DemoDataConfiguration.identityService; nested exception is org.sprin
gframework.beans.factory.BeanCreationException: Error creating bean with name 'i
dentityService' defined in class path resource [org/activiti/explorer/conf/Activ
itiEngineConfiguration.class]: Bean instantiation via factory method failed; nes
ted exception is org.springframework.beans.BeanInstantiationException: Failed to
instantiate [org.activiti.engine.IdentityService]: Factory method 'identityServ
ice' threw exception; nested exception is org.springframework.beans.factory.Bean
CreationException: Error creating bean with name 'processEngine' defined in clas
s path resource [org/activiti/explorer/conf/ActivitiEngineConfiguration.class]:
Bean instantiation via factory method failed; nested exception is org.springfram
ework.beans.BeanInstantiationException: Failed to instantiate [org.activiti.engi
ne.ProcessEngine]: Factory method 'processEngine' threw exception; nested except
ion is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreatio
nException: Error creating bean with name 'processEngineFactoryBean': FactoryBea
n threw exception on object creation; nested exception is org.apache.ibatis.exce
ptions.PersistenceException:
### Error querying database.  Cause: org.apache.ibatis.transaction.TransactionEx
ception: Error configuring AutoCommit.  Your driver may not support getAutoCommi
t() or setAutoCommit(). Requested setting: false.  Cause: org.h2.jdbc.JdbcSQLExc
eption: Connection is broken: "unexpected status 16777216" [90067-176]
### The error may exist in org/activiti/db/mapping/entity/Property.xml
### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEn
tity.selectDbSchemaVersion
### The error occurred while executing a query
### Cause: org.apache.ibatis.transaction.TransactionException: Error configuring
AutoCommit.  Your driver may not support getAutoCommit() or setAutoCommit(). Re
quested setting: false.  Cause: org.h2.jdbc.JdbcSQLException: Connection is brok
en: "unexpected status 16777216" [90067-176]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanP
ostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java
:334)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:476)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:303)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:299)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:194)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactory.java:755)
        at org.springframework.context.support.AbstractApplicationContext.finish
BeanFactoryInitialization(AbstractApplicationContext.java:757)
        at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:480)
        at org.activiti.explorer.servlet.WebConfigurer.contextInitialized(WebCon
figurer.java:40)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
t.java:5068)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContex
t.java:5584)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:899)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:87
5)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)

        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092
)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:
1984)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not au
towire field: protected org.activiti.engine.IdentityService org.activiti.explore
r.conf.DemoDataConfiguration.identityService; nested exception is org.springfram
ework.beans.factory.BeanCreationException: Error creating bean with name 'identi
tyService' defined in class path resource [org/activiti/explorer/conf/ActivitiEn
gineConfiguration.class]: Bean instantiation via factory method failed; nested e
xception is org.springframework.beans.BeanInstantiationException: Failed to inst
antiate [org.activiti.engine.IdentityService]: Factory method 'identityService'
threw exception; nested exception is org.springframework.beans.factory.BeanCreat
ionException: Error creating bean with name 'processEngine' defined in class pat
h resource [org/activiti/explorer/conf/ActivitiEngineConfiguration.class]: Bean
instantiation via factory method failed; nested exception is org.springframework
.beans.BeanInstantiationException: Failed to instantiate [org.activiti.engine.Pr
ocessEngine]: Factory method 'processEngine' threw exception; nested exception i
s java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationExce
ption: Error creating bean with name 'processEngineFactoryBean': FactoryBean thr
ew exception on object creation; nested exception is org.apache.ibatis.exception
s.PersistenceException:
### Error querying database.  Cause: org.apache.ibatis.transaction.TransactionEx
ception: Error configuring AutoCommit.  Your driver may not support getAutoCommi
t() or setAutoCommit(). Requested setting: false.  Cause: org.h2.jdbc.JdbcSQLExc
eption: Connection is broken: "unexpected status 16777216" [90067-176]
### The error may exist in org/activiti/db/mapping/entity/Property.xml
### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEn
tity.selectDbSchemaVersion
### The error occurred while executing a query
### Cause: org.apache.ibatis.transaction.TransactionException: Error configuring
AutoCommit.  Your driver may not support getAutoCommit() or setAutoCommit(). Re
quested setting: false.  Cause: org.h2.jdbc.JdbcSQLException: Connection is brok
en: "unexpected status 16777216" [90067-176]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanP
ostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.j
ava:561)
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject
(InjectionMetadata.java:88)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanP
ostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java
:331)
        … 24 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creati
ng bean with name 'identityService' defined in class path resource [org/activiti
/explorer/conf/ActivitiEngineConfiguration.class]: Bean instantiation via factor
y method failed; nested exception is org.springframework.beans.BeanInstantiation
Exception: Failed to instantiate [org.activiti.engine.IdentityService]: Factory
method 'identityService' threw exception; nested exception is org.springframewor
k.beans.factory.BeanCreationException: Error creating bean with name 'processEng
ine' defined in class path resource [org/activiti/explorer/conf/ActivitiEngineCo
nfiguration.class]: Bean instantiation via factory method failed; nested excepti
on is org.springframework.beans.BeanInstantiationException: Failed to instantiat
e [org.activiti.engine.ProcessEngine]: Factory method 'processEngine' threw exce
ption; nested exception is java.lang.RuntimeException: org.springframework.beans
.factory.BeanCreationException: Error creating bean with name 'processEngineFact
oryBean': FactoryBean threw exception on object creation; nested exception is or
g.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: org.apache.ibatis.transaction.TransactionEx
ception: Error configuring AutoCommit.  Your driver may not support getAutoCommi
t() or setAutoCommit(). Requested setting: false.  Cause: org.h2.jdbc.JdbcSQLExc
eption: Connection is broken: "unexpected status 16777216" [90067-176]
### The error may exist in org/activiti/db/mapping/entity/Property.xml
### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEn
tity.selectDbSchemaVersion
### The error occurred while executing a query
### Cause: org.apache.ibatis.transaction.TransactionException: Error configuring
AutoCommit.  Your driver may not support getAutoCommit() or setAutoCommit(). Re
quested setting: false.  Cause: org.h2.jdbc.JdbcSQLException: Connection is brok
en: "unexpected status 16777216" [90067-176]
        at org.springframework.beans.factory.support.ConstructorResolver.instant
iateUsingFactoryMethod(ConstructorResolver.java:599)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:11
11)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1006)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:476)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:303)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:299)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:194)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.
findAutowireCandidates(DefaultListableBeanFactory.java:1120)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.
doResolveDependency(DefaultListableBeanFactory.java:1044)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.
resolveDependency(DefaultListableBeanFactory.java:942)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanP
ostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.j
ava:533)
        … 26 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to insta
ntiate [org.activiti.engine.IdentityService]: Factory method 'identityService' t
hrew exception; nested exception is org.springframework.beans.factory.BeanCreati
onException: Error creating bean with name 'processEngine' defined in class path
resource [org/activiti/explorer/conf/ActivitiEngineConfiguration.class]: Bean i
nstantiation via factory method failed; nested exception is org.springframework.
beans.BeanInstantiationException: Failed to instantiate [org.activiti.engine.Pro
cessEngine]: Factory method 'processEngine' threw exception; nested exception is
java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationExcep
tion: Error creating bean with name 'processEngineFactoryBean': FactoryBean thre
w exception on object creation; nested exception is org.apache.ibatis.exceptions
.PersistenceException:
### Error querying database.  Cause: org.apache.ibatis.transaction.TransactionEx
ception: Error configuring AutoCommit.  Your driver may not support getAutoCommi
t() or setAutoCommit(). Requested setting: false.  Cause: org.h2.jdbc.JdbcSQLExc
eption: Connection is broken: "unexpected status 16777216" [90067-176]
### The error may exist in org/activiti/db/mapping/entity/Property.xml
### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEn
tity.selectDbSchemaVersion
### The error occurred while executing a query
### Cause: org.apache.ibatis.transaction.TransactionException: Error configuring
AutoCommit.  Your driver may not support getAutoCommit() or setAutoCommit(). Re
quested setting: false.  Cause: org.h2.jdbc.JdbcSQLException: Connection is brok
en: "unexpected status 16777216" [90067-176]
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy
.instantiate(SimpleInstantiationStrategy.java:189)
        at org.springframework.beans.factory.support.ConstructorResolver.instant
iateUsingFactoryMethod(ConstructorResolver.java:588)
        … 38 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creati
ng bean with name 'processEngine' defined in class path resource [org/activiti/e
xplorer/conf/ActivitiEngineConfiguration.class]: Bean instantiation via factory
method failed; nested exception is org.springframework.beans.BeanInstantiationEx
ception: Failed to instantiate [org.activiti.engine.ProcessEngine]: Factory meth
od 'processEngine' threw exception; nested exception is java.lang.RuntimeExcepti
on: org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'processEngineFactoryBean': FactoryBean threw exception on object cre
ation; nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: org.apache.ibatis.transaction.TransactionEx
ception: Error configuring AutoCommit.  Your driver may not support getAutoCommi
t() or setAutoCommit(). Requested setting: false.  Cause: org.h2.jdbc.JdbcSQLExc
eption: Connection is broken: "unexpected status 16777216" [90067-176]
### The error may exist in org/activiti/db/mapping/entity/Property.xml
### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEn
tity.selectDbSchemaVersion
### The error occurred while executing a query
### Cause: org.apache.ibatis.transaction.TransactionException: Error configuring
AutoCommit.  Your driver may not support getAutoCommit() or setAutoCommit(). Re
quested setting: false.  Cause: org.h2.jdbc.JdbcSQLException: Connection is brok
en: "unexpected status 16777216" [90067-176]
        at org.springframework.beans.factory.support.ConstructorResolver.instant
iateUsingFactoryMethod(ConstructorResolver.java:599)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:11
11)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1006)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:476)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:303)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:299)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:194)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$Bea
nMethodInterceptor.intercept(ConfigurationClassEnhancer.java:322)
        at org.activiti.explorer.conf.ActivitiEngineConfiguration$$EnhancerBySpr
ingCGLIB$$fc783ea2.processEngine(<generated>)
        at org.activiti.explorer.conf.ActivitiEngineConfiguration.identityServic
e(ActivitiEngineConfiguration.java:159)
        at org.activiti.explorer.conf.ActivitiEngineConfiguration$$EnhancerBySpr
ingCGLIB$$fc783ea2.CGLIB$identityService$9(<generated>)
        at org.activiti.explorer.conf.ActivitiEngineConfiguration$$EnhancerBySpr
ingCGLIB$$fc783ea2$$FastClassBySpringCGLIB$$39e242e5.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.j
ava:228)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$Bea
nMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
        at org.activiti.explorer.conf.ActivitiEngineConfiguration$$EnhancerBySpr
ingCGLIB$$fc783ea2.identityService(<generated>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy
.instantiate(SimpleInstantiationStrategy.java:162)
        … 39 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to insta
ntiate [org.activiti.engine.ProcessEngine]: Factory method 'processEngine' threw
exception; nested exception is java.lang.RuntimeException: org.springframework.
beans.factory.BeanCreationException: Error creating bean with name 'processEngin
eFactoryBean': FactoryBean threw exception on object creation; nested exception
is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: org.apache.ibatis.transaction.TransactionEx
ception: Error configuring AutoCommit.  Your driver may not support getAutoCommi
t() or setAutoCommit(). Requested setting: false.  Cause: org.h2.jdbc.JdbcSQLExc
eption: Connection is broken: "unexpected status 16777216" [90067-176]
### The error may exist in org/activiti/db/mapping/entity/Property.xml
### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEn
tity.selectDbSchemaVersion
### The error occurred while executing a query
### Cause: org.apache.ibatis.transaction.TransactionException: Error configuring
AutoCommit.  Your driver may not support getAutoCommit() or setAutoCommit(). Re
quested setting: false.  Cause: org.h2.jdbc.JdbcSQLException: Connection is brok
en: "unexpected status 16777216" [90067-176]
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy
.instantiate(SimpleInstantiationStrategy.java:189)
        at org.springframework.beans.factory.support.ConstructorResolver.instant
iateUsingFactoryMethod(ConstructorResolver.java:588)
        … 60 more
Caused by: java.lang.RuntimeException: org.springframework.beans.factory.BeanCre
ationException: Error creating bean with name 'processEngineFactoryBean': Factor
yBean threw exception on object creation; nested exception is org.apache.ibatis.
exceptions.PersistenceException:
### Error querying database.  Cause: org.apache.ibatis.transaction.TransactionEx
ception: Error configuring AutoCommit.  Your driver may not support getAutoCommi
t() or setAutoCommit(). Requested setting: false.  Cause: org.h2.jdbc.JdbcSQLExc
eption: Connection is broken: "unexpected status 16777216" [90067-176]
### The error may exist in org/activiti/db/mapping/entity/Property.xml
### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEn
tity.selectDbSchemaVersion
### The error occurred while executing a query
### Cause: org.apache.ibatis.transaction.TransactionException: Error configuring
AutoCommit.  Your driver may not support getAutoCommit() or setAutoCommit(). Re
quested setting: false.  Cause: org.h2.jdbc.JdbcSQLException: Connection is brok
en: "unexpected status 16777216" [90067-176]
        at org.activiti.explorer.conf.ActivitiEngineConfiguration.processEngine(
ActivitiEngineConfiguration.java:85)
        at org.activiti.explorer.conf.ActivitiEngineConfiguration$$EnhancerBySpr
ingCGLIB$$fc783ea2.CGLIB$processEngine$5(<generated>)
        at org.activiti.explorer.conf.ActivitiEngineConfiguration$$EnhancerBySpr
ingCGLIB$$fc783ea2$$FastClassBySpringCGLIB$$39e242e5.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.j
ava:228)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$Bea
nMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
        at org.activiti.explorer.conf.ActivitiEngineConfiguration$$EnhancerBySpr
ingCGLIB$$fc783ea2.processEngine(<generated>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy
.instantiate(SimpleInstantiationStrategy.java:162)
        … 61 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creati
ng bean with name 'processEngineFactoryBean': FactoryBean threw exception on obj
ect creation; nested exception is org.apache.ibatis.exceptions.PersistenceExcept
ion:
### Error querying database.  Cause: org.apache.ibatis.transaction.TransactionEx
ception: Error configuring AutoCommit.  Your driver may not support getAutoCommi
t() or setAutoCommit(). Requested setting: false.  Cause: org.h2.jdbc.JdbcSQLExc
eption: Connection is broken: "unexpected status 16777216" [90067-176]
### The error may exist in org/activiti/db/mapping/entity/Property.xml
### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEn
tity.selectDbSchemaVersion
### The error occurred while executing a query
### Cause: org.apache.ibatis.transaction.TransactionException: Error configuring
AutoCommit.  Your driver may not support getAutoCommit() or setAutoCommit(). Re
quested setting: false.  Cause: org.h2.jdbc.JdbcSQLException: Connection is brok
en: "unexpected status 16777216" [90067-176]
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.
doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175)
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.
getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getObje
ctForBeanInstance(AbstractBeanFactory.java:1517)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:251)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:194)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$Bea
nMethodInterceptor$1.intercept(ConfigurationClassEnhancer.java:379)
        at org.activiti.spring.ProcessEngineFactoryBean$$EnhancerBySpringCGLIB$$
abb74731.getObject(<generated>)
        at org.activiti.explorer.conf.ActivitiEngineConfiguration.processEngine(
ActivitiEngineConfiguration.java:83)
        … 71 more
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: org.apache.ibatis.transaction.TransactionEx
ception: Error configuring AutoCommit.  Your driver may not support getAutoCommi
t() or setAutoCommit(). Requested setting: false.  Cause: org.h2.jdbc.JdbcSQLExc
eption: Connection is broken: "unexpected status 16777216" [90067-176]
### The error may exist in org/activiti/db/mapping/entity/Property.xml
### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEn
tity.selectDbSchemaVersion
### The error occurred while executing a query
### Cause: org.apache.ibatis.transaction.TransactionException: Error configuring
AutoCommit.  Your driver may not support getAutoCommit() or setAutoCommit(). Re
quested setting: false.  Cause: org.h2.jdbc.JdbcSQLException: Connection is brok
en: "unexpected status 16777216" [90067-176]
        at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(Exception
Factory.java:30)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(Defau
ltSqlSession.java:122)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(Defau
ltSqlSession.java:113)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(Defaul
tSqlSession.java:73)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(Defaul
tSqlSession.java:67)
        at org.activiti.engine.impl.db.DbSqlSession.getDbVersion(DbSqlSession.ja
va:1019)
        at org.activiti.engine.impl.db.DbSqlSession.dbSchemaCheckVersion(DbSqlSe
ssion.java:975)
        at org.activiti.engine.impl.db.DbSqlSession.performSchemaOperationsProce
ssEngineBuild(DbSqlSession.java:1476)
        at org.activiti.engine.impl.SchemaOperationsProcessEngineBuild.execute(S
chemaOperationsProcessEngineBuild.java:27)
        at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandIn
voker.java:24)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execut
e(CommandContextInterceptor.java:57)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterc
eptor.java:31)
        at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecu
torImpl.java:40)
        at org.activiti.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.j
ava:80)
        at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProc
essEngine(ProcessEngineConfigurationImpl.java:608)
        at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineF
actoryBean.java:60)
        at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineF
actoryBean.java:32)
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.
doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
        … 78 more
Caused by: org.apache.ibatis.transaction.TransactionException: Error configuring
AutoCommit.  Your driver may not support getAutoCommit() or setAutoCommit(). Re
quested setting: false.  Cause: org.h2.jdbc.JdbcSQLException: Connection is brok
en: "unexpected status 16777216" [90067-176]
        at org.apache.ibatis.transaction.jdbc.JdbcTransaction.setDesiredAutoComm
it(JdbcTransaction.java:109)
        at org.apache.ibatis.transaction.jdbc.JdbcTransaction.openConnection(Jdb
cTransaction.java:144)
        at org.apache.ibatis.transaction.jdbc.JdbcTransaction.getConnection(Jdbc
Transaction.java:62)
        at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.ja
va:315)
        at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExec
utor.java:75)
        at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java
:61)
        at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecuto
r.java:303)
        at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:154)
        at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java
:102)
        at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java
:82)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(Defau
ltSqlSession.java:120)
        … 94 more
Caused by: org.h2.jdbc.JdbcSQLException: Connection is broken: "unexpected statu
s 16777216" [90067-176]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
        at org.h2.message.DbException.get(DbException.java:178)
        at org.h2.message.DbException.get(DbException.java:154)
        at org.h2.engine.SessionRemote.done(SessionRemote.java:621)
        at org.h2.command.CommandRemote.prepare(CommandRemote.java:69)
        at org.h2.command.CommandRemote.<init>(CommandRemote.java:46)
        at org.h2.engine.SessionRemote.prepareCommand(SessionRemote.java:476)
        at org.h2.engine.SessionRemote.setAutoCommitSend(SessionRemote.java:249)

        at org.h2.engine.SessionRemote.setAutoCommit(SessionRemote.java:210)
        at org.h2.jdbc.JdbcConnection.setAutoCommit(JdbcConnection.java:431)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.ibatis.datasource.pooled.PooledConnection.invoke(PooledCon
nection.java:245)
        at com.sun.proxy.$Proxy18.setAutoCommit(Unknown Source)
        at org.apache.ibatis.transaction.jdbc.JdbcTransaction.setDesiredAutoComm
it(JdbcTransaction.java:104)
        … 104 more
set 02, 2016 12:49:20 PM org.apache.catalina.core.StandardContext startInternal
GRAVE: One or more listeners failed to start. Full details will be found in the
appropriate container log file
set 02, 2016 12:49:20 PM org.apache.catalina.core.StandardContext startInternal
GRAVE: Context [/activiti-explorer] startup failed due to previous errors
12:49:20,935 [localhost-startStop-1] INFO  org.activiti.explorer.servlet.WebConf
igurer  - Destroying Web application
set 02, 2016 12:49:20 PM org.apache.catalina.loader.WebappClassLoaderBase clearR
eferencesJdbc
GRAVE: The web application [/activiti-explorer] registered the JDBC driver [org.
h2.Driver] but failed to unregister it when the web application was stopped. To
prevent a memory leak, the JDBC Driver has been forcibly unregistered.
set 02, 2016 12:49:20 PM org.apache.catalina.loader.WebappClassLoaderBase clearR
eferencesJdbc
GRAVE: The web application [/activiti-explorer] registered the JDBC driver [org.
apache.ibatis.datasource.unpooled.UnpooledDataSource.DriverProxy] but failed to
unregister it when the web application was stopped. To prevent a memory leak, th
e JDBC Driver has been forcibly unregistered.
set 02, 2016 12:49:21 PM org.apache.catalina.startup.HostConfig deployWAR
INFORMAZIONI: Deployment of web application archive C:\Tomcat\apache-tomcat-7.0.
69\webapps\activiti-explorer.war has finished in 9,469 ms


Please help me to understand what is the right way to configure the mail server in activiti and what is my wrong.

Thanks in advance
Best regards
    Leo
4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
Changing the activiti-custom-context.xml is the right way. However, you have added the mail settings, but removed the database settings that should be in the process engine configuration. It falls back to the default in that case, and it can't find it.

If you look at https://github.com/Activiti/Activiti/blob/master/modules/activiti-webapp-explorer2/src/main/resource..., you can see it needs a dataSource injected there.

leostra
Champ in-the-making
Champ in-the-making
Thank you jbarrez!
I modify the activiti-custom-context.xml with the mail parameters and the datasource configuration and the mail task work!

But with this new configuration i have a lock database problem. If both activiti-rest and activiti-explorer are deployed, the first one works, the second one throws a "Database may be already in use: "Locked by another process". Follows the complete stacktrace:

<code>
10:29:38,082 [localhost-startStop-1] ERROR org.activiti.engine.impl.cfg.ProcessE
ngineConfigurationImpl  - Exception while initializing Database connection
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFact
ory (Database may be already in use: "Locked by another process". Possible solut
ions: close all other connection(s); use the server mode [90020-176])
        at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFacto
ry(BasicDataSource.java:1549)
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:1388)
        at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
.java:1044)
        at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(D
ataSourceUtils.java:111)
        at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$T
ransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:225
)
        at com.sun.proxy.$Proxy44.getMetaData(Unknown Source)
        at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initDatab
aseType(ProcessEngineConfigurationImpl.java:854)
        at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initDataS
ource(ProcessEngineConfigurationImpl.java:803)
        at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(Proc
essEngineConfigurationImpl.java:619)
        at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProc
essEngine(ProcessEngineConfigurationImpl.java:607)
        at org.activiti.spring.SpringProcessEngineConfiguration.buildProcessEngi
ne(SpringProcessEngineConfiguration.java:65)
        at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineF
actoryBean.java:60)
        at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineF
actoryBean.java:32)
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.
doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.
getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getObje
ctForBeanInstance(AbstractBeanFactory.java:1517)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:251)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:194)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$Bea
nMethodInterceptor$1.intercept(ConfigurationClassEnhancer.java:379)
        at org.activiti.spring.ProcessEngineFactoryBean$$EnhancerBySpringCGLIB$$
534ab69d.getObject(<generated>)
        at org.activiti.rest.conf.ActivitiEngineConfiguration.processEngine(Acti
vitiEngineConfiguration.java:82)
        at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringC
GLIB$$d13fa2e6.CGLIB$processEngine$5(<generated>)
        at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringC
GLIB$$d13fa2e6$$FastClassBySpringCGLIB$$4f088c1b.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.j
ava:228)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$Bea
nMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
        at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringC
GLIB$$d13fa2e6.processEngine(<generated>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy
.instantiate(SimpleInstantiationStrategy.java:162)
        at org.springframework.beans.factory.support.ConstructorResolver.instant
iateUsingFactoryMethod(ConstructorResolver.java:588)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:11
11)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1006)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:476)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:303)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:299)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:194)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$Bea
nMethodInterceptor.intercept(ConfigurationClassEnhancer.java:322)
        at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringC
GLIB$$d13fa2e6.processEngine(<generated>)
        at org.activiti.rest.conf.ActivitiEngineConfiguration.identityService(Ac
tivitiEngineConfiguration.java:138)
        at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringC
GLIB$$d13fa2e6.CGLIB$identityService$11(<generated>)
        at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringC
GLIB$$d13fa2e6$$FastClassBySpringCGLIB$$4f088c1b.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.j
ava:228)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$Bea
nMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
        at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringC
GLIB$$d13fa2e6.identityService(<generated>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy
.instantiate(SimpleInstantiationStrategy.java:162)
        at org.springframework.beans.factory.support.ConstructorResolver.instant
iateUsingFactoryMethod(ConstructorResolver.java:588)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:11
11)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1006)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:476)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:303)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:299)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:194)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.
findAutowireCandidates(DefaultListableBeanFactory.java:1120)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.
doResolveDependency(DefaultListableBeanFactory.java:1044)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.
resolveDependency(DefaultListableBeanFactory.java:942)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanP
ostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.j
ava:533)
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject
(InjectionMetadata.java:88)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanP
ostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java
:331)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:476)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:303)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:299)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:194)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactory.java:755)
        at org.springframework.context.support.AbstractApplicationContext.finish
BeanFactoryInitialization(AbstractApplicationContext.java:757)
        at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:480)
        at org.activiti.rest.servlet.WebConfigurer.contextInitialized(WebConfigu
rer.java:45)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
t.java:5068)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContex
t.java:5584)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:899)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:87
5)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)

        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092
)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:
1984)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.h2.jdbc.JdbcSQLException: Database may be already in use: "Locked
by another process". Possible solutions: close all other connection(s); use the
server mode [90020-176]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
        at org.h2.message.DbException.get(DbException.java:178)
        at org.h2.message.DbException.get(DbException.java:154)
        at org.h2.store.FileLock.getExceptionAlreadyInUse(FileLock.java:462)
        at org.h2.store.FileLock.lockFile(FileLock.java:356)
        at org.h2.store.FileLock.lock(FileLock.java:136)
        at org.h2.engine.Database.open(Database.java:622)
        at org.h2.engine.Database.openDatabase(Database.java:260)
        at org.h2.engine.Database.<init>(Database.java:254)
        at org.h2.engine.Engine.openSession(Engine.java:57)
        at org.h2.engine.Engine.openSession(Engine.java:164)
        at org.h2.engine.Engine.createSessionAndValidate(Engine.java:142)
        at org.h2.engine.Engine.createSession(Engine.java:125)
        at org.h2.engine.Engine.createSession(Engine.java:27)
        at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.jav
a:331)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:107)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:91)
        at org.h2.Driver.connect(Driver.java:74)
        at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(Driv
erConnectionFactory.java:38)
        at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(Poolable
ConnectionFactory.java:582)
        at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas
icDataSource.java:1556)
        at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFacto
ry(BasicDataSource.java:1545)
        … 91 more
10:29:43,939 [localhost-startStop-1] ERROR org.activiti.engine.impl.interceptor.
CommandContext  - masked exception in command context. for root cause, see below
as it will be rethrown later.
org.springframework.transaction.CannotCreateTransactionException: Could not open
JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQ
LNestedException: Cannot create PoolableConnectionFactory (Database may be alrea
dy in use: "Locked by another process". Possible solutions: close all other conn
ection(s); use the server mode [90020-176])
        at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBe
gin(DataSourceTransactionManager.java:245)
        at org.springframework.transaction.support.AbstractPlatformTransactionMa
nager.getTransaction(AbstractPlatformTransactionManager.java:373)
        at org.activiti.spring.SpringTransactionContext.rollback(SpringTransacti
onContext.java:64)
        at org.activiti.engine.impl.interceptor.CommandContext.close(CommandCont
ext.java:174)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execut
e(CommandContextInterceptor.java:66)
        at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(Sp
ringTransactionInterceptor.java:47)
        at org.springframework.transaction.support.TransactionTemplate.execute(T
ransactionTemplate.java:133)
        at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransa
ctionInterceptor.java:45)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterc
eptor.java:31)
        at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecu
torImpl.java:40)
        at org.activiti.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.j
ava:80)
        at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProc
essEngine(ProcessEngineConfigurationImpl.java:608)
        at org.activiti.spring.SpringProcessEngineConfiguration.buildProcessEngi
ne(SpringProcessEngineConfiguration.java:65)
        at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineF
actoryBean.java:60)
        at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineF
actoryBean.java:32)
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.
doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.
getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getObje
ctForBeanInstance(AbstractBeanFactory.java:1517)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:251)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:194)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$Bea
nMethodInterceptor$1.intercept(ConfigurationClassEnhancer.java:379)
        at org.activiti.spring.ProcessEngineFactoryBean$$EnhancerBySpringCGLIB$$
534ab69d.getObject(<generated>)
        at org.activiti.rest.conf.ActivitiEngineConfiguration.processEngine(Acti
vitiEngineConfiguration.java:82)
        at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringC
GLIB$$d13fa2e6.CGLIB$processEngine$5(<generated>)
        at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringC
GLIB$$d13fa2e6$$FastClassBySpringCGLIB$$4f088c1b.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.j
ava:228)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$Bea
nMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
        at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringC
GLIB$$d13fa2e6.processEngine(<generated>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy
.instantiate(SimpleInstantiationStrategy.java:162)
        at org.springframework.beans.factory.support.ConstructorResolver.instant
iateUsingFactoryMethod(ConstructorResolver.java:588)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:11
11)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1006)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:476)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:303)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:299)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:194)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$Bea
nMethodInterceptor.intercept(ConfigurationClassEnhancer.java:322)
        at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringC
GLIB$$d13fa2e6.processEngine(<generated>)
        at org.activiti.rest.conf.ActivitiEngineConfiguration.identityService(Ac
tivitiEngineConfiguration.java:138)
        at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringC
GLIB$$d13fa2e6.CGLIB$identityService$11(<generated>)
        at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringC
GLIB$$d13fa2e6$$FastClassBySpringCGLIB$$4f088c1b.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.j
ava:228)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$Bea
nMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
        at org.activiti.rest.conf.ActivitiEngineConfiguration$$EnhancerBySpringC
GLIB$$d13fa2e6.identityService(<generated>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy
.instantiate(SimpleInstantiationStrategy.java:162)
        at org.springframework.beans.factory.support.ConstructorResolver.instant
iateUsingFactoryMethod(ConstructorResolver.java:588)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:11
11)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1006)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:476)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:303)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:299)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:194)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.
findAutowireCandidates(DefaultListableBeanFactory.java:1120)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.
doResolveDependency(DefaultListableBeanFactory.java:1044)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.
resolveDependency(DefaultListableBeanFactory.java:942)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanP
ostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.j
ava:533)
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject
(InjectionMetadata.java:88)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanP
ostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java
:331)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:476)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:303)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:299)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:194)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactory.java:755)
        at org.springframework.context.support.AbstractApplicationContext.finish
BeanFactoryInitialization(AbstractApplicationContext.java:757)
        at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:480)
        at org.activiti.rest.servlet.WebConfigurer.contextInitialized(WebConfigu
rer.java:45)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
t.java:5068)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContex
t.java:5584)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:899)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:87
5)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)

        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092
)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:
1984)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableCon
nectionFactory (Database may be already in use: "Locked by another process". Pos
sible solutions: close all other connection(s); use the server mode [90020-176])

        at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFacto
ry(BasicDataSource.java:1549)
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:1388)
        at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
.java:1044)
        at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBe
gin(DataSourceTransactionManager.java:204)
        … 93 more
Caused by: org.h2.jdbc.JdbcSQLException: Database may be already in use: "Locked
by another process". Possible solutions: close all other connection(s); use the
server mode [90020-176]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
        at org.h2.message.DbException.get(DbException.java:178)
        at org.h2.message.DbException.get(DbException.java:154)
        at org.h2.store.FileLock.getExceptionAlreadyInUse(FileLock.java:462)
        at org.h2.store.FileLock.lockFile(FileLock.java:356)
        at org.h2.store.FileLock.lock(FileLock.java:136)
        at org.h2.engine.Database.open(Database.java:622)
        at org.h2.engine.Database.openDatabase(Database.java:260)
        at org.h2.engine.Database.<init>(Database.java:254)
        at org.h2.engine.Engine.openSession(Engine.java:57)
        at org.h2.engine.Engine.openSession(Engine.java:164)
        at org.h2.engine.Engine.createSessionAndValidate(Engine.java:142)
        at org.h2.engine.Engine.createSession(Engine.java:125)
        at org.h2.engine.Engine.createSession(Engine.java:27)
        at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.jav
a:331)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:107)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:91)
        at org.h2.Driver.connect(Driver.java:74)
        at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(Driv
erConnectionFactory.java:38)
        at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(Poolable
ConnectionFactory.java:582)
        at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas
icDataSource.java:1556)
        at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFacto
ry(BasicDataSource.java:1545)
        … 96 more
</code>

Is it possible deploy the explorer and rest web application together in the same Tomcat container? I need to work with the rest api and explorer at the same time. For completeness i attach my activiti-custom-context.xml file:

<code>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
  xmlns:jee="http://www.springframework.org/schema/jee" xmlns:aop="http://www.springframework.org/schema/aop"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
       http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
      
  <bean id="dbProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="location" value="classpath:db.properties" />
    <property name="ignoreUnresolvablePlaceholders" value="true" />
  </bean>
   
  <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName" value="${jdbc.driver}" />
    <property name="url" value="${jdbc.url}" />
    <property name="username" value="${jdbc.username}" />
    <property name="password" value="${jdbc.password}" />
    <property name="defaultAutoCommit" value="false" />
  </bean>

  <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
   <property name="dataSource" ref="dataSource" />
  </bean>
 
  <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
   <property name="dataSource" ref="dataSource" />
   <property name="transactionManager" ref="transactionManager" />
   <property name="databaseSchemaUpdate" value="true" />
   <property name="jobExecutorActivate" value="true" />
   <property name="enableDatabaseEventLogging" value="true" />
<property name="mailServerHost" value="mailserver" />
<property name="mailServerPort" value="25" />
<property name="mailServerUseSSL" value="false" />
<property name="mailServerUseTLS" value="false" />
<property name="mailServerDefaultFrom" value="activiti@activiti.org" />
<property name="mailServerUsername" value="username" />
<property name="mailServerPassword" value="password" /> 
  </bean>
</beans>
</code>

Any suggestion will be appreciated.
thanks in advance
regards
    Leo

leostra
Champ in-the-making
Champ in-the-making
Hi All,
i replaced the H2 database installation with an external mysql instance and now this error disappear and the two web application are in running at the same time.

Then i think the problem was related to H2 settings or limitation.

Thanks
    Leo

jbarrez
Star Contributor
Star Contributor
> Then i think the problem was related to H2 settings or limitation.

That sounds very odd, and it is not related in any way. But glad it is working for you now!