Deploy Activiti Process Explorer on JBoss AS 7

The Activiti process explorer is an handy web application which can be used to manage your processes. It is located into your apps\apache-tomcat-6.0.32\webapps path of your Activiti installation.

In order to enable the deployment of this application on JBoss AS 7 you have:
1) Rename the folder as activiti-explorer.war (so that the AS7 deployer will target is as a web application)

2) Open the applicationContext.xml file which is located in the WEB-INF path of your application and modify it so that it looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""
    xmlns:xsi="" xmlns:context=""
    xmlns:tx="" xmlns:jee=""

    <bean id="dbProperties"
        <property name="location" value="" />

        <property name="ignoreUnresolvablePlaceholders" value="true" />

    <bean id="demoDataGenerator" class="org.activiti.explorer.demo.DemoDataGenerator">
        <property name="processEngine" ref="processEngine" />

    <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="kermit" />
        <property name="password" value="kermit" />
        <property name="defaultAutoCommit" value="false" />

    <bean id="transactionManager"
        <property name="dataSource" ref="dataSource" />

    <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
        <property name="dataSource" ref="dataSource" />
        <property name="mailServerHost" value="localhost" />
        <property name="mailServerPort" value="25" />
        <property name="mailServerUsername" value="fmarchioni" />
        <property name="mailServerPassword" value="fmarchioni" />
        <property name="transactionManager" ref="transactionManager" />
        <property name="databaseSchemaUpdate" value="true" />
        <property name="jobExecutorActivate" value="true" />
        <property name="customFormTypes">
                <ref bean="userFormType" />

    <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean"
        <property name="processEngineConfiguration" ref="processEngineConfiguration" />

    <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" />

    <import resource="activiti-ui-context.xml" />

    <bean id="userFormType" class="org.activiti.explorer.form.UserFormType" />


Please notice the Datasource section, which contains the MySql settings for the dataSource Bean. In this case, the simplest way to achieve this is to use the org.apache.commons.dbcp.BasicDataSource.


Using JBoss AS Datasource

If you don't have to use Apache connection pool and rather want to use JBoss own datasource you have to do a bit more of work, as it will require installing Activiti CDI libraries as well: at first create a datasource on jBoss AS as described in this tutorial:
Then, comment the dataSource bean definition. Instead of it, you will have to reference the datasource through the processEngineConfiguration as shown here:

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

  <bean id="transactionManager" class="org.springframework.jndi.JndiObjectFactoryBean">
      <property name="jndiName" value="java:jboss/TransactionManager"></property>
      <property name="resourceRef" value="true" />

If you try to deploy the Activiti Explorer with this configuration, the deployer will complain that cannot find the java.lang.ClassNotFoundException: org.activiti.cdi.CdiJtaProcessEngineConfigurationNext. As a matter of fact, the new process engine configuration will require CDI dependencies. They are not included in the default Activiti distribution, you have to pick them up using Maven, with the following dependencies:


Finally, once the application is started up, the activiti-cdi.jar will try to boot the process engine. To accomplish this it will lookup a bean implementing the "ProcessEngineLookup" interface. You will have to provide one, extending LocalProcessEngine lookup, which will create a spring-configured process engine:

public class ProcessEngineConfiguration extends LocalProcessEngineLookup {

Well, that was a bit lenghty procedure, however if you want to learn more about it, we suggest you looking at this repository which shows how to set up Activiti + CDI on JBoss 7.1.1: