AnsweredAssumed Answered

Spring roo and Activiti

Question asked by pacozf on Dec 22, 2015
Hi,

I try to add Activiti Process Engine to my Spring Roo project. This is part of my pom.xml:


..
<spring.version>3.2.8.RELEASE</spring.version>


<dependencies>
      <!– Dependencies for Activiti integration –>
       <dependency>
         <groupId>org.activiti</groupId>
         <artifactId>activiti-engine</artifactId>
         <version>5.19.0.1</version>
      </dependency>
      <dependency>
         <groupId>org.activiti</groupId>
         <artifactId>activiti-spring</artifactId>
         <version>5.19.0.1</version>
      </dependency>

<!– Spring dependencies –>
      <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-core</artifactId>
         <version>${spring.version}</version>
         <exclusions>
            <exclusion>
               <groupId>commons-logging</groupId>
               <artifactId>commons-logging</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-test</artifactId>
         <version>${spring.version}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-context</artifactId>
         <version>${spring.version}</version>
      </dependency>
      <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-aop</artifactId>
         <version>${spring.version}</version>
      </dependency>
      <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-aspects</artifactId>
         <version>${spring.version}</version>
      </dependency>

      <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-context-support</artifactId>
         <version>${spring.version}</version>
      </dependency>
<dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-jdbc</artifactId>
         <version>${spring.version}</version>
      </dependency>
      <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-orm</artifactId>
         <version>${spring.version}</version>
      </dependency>
<dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-webmvc</artifactId>
         <version>${spring.version}</version>
      </dependency>
      <dependency>
         <groupId>org.springframework.webflow</groupId>
         <artifactId>spring-js-resources</artifactId>
         <version>2.2.1.RELEASE</version>
      </dependency>
…..


This is part of the applicationContext.xml:

         <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
      <property name="dataSource" ref="dataSource" />
      <property name="databaseSchemaUpdate" value="true" />
      <property name="transactionManager" ref="transactionManager" />
      <property name="jpaHandleTransaction" value="false" />
      <property name="jpaCloseEntityManager" value="false" />
      <property name="jobExecutorActivate" value="false" />
   </bean>
   <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
      <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" />



When I deploy the generated war in tomcat y get this error:

ERROR org.springframework.web.context.ContextLoader - Context initialization failed
java.lang.NoClassDefFoundError: org/springframework/core/OrderComparator$OrderSourceProvider
   at org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:194)
   at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:127)


I can resolve this issue upgrading the spring-core lib to 4.1.1.RELEASE. But after I have started my application, when I try to view a jsp with 'form:select' tag, a get this error:

java.lang.ClassNotFoundException: org.springframework.core.enums.LabeledEnum 


This is because spring-core 4.1.1.RELEASE have not this class.

Then, I am thinking if there is some way to configure spring roo with activiti, because if I try to upgrade spring-core lib to avoid java.lang.ClassNotFoundException: org.springframework.core.OrderComparator then I get a java.lang.ClassNotFoundException: org.springframework.core.enums.LabeledEnum .


Outcomes