cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Error during configuring jobExecutor Properties

sharad
Champ in-the-making
Champ in-the-making
I am getting following error during setting configuration parameter for job Executor in activiti

Feb 14, 2014 5:07:26 PM org.activiti.engine.ProcessEngines init
INFO: Initializing process engine using configuration 'file:/C:/Users/administrator/workspace/Activiti/target/classes/activiti.cfg.xml'
Feb 14, 2014 5:07:26 PM org.activiti.engine.ProcessEngines initProcessEnginFromResource
INFO: initializing process engine for resource file:/C:/Users/administrator/workspace/Activiti/target/classes/activiti.cfg.xml
Feb 14, 2014 5:07:26 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from resource loaded through InputStream
Feb 14, 2014 5:07:27 PM org.activiti.engine.ProcessEngines initProcessEnginFromResource
SEVERE: Exception while initializing process engine: Error creating bean with name 'processEngineConfiguration' defined in resource loaded through InputStream: Cannot resolve reference to bean 'jobExecutorBean' while setting bean property 'jobExecutor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobExecutorBean' defined in resource loaded through InputStream: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.activiti.engine.impl.jobexecutor.JobExecutor]: Is it an abstract class?; nested exception is java.lang.InstantiationException
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngineConfiguration' defined in resource loaded through InputStream: Cannot resolve reference to bean 'jobExecutorBean' while setting bean property 'jobExecutor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobExecutorBean' defined in resource loaded through InputStream: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.activiti.engine.impl.jobexecutor.JobExecutor]: Is it an abstract class?; nested exception is java.lang.InstantiationException
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
   at org.activiti.engine.impl.cfg.BeansConfigurationHelper.parseProcessEngineConfiguration(BeansConfigurationHelper.java:36)
   at org.activiti.engine.impl.cfg.BeansConfigurationHelper.parseProcessEngineConfigurationFromInputStream(BeansConfigurationHelper.java:43)
   at org.activiti.engine.ProcessEngineConfiguration.createProcessEngineConfigurationFromInputStream(ProcessEngineConfiguration.java:193)
   at org.activiti.engine.ProcessEngineConfiguration.createProcessEngineConfigurationFromInputStream(ProcessEngineConfiguration.java:189)
   at org.activiti.engine.ProcessEngines.buildProcessEngine(ProcessEngines.java:193)
   at org.activiti.engine.ProcessEngines.initProcessEnginFromResource(ProcessEngines.java:167)
   at org.activiti.engine.ProcessEngines.init(ProcessEngines.java:98)
   at org.activiti.engine.ProcessEngines.getProcessEngine(ProcessEngines.java:224)
   at org.activiti.engine.ProcessEngines.getDefaultProcessEngine(ProcessEngines.java:217)
   at activitiMain.main(activitiMain.java:42)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobExecutorBean' defined in resource loaded through InputStream: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.activiti.engine.impl.jobexecutor.JobExecutor]: Is it an abstract class?; nested exception is java.lang.InstantiationException
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:997)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:943)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
   … 19 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.activiti.engine.impl.jobexecutor.JobExecutor]: Is it an abstract class?; nested exception is java.lang.InstantiationException
   at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:150)
   at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:76)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)
   … 27 more
Caused by: java.lang.InstantiationException
   at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
   at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)




Here activiti.cfg.xml file info this given below

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans.xsd">


  <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
… 
..
…   
   
    <property name="databaseSchemaUpdate" value="true" />
   
    <property name="jobExecutorActivate" value="true" />
   
   <property name="jobExecutor" ref="jobExecutorBean" />       
  </bean>

<bean id="jobExecutorBean" class="org.activiti.engine.impl.jobexecutor.JobExecutor">
   <property name="maxJobsPerAcquisition" value="10" />
   <property name="waitTimeInMillis" value="10000" />
</bean>

</beans>

Please provide suggest for fixing this issue.
2 REPLIES 2

sharad
Champ in-the-making
Champ in-the-making
Activiti.cfg.xml file is given below

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans.xsd">


  <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
 
   <property name="databaseType" value="mssql" />
 
    <property name="jdbcUrl" value="jdbc:sqlserver://sqlserverhost" />
    <property name="jdbcDriver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
    <property name="jdbcUsername" value="sa" />
    <property name="jdbcPassword" value="" />
   
   
    <property name="databaseSchemaUpdate" value="true" />
   
    <property name="jobExecutorActivate" value="true" />
   
<property name="jobExecutor" ref="jobExecutorBean" />       
  </bean>

<bean id="jobExecutorBean" class="org.activiti.engine.impl.jobexecutor.JobExecutor">
<property name="maxJobsPerAcquisition" value="10" />
<property name="waitTimeInMillis" value="10000" />
</bean>

</beans>

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi.


Could not instantiate bean class [org.activiti.engine.impl.jobexecutor.JobExecutor]: Is it an abstract class?; nested exception is java.lang.InstantiationException

JobExecutor is abstract. Use e.g. org.activiti.engine.impl.jobexecutor.DefaultJobExecutor instead.

Regards
Martin