cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti CDI not working on JBoss 7.1

akhan1
Champ in-the-making
Champ in-the-making
Hi,

I am trying to setting up activiti-cdi on JBoss 7.1 according to the manual http://activiti.org/userguide/#cdiintegration
But everytime when I deploy the application, it fails with following log entry:

INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "app.war" was rolled back with failure message Operation cancelled
ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015052: Did not receive a response to the deployment operation within the allowed timeout period [60 seconds]. Check the server configuration file and the server logs to find more about the status of the deployment.

Even if i increase the "deployment-timeout" for deployment-scanner, same behaviour.
After the failed deployment, it is not possible, to stop JBoss with Ctrl+C, only "kill -9" works.

Has someone successfully set up activiti-cdi on jboss 7.1.1 or 7.1.0 and can give me a hint?

Thanks
8 REPLIES 8

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

Based on the information you provide I cannot say what the problem is.
Can you provide more details about your setup and the failure? Does Jboss log a stacktrace?

akhan1
Champ in-the-making
Champ in-the-making
Hi Daniel,

my setup is very simple:

activiti.cfg.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"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

<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="dataSourceJndiName" value="java:jboss/datasources/ActivitiDS" />
  <property name="databaseType" value="mysql" />
  <property name="transactionManager" ref="transactionManager" />
  <property name="transactionsExternallyManaged" value="true" />
  <property name="databaseSchemaUpdate" value="true" />
</bean>

</beans>
The datasource is configured properly in standalone.xml

import org.activiti.cdi.impl.LocalProcessEngineLookup;

public class ProcessEngineConfiguration extends LocalProcessEngineLookup {
}

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>app</groupId>
  <artifactId>app</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
 
<build>
  <resources>
   <resource>
    <directory>src/main/java</directory>
     <includes>
     <include>**/*.*</include>
    </includes>
   </resource>
   <resource>
    <directory>src/main/resources</directory>
    <filtering>true</filtering>
    <includes>
     <include>activiti.cfg.xml</include>
    </includes>
   </resource>
  </resources>

  <pluginManagement>
   <plugins>
    <plugin>
     <artifactId>maven-compiler-plugin</artifactId>
     <configuration>
      <source>1.6</source>
      <target>1.6</target>
      <encoding>UTF-8</encoding>
      <deprecation>true</deprecation>
      <debug>true</debug>
     </configuration>
    </plugin>
    <plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-war-plugin</artifactId>
     <version>2.2</version>
     <configuration>
      <archive>
                    <manifestEntries>
                       <Dependencies>org.apache.log4j, org.activiti.engine, org.activiti.cdi</Dependencies>
                    </manifestEntries> 
                 </archive>
      <warName>app</warName>
      <warSourceIncludes>WEB-INF/**,*.html,*.xml,META-INF/**</warSourceIncludes>
      <archiveClasses>false</archiveClasses>
     </configuration>
    </plugin>
   </plugins>
  </pluginManagement>   
  </build>
 
  <repositories>
    <repository>
      <id>Activiti</id>
      <url>http://maven.alfresco.com/nexus/content/repositories/activiti</url>
    </repository>
  </repositories>

<properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
 
  <dependencies>
<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-context</artifactId>
  <version>3.1.0.RELEASE</version>
</dependency>
 
    <dependency>
      <groupId>org.activiti</groupId>
      <artifactId>activiti-engine</artifactId>
      <version>5.9</version>
      <scope>provided</scope>
    </dependency>
   
    <dependency>
      <groupId>org.activiti</groupId>
      <artifactId>activiti-cdi</artifactId>
      <version>5.9</version>
    </dependency>
<dependency>
  <groupId>javax</groupId>
  <artifactId>javaee-api</artifactId>
  <version>6.0</version>
  <type>jar</type>
  <scope>provided</scope>
</dependency>
</dependencies>
</project>


This is the log output of jboss, there is no stacktrace:
INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "app.war"
WARN  [org.jboss.as.dependency.private] (MSC service thread 1-3) JBAS018567: Deployment "deployment.app.war" is using a private module ("org.apache.log4j:main") which may be changed or removed in future versions without notice.
INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016002: Processing weld deployment app.war
INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016005: Starting Services for CDI deployment: app.war
INFO  [org.jboss.weld.Version] (MSC service thread 1-2) WELD-000900 1.1.5 (AS71)
INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016008: Starting weld service for deployment app.war
INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "app.war" was rolled back with failure message Operation cancelled
ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015052: Did not receive a response to the deployment operation within the allowed timeout period [180 seconds]. Check the server configuration file and the server logs to find more about the status of the deployment.


This is a thread dump forced with kill -QUIT:
"MSC service thread 1-2" prio=10 tid=0x00007f8ff8002000 nid=0x3be7 in Object.wait() [0x00007f902cb4d000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x00000000f6908390> (a org.jboss.modules.Module)
        at java.lang.Object.wait(Object.java:503)
        at org.jboss.modules.Module.getPaths(Module.java:1141)
        - locked <0x00000000f6908390> (a org.jboss.modules.Module)
        at org.jboss.modules.Module.getPathsUnchecked(Module.java:1164)
        at org.jboss.modules.Module.loadModuleClass(Module.java:512)
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)
        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)
        at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)
        at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)
        at org.jboss.modules.Module.loadModuleClass(Module.java:517)
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
        at java.lang.Class.getDeclaredMethods(Class.java:1808)
        at org.jboss.weld.util.reflection.SecureReflections$8.work(SecureReflections.java:172)
        at org.jboss.weld.util.reflection.SecureReflections$8.work(SecureReflections.java:169)
        at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
        at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63)
        at org.jboss.weld.util.reflection.SecureReflections.getDeclaredMethods(SecureReflections.java:169)
        at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:233)
        at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118)
        at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:49)
        at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:40)
        at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:355)
        at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184)
        - locked <0x00000000f76ac018> (a com.google.common.collect.MapMakerInternalMap$StrongEntry)
        at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153)
        at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69)
        at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:393)
        at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:149)
        at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86)
        at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115)
        at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:171)
        at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:336)
        - locked <0x00000000f6f6faf0> (a org.jboss.weld.bootstrap.WeldBootstrap)
        at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82)
        - locked <0x00000000f6eb6ff8> (a org.jboss.as.weld.WeldContainer)
        at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)


Thanks
Akhan

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

at first sight your setup looks ok.

I haven't actually tested with 7.1.1 yet, doing that now.

meyerd
Champ on-the-rise
Champ on-the-rise
Why is activiti-engine provided?

meyerd
Champ on-the-rise
Champ on-the-rise

meyerd
Champ on-the-rise
Champ on-the-rise
Better yet:
use our pre-configured jboss as 7 from camunda fox community edition:

http://www.camunda.com/fox/community/download/

Here is an example of an application which uses activiti cdi on camunda fox:
https://bitbucket.org/camunda/fox-platform-ce/src/f5fda0dd50ee/examples/cdi-jsf-task-management

If you download the distribution form the link provided above, the example is pre-deployed to Jboss AS and the sources are also included.

akhan1
Champ in-the-making
Champ in-the-making
Hi Daniel,

I just downloaded your sample code and now it works, great, thanks!
My problem was, that i had included activiti additionally as module dependency:
<manifestEntries>
    <Dependencies>org.apache.log4j, org.activiti.engine, org.activiti.cdi</Dependencies>
</manifestEntries> 
Now I'm going to have a look at camunda fox …

Regards
Akhan

meyerd
Champ on-the-rise
Champ on-the-rise
You should be able to deploy activiti-engine as a module but not activiti-cdi, since it needs to be added as a bean archive to the weld deployment. For that to happen it needs to be included as a library in you application (AFAIK).