cancel
Showing results for 
Search instead for 
Did you mean: 

Could not instantiate bean class JobExecutor

coincoin
Champ in-the-making
Champ in-the-making
Hi.

I have some problems when i try to configure my jobExecutor. I found some topics on this forum which helped me.

I have modified my activiti-explorer\WEB-INF\applicationContext.xml like this:

<?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"
   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">
      
  <bean id="dbProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="location" value="classpath:db.properties" />
    <!– Allow other PropertyPlaceholderConfigurer to run as well –>
    <property name="ignoreUnresolvablePlaceholders" value="true"/>
  </bean>

  <bean id="demoDataGenerator" class="org.activiti.explorer.demo.DemoDataGenerator">
    <property name="processEngine" ref="processEngine" />
  </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="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property name="url" value="jdbc:mysql://localhost:3306/activiti?autoReconnect=true" />
    <property name="username" value="activiti" />
    <property name="password" value="activiti" />
     <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="jobExecutor" ref="jobExecutor" />
   
   <property name="mailServerHost" value="****" />
    <property name="mailServerPort" value="25" />
   <property name="mailServerUsername" value="*****" />
  </bean>
 
  <bean id="jobExecutor" class="org.activiti.engine.impl.jobexecutor.JobExecutor">
   <property name="maxJobsPerAcquisition" value="10" />
   <property name="waitTimeInMillis" value="10000" />
   <property name="lockTimeInMillis" value="3600000"/>
  </bean>
 
  <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean" destroy-method="destroy">
     <property name="processEngineConfiguration" ref="processEngineConfiguration" />
  </bean>
 
  <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
  <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
  <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
  <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
  <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
  <bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService" />
 
  <bean id="activitiLoginHandler" class="org.activiti.explorer.ui.login.DefaultLoginHandler">
    <property name="identityService" ref="identityService" />
  </bean>
 
  <!– Include the UI-related wiring. This UI context will be used in the alfresco activiti admin UI –>
  <import resource="activiti-ui-context.xml" />
 
  <!–  Custom form types –>
  <bean id="userFormType" class="org.activiti.explorer.form.UserFormType"/>
   
</beans>

When I start Tomcat, I have a BeanCreationException with the following message:
Could not instantiate bean class org.activiti.engine.impl.jobexecutor.JobExecutor. Is it an abastract class?

What did I do wrong?

Thanks for your help.
2 REPLIES 2

dguggi
Champ in-the-making
Champ in-the-making
this shouldn't be too hard to check Smiley Wink but yes it is abstract you may want to use DefaultJobExecutor ?

coincoin
Champ in-the-making
Champ in-the-making
I checked in the javadocs before to post but i didnt see that it is abstract: http://activiti.org/javadocs/org/activiti/engine/impl/jobexecutor/JobExecutor.html

Thank you for your answer everything is ok now.

Have a nice day.