AnsweredAssumed Answered

Activiti-cdi Exception

Question asked by nawnaw on Jun 19, 2012
Latest reply on Jun 27, 2012 by rgareau
Hi,

I try to test an example of activiti CDI ,
here is the class implementing ProcessEngineLookup

   import javax.naming.InitialContext;
   import javax.naming.NamingException;
   import javax.transaction.TransactionManager;

   import org.activiti.cdi.spi.ProcessEngineLookup;
   import org.activiti.engine.ProcessEngine;
   import org.activiti.engine.impl.cfg.JtaProcessEngineConfiguration;

   public class ProgrammaticProcessEngineConfiguration implements ProcessEngineLookup {
      
     private ProcessEngine processEngine;
    
     public int getPrecedence() {
       return 10;
     }

     private TransactionManager lookupTransactionManager() {
       try {
         return InitialContext.doLookup("java:appserver/TransactionManager");
       } catch (NamingException e) {
         throw new RuntimeException("Unable to lookup transaction manager", e);
       }
     }

     public ProcessEngine getProcessEngine() {
       JtaProcessEngineConfiguration processEngineConfiguration = new JtaProcessEngineConfiguration();
       processEngineConfiguration.setProcessEngineName("default");
       processEngineConfiguration.setDataSourceJndiName("jdbc/activiti");
       processEngineConfiguration.setTransactionManager(lookupTransactionManager());
       processEngineConfiguration.setDatabaseType("mysql");
       processEngineConfiguration.setTransactionsExternallyManaged(true);
       processEngineConfiguration.setJobExecutorActivate(true);
       processEngine = processEngineConfiguration.buildProcessEngine();
       return processEngine;
     }

     public void ungetProcessEngine() {
       processEngine.close();
       processEngine = null;
     }

   }


Glassfish can not deploy the application returning this exception "Could not find an implementation of the org.activiti.cdi.spi.ProcessEngineLookup service returning a non-null processEngine. Giving up."
I have configured my datasource in glassfish , i have a process deployed in the database and a xml file processes.xml
to deploy a new process

Thank you

Outcomes