AnsweredAssumed Answered

Configuring activiti-cdi

Question asked by chris.joelly on Aug 7, 2011
i can sucessful initialize an activiti engine in Glassfish, but when i change the setup to make use of activiti-cdi i run into troubles:

WEB-INF/classes/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" xmlns:jee="http://www.springframework.org/schema/jee"
   xsi:schemaLocation="
   http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
   http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd">

   <jee:jndi-lookup jndi-name="java:appserver/TransactionManager" id="transactionManager" />

   <bean id="processEngineConfiguration"
      class="org.activiti.cdi.CdiJtaProcessEngineConfiguration">
      <property name="transactionManager" ref="transactionManager"/>
      <property name="transactionsExternallyManaged" value="true" />
      <property name="dataSourceJndiName" value="jdbc/MysqlErp" />
      <property name="databaseSchemaUpdate" value="true" />
      <property name="databaseType" value="mysql" />
      <property name="jobExecutorActivate" value="false" />
   </bean>

</beans>

WEB-INF/beans.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
      http://java.sun.com/xml/ns/javaee
      http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">

  <alternatives>
        <class>org.activiti.cdi.impl.LocalProcessEngineLookup</class>
  </alternatives>
</beans>

the exception is as follows:

INFO: Portable JNDI names for EJB ActivitiStarter : [java:global/erp.web/ActivitiStarter!com.examples.ejbeans.ActivitiStarter, java:global/erp.web/ActivitiStarter]
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: initializing process engine for resource file:/data/Projects/JavaLibs/glassfish/glassfish3/glassfish/domains/domain1/eclipseApps/erp.web/WEB-INF/classes/activiti.cfg.xml

INFO: Loading XML bean definitions from resource loaded through InputStream

INFO: ProcessEngine default created
INFO: initialised process engine default
INFO: Mojarra 2.1.0 (FCS 2.1.0-b11) für Kontext '/erp.web' wird initialisiert.

INFO: WEB0671: Loading application [erp.web] at [/erp.web]
INFO: Initializing activiti-cdi.
SCHWERWIEGEND: Exception while loading the app
SCHWERWIEGEND: Exception while loading the app : Exception List with 1 exceptions:
Exception 0 :
java.util.NoSuchElementException
   at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796)
   at java.util.HashMap$KeyIterator.next(HashMap.java:828)
   at org.activiti.cdi.impl.util.ProgrammaticBeanLookup.lookup(ProgrammaticBeanLookup.java:29)
   at org.activiti.cdi.impl.ActivitiExtension.initializeProcessEngine(ActivitiExtension.java:83)
   at org.activiti.cdi.impl.ActivitiExtension.afterDeploymentValidation(ActivitiExtension.java:69)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
   at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
   at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
   at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
   at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
   at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
   at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
   at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:270)
   at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
   at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:222)
   at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:88)
   at org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:52)
   at org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:34)
   at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:393)
   at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:190)


i dont know what is wrong with my configuration…

Outcomes