cancel
Showing results for 
Search instead for 
Did you mean: 

Bean creation fails on mysql configuration

marko
Champ in-the-making
Champ in-the-making
Hey everybody,

I'm trying to use a mysql-database for Activiti BMPN.
For the Configurations I refer to the Activiti Guide.


<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />

</bean>


<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
            <property name="driverClassName" value="com.mysql.jdbc.Driver" />
            <property name="url" value="jdbc:mysql://localhost:3306/activiti" />
            <property name="username" value="root" />
            <property name="password" value="root" />
            <property name="defaultAutoCommit" value="false" />
        </bean>

   <bean id="processEngineConfiguration"
      class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">

      <property name="dataSource" ref="dataSource" />
      <property name="transactionManager" ref="transactionManager" />
      <property name="databaseSchemaUpdate" value="true" />
      <property name="jobExecutorActivate" value="true" />
   </bean>


The corresponding jar-files are located in: /WebContent/WEB-INF/lib/…
(Commons-dbcp-1.4.jar)

If I try to compile my project, I will get some error messages.


13:40:46,696 SEVERE [org.activiti.engine.ProcessEngines] (MSC service thread 1-3) Exception while initializing process engine :Error creating bean with name 'processEngineConfiguration' defined in resource loaded through InputStream: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in resource loaded through InputStream: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/ObjectPool: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngineConfiguration' defined in resource loaded through InputStream: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in resource loaded through InputStream: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/ObjectPool


Can you help me?
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
The "org/apache/commons/pool/ObjectPool" cannot be found.

You're using a commons-pool datasource but don't have the dependency on you're class path. Either set it as a dependency of your project in it's pom (or whatever dependency-management you're using) , adding it to the class path of your java-app.