cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Activiti CDI libraries

frank41
Champ in-the-making
Champ in-the-making
Hi all !
I'm trying to port the activiti-explorer application on JBoss AS 7.1.1, so looking at the docs I have created the following applicationContext.xml configuration:
<?xml version="1.0" encoding="UTF-8"?>
<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">

   <!– activiti configuration for jboss AS 7 –>

   <!– lookup the JTA-Transaction manager –>
   <bean id="transactionManager" class="org.springframework.jndi.JndiObjectFactoryBean">
      <property name="jndiName" value="java:jboss/TransactionManager"></property>
      <property name="resourceRef" value="true" />
   </bean>

   <!– process engine configuration –>
   <bean id="processEngineConfiguration" class="org.activiti.cdi.CdiJtaProcessEngineConfiguration">
      <property name="dataSourceJndiName" value="java:jboss/datasources/ExampleDS" />
      <property name="databaseType" value="h2" />
      <property name="transactionManager" ref="transactionManager" />
      <property name="transactionsExternallyManaged" value="true" />
      <property name="databaseSchemaUpdate" value="true" />
   </bean>

</beans>
When deploying the web application however, the deployer issues an error with the CdiJtaProcessEngineConfiguration. However I couldn't find any reference to this class in the activiti5.9 jars:

10:42:15,191 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/activiti-explorer]] (MSC service thread 1-4) Exception sending context initialized event to listener instance of class org.springframework.web.context.C
ontextLoaderListener: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.activiti.cdi.CdiJtaProcessEngineConfiguration] for
bean with name 'processEngineConfiguration' defined in ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: org.activiti.cdi.CdiJtaProcessEngineConfiguration from [Module "deployme
nt.activiti-explorer.war:main" from Service Module Loader]

Any idea how could I fix it ??
Thanks
Frank
5 REPLIES 5

frank41
Champ in-the-making
Champ in-the-making
Well I have picked activiti-cdi.jar using Maven, however now the issue is:

11:42:48,567 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) {"JBAS014653: Composite operation failed and was rolled back. Steps
that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"activiti-explorer.war\".WeldService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"activiti-explorer.war\".Wel
dService: org.jboss.weld.exceptions.DeploymentException: Exception List with 1 exceptions:
Exception 0 :
org.activiti.engine.ActivitiException: Could not find an implementation of the org.activiti.cdi.spi.ProcessEngineLookup service returning a non-null processEngine. Giving up.

I've added a class to my web application:
public class ProcessEngineConfiguration extends LocalProcessEngineLookup {
}
however it didn't solve the issue. Any help ?
Thanks

meyerd
Champ on-the-rise
Champ on-the-rise
Hi frank41,

have a look at this: https://bitbucket.org/meyerd/activiti-cdi-jbossas7.1.1-setup

it demonstrates how to setup activiti-cdi on jboss as 7.1.1

meyerd
Champ on-the-rise
Champ on-the-rise
If you want to use Spring to lookup the JNDI resources, you need

  <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>3.1.0.RELEASE</version>
    </dependency>

ryanj1
Champ in-the-making
Champ in-the-making
Daniel, et al,

Much like frank41, I'm attempting to configure Activiti CDI on a bare bones JBoss 7.1.1 instance, i.e. not the modified Camunda Fox CE product, and I'm invariably getting the same error he reported earlier in this thread, that being the following:

"Could not find an implementation of the org.activiti.cdi.spi.ProcessEngineLookup service returning a non-null processEngine."

I started by porting the Activiti Explorer over to JBoss 7.1.1 from Tomcat, which of course was quite easy. My custom processes leveraging JPA as well as my Spring managed dependency injections all worked very well. However, I started running into significant issues when I started to try to leverage the Activiti CDI functionality. I started by making changes consistent with your guidance from  https://bitbucket.org/meyerd/activiti-cdi-jbossas7.1.1-setup. When my initial changes didn't work, I simplified my file and made it very similar to yours, but I'm still getting the error above. NOTE: In an effort to troubleshoot the problem, I even replicated my "applicationContext.xml" file (which is shown below), putting it into the classpath as "activiti.cfg.xml", which theoretically should get picked up by the LocalProcessEngineLookup class - unfortunately to no avail. It appears I just haven't been able to piece together a good understanding of the Activiti CDI module based on the information available, but I think I'm just missing one or two pieces of data.

Can you point me in the right direction toward a resolution? I would certainly, greatly appreciate any help you can provide. Thanks in advance.

-Ryan

applicationContext.xml
—————————
<?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="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
     <property name="driverClass" value="${jdbc.driver}" />
     <property name="url" value="${jdbc.url}" />
     <property name="username" value="${jdbc.username}" />
     <property name="password" value="${jdbc.password}" />
   </bean>
  
   <bean id="transactionManager" class="org.springframework.jndi.JndiObjectFactoryBean">
     <property name="jndiName" value="java:jboss/TransactionManager"></property>
     <property name="resourceRef" value="true" />
   </bean>
 
   <bean id="processEngineConfiguration" class="org.activiti.cdi.CdiJtaProcessEngineConfiguration">
    <property name="dataSource" ref="dataSource" />
    <property name="databaseType" value="h2" />
    <property name="transactionManager" ref="transactionManager" />
    <property name="transactionsExternallyManaged" value="true" />
    <property name="databaseSchemaUpdate" value="true" />  
   </bean>
 
   <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean" destroy-method="destroy">
    <property name="processEngineConfiguration" ref="processEngineConfiguration" />
   </bean>
 
   <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" />

</beans>

mghb2009
Champ in-the-making
Champ in-the-making
hi
how to develop in Apache tomcat?