cancel
Showing results for 
Search instead for 
Did you mean: 

activiti-cdi 5.7 snapshot in Maven repository

chris_joelly
Champ in-the-making
Champ in-the-making
Hello,

i want to try the example located under
https://svn.camunda.com/fox/trunk/demo/activiti-cdi-example-travelexpenses/
and checked it out from SVN, but it seems that i can not find the dependency
which is listed in the pom.


      <dependency>
         <groupId>org.activiti</groupId>
         <artifactId>activiti-cdi</artifactId>
         <version>5.7-SNAPSHOT</version>
      </dependency>

is there a different repository available were i can find the snapsot builds?

thanks
8 REPLIES 8

chris_joelly
Champ in-the-making
Champ in-the-making
i adapted the example to use activiti-cdi 5.6, and i deployed the app in Glassfish 3.1,
but it seems that the LocalProcessEngineLookup bean can not be found.

after debugging i found out that the ProgrammaticBeanLookup class asks the
BeanManager for "interface org.activiti.cdi.impl.ProcessEngineLookup" but is
not able to get one:


org.jboss.weld.exceptions.DeploymentException: 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)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:128)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:298)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)

The BeanManager however seems to know the bean LocalProcessEngineLookup and
the Activiti CDI annotations, so it is not that bad. Smiley Happy


Manager
Enabled alternatives: [] []
Registered contexts: [interface javax.inject.Singleton, interface javax.enterprise.context.Dependent, interface javax.enterprise.context.ConversationScoped, interface javax.enterprise.context.RequestScoped, interface javax.enterprise.context.ApplicationScoped, interface org.activiti.cdi.annotation.BusinessProcessScoped, interface javax.enterprise.context.SessionScoped]
Registered beans: 58
Specialized beans: 0

the content at the beans property of the BeanManager during deployment of the application.

[Built-in Bean [javax.enterprise.inject.spi.BeanManager] with qualifiers [@Default], Extension [class org.activiti.cdi.impl.ActivitiExtension] with qualifiers [@Default]; jar:file:/data/Projects/JavaLibs/glassfish/glassfish3/glassfish/domains/domain1/eclipseApps/activiti-cdi-example-travelexpenses/WEB-INF/lib/activiti-cdi-5.6.jar!/META-INF/services/javax.enterprise.inject.spi.Extension@1[org.activiti.cdi.impl.ActivitiExtension@16b7d42], org.jboss.weld.bean-WEB-INF/lib/activiti-cdi-5.6-Built-in-org.jboss.weld.context.ApplicationContext, Built-in Bean [javax.validator.ValidatorFactory] with qualifiers [@Default], org.jboss.weld.bean-WEB-INF/lib/activiti-cdi-5.6-Built-in-org.jboss.weld.context.http.HttpRequestContext, org.jboss.weld.bean-WEB-INF/lib/activiti-cdi-5.6-Built-in-javax.enterprise.context.Conversation, org.jboss.weld.bean-WEB-INF/lib/activiti-cdi-5.6-Built-in-org.jboss.weld.context.DependentContext, Managed Bean [class org.activiti.cdi.impl.context.DefaultBusinessProcessAssociationManager] with qualifiers [@Any @Default], Managed Bean [class org.activiti.cdi.impl.JndiProcessEngineLookup] with qualifiers [@Any @Default], org.jboss.weld.bean-WEB-INF/lib/activiti-cdi-5.6-Built-in-org.jboss.weld.context.http.HttpConversationContext, Producer Method [ProcessInstance] with qualifiers [@Any @Default @Named] declared as [[method] @Produces @Named public org.activiti.cdi.BusinessProcess.getProcessInstance()], Managed Bean [class org.activiti.cdi.test.ProcessEngineLookupForTestsuite] with qualifiers [@Any @Default], Producer Method [Task] with qualifiers [@Any @Default @Named] declared as [[method] @Produces @Named public org.activiti.cdi.BusinessProcess.getTask()], Managed Bean [class org.activiti.cdi.impl.util.ProgrammaticBeanLookup] with qualifiers [@Any @Default], Managed Bean [class org.activiti.cdi.impl.LocalProcessEngineLookup] with qualifiers [@Any @Default], Managed Bean [class org.activiti.cdi.impl.el.CdiResolver] with qualifiers [@Any @Default], Managed Bean [class org.activiti.cdi.CdiActivitiInterceptor] with qualifiers [@Any @Default], Producer Method [ManagementService] with qualifiers [@Any @Default @Named] declared as [[method] @Produces @Named @ApplicationScoped public org.activiti.cdi.impl.util.ProcessEngineProducer.managementService()], Managed Bean [class org.activiti.cdi.impl.event.CdiEventSupportBpmnParseListener] with qualifiers [@Any @Default], Managed Bean [class org.activiti.cdi.impl.context.DefaultBusinessProcessAssociationManager$RequestScopedAssociation] with qualifiers [@Any @Default], Managed Bean [class org.activiti.cdi.impl.ProcessDeployer] with qualifiers [@Any @Default], Producer Method [ProcessEngine] with qualifiers [@Any @Default @Named] declared as [[method] @Produces @Named @ApplicationScoped public org.activiti.cdi.impl.util.ProcessEngineProducer.processEngine()], Producer Method [TaskService] with qualifiers [@Any @Default @Named] declared as [[method] @Produces @Named @ApplicationScoped public org.activiti.cdi.impl.util.ProcessEngineProducer.taskService()], org.jboss.weld.bean-WEB-INF/lib/activiti-cdi-5.6-Built-in-org.jboss.weld.context.bound.BoundConversationContext, Producer Method [HistoryService] with qualifiers [@Any @Default @Named] declared as [[method] @Produces @Named @ApplicationScoped public org.activiti.cdi.impl.util.ProcessEngineProducer.historyService()], Producer Method [IdentityService] with qualifiers [@Any @Default @Named] declared as [[method] @Produces @Named @ApplicationScoped public org.activiti.cdi.impl.util.ProcessEngineProducer.identityService()], Producer Method [String] with qualifiers [@Any @BusinessKey @Named] declared as [[method] @Produces @Named @BusinessKey public org.activiti.cdi.impl.annotation.BusinessKeyProducer.businessKey(ProcessInstance)], Implicit Bean [javax.enterprise.inject.spi.InjectionPoint] with qualifiers [@Default], Implicit Bean [javax.enterprise.event.Event] with qualifiers [@Default], Implicit Bean [javax.enterprise.inject.Instance] with qualifiers [@Default], Producer Method [RuntimeService] with qualifiers [@Any @Default @Named] declared as [[method] @Produces @Named @ApplicationScoped public org.activiti.cdi.impl.util.ProcessEngineProducer.runtimeService()], Producer Method [RepositoryService] with qualifiers [@Any @Default @Named] declared as [[method] @Produces @Named @ApplicationScoped public org.activiti.cdi.impl.util.ProcessEngineProducer.repositoryService()], Managed Bean [class org.activiti.cdi.impl.context.BusinessProcessContext] with qualifiers [@Any @Default], Managed Bean [class org.activiti.cdi.impl.util.ProcessEngineProducer] with qualifiers [@Any @Default], Producer Method [String] with qualifiers [@Any @TaskId @Named] declared as [[method] @Produces @Named @TaskId public org.activiti.cdi.BusinessProcess.getTaskId()], Managed Bean [class org.activiti.cdi.CdiExpressionManager] with qualifiers [@Any @Default], Producer Method [String] with qualifiers [@Any @ProcessInstanceId @Named] declared as [[method] @Produces @Named @ProcessInstanceId public org.activiti.cdi.BusinessProcess.getProcessInstanceId()], Managed Bean [class org.activiti.cdi.BusinessProcess] with qualifiers [@Any @Default @Named], Built-in Bean [javax.transaction.UserTransaction] with qualifiers [@Default], Producer Method [Object] with qualifiers [@Any @ProcessVariable] declared as [[method] @Produces @ProcessVariable protected org.activiti.cdi.ProcessVariables.getProcessVariable(InjectionPoint)], Managed Bean [class org.activiti.cdi.Actor] with qualifiers [@Any @Default @Named], Managed Bean [class org.activiti.cdi.impl.context.DefaultBusinessProcessAssociationManager$ConversationScopedAssociation] with qualifiers [@Any @Default], Managed Bean [class org.activiti.cdi.impl.context.DefaultBusinessProcessAssociationManager$ScopedAssociation] with qualifiers [@Any @Default], org.jboss.weld.bean-WEB-INF/lib/activiti-cdi-5.6-Built-in-org.jboss.weld.context.ejb.EjbRequestContext, org.jboss.weld.bean-WEB-INF/lib/activiti-cdi-5.6-Built-in-org.jboss.weld.context.bound.BoundRequestContext, Producer Method [FormService] with qualifiers [@Any @Default @Named] declared as [[method] @Produces @Named @ApplicationScoped public org.activiti.cdi.impl.util.ProcessEngineProducer.formService()], Managed Bean [class org.activiti.cdi.CdiJtaProcessEngineConfiguration] with qualifiers [@Any @Default], Built-in Bean [java.security.Principal] with qualifiers [@Default], Managed Bean [class org.activiti.cdi.impl.util.BeanManagerLookup] with qualifiers [@Any @Default], Built-in Bean [javax.validator.Validator] with qualifiers [@Default], Managed Bean [class org.activiti.cdi.impl.annotation.BusinessKeyProducer] with qualifiers [@Any @Default], Managed Bean [class org.activiti.cdi.ProcessVariables] with qualifiers [@Any @Default @Named], org.jboss.weld.bean-WEB-INF/lib/activiti-cdi-5.6-Built-in-org.jboss.weld.context.bound.BoundSessionContext, Managed Bean [class org.activiti.cdi.CdiStandaloneProcessEngineConfiguration] with qualifiers [@Any @Default], Managed Bean [class org.activiti.cdi.impl.context.CachingBeanStore] with qualifiers [@Any @Default], org.jboss.weld.bean-WEB-INF/lib/activiti-cdi-5.6-Built-in-org.jboss.weld.context.RequestContext, org.jboss.weld.bean-WEB-INF/lib/activiti-cdi-5.6-Built-in-org.jboss.weld.context.SingletonContext, org.jboss.weld.bean-WEB-INF/lib/activiti-cdi-5.6-Built-in-org.jboss.weld.context.http.HttpSessionContext]

is this example only meant to be runnable in JBoss? or is there some other setting in beans.xml missing?

beans.xml:

<?xml version="1.0" encoding="UTF-8"?>
<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>

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" />
<!– process engine configuration –>
<bean id="processEngineConfiguration"
  class="org.activiti.cdi.CdiJtaProcessEngineConfiguration">
  <property name="dataSourceJndiName" value="jdbc/__default" />
  <property name="databaseType" value="h2" />
  <property name="transactionManager" ref="transactionManager" />
  <property name="transactionsExternallyManaged" value="true" />
  <property name="databaseSchemaUpdate" value="drop-create" />
</bean>

</beans>

can anybody point me to the right direction why it is not possible for the BeanManager to find the
LocalProcessEngineLookup managed bean?

thanks in advance

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
is there a different repository available were i can find the snapsot builds?

http://fox.camunda.com/mvn/

oh, can you change 0.7 in the subject of your posts to 5.7?

chris_joelly
Champ in-the-making
Champ in-the-making
is there a different repository available were i can find the snapsot builds?

http://fox.camunda.com/mvn/

oh, can you change 0.7 in the subject of your posts to 5.7?

thank u. and yes, i corrected the subject. sorry Smiley Happy

chris_joelly
Champ in-the-making
Champ in-the-making
i tried the example now with 5.7-SNAPSHOT, but no luck. Same behavior that CDI BeanManager is not able to
find an instance of ProcessEngineLookup


INFO: WEB0671: Loading application [activiti-cdi-example-travelexpenses] at [/activiti-cdi-example-travelexpenses]
INFO: Initializing activiti-cdi.
SCHWERWIEGEND: Exception while loading the app

SCHWERWIEGEND: Exception while loading the app : Exception List with 1 exceptions:
Exception 0 :
java.lang.IllegalStateException: CDI BeanManager cannot find an instance of requested type org.activiti.cdi.impl.ProcessEngineLookup
at org.activiti.cdi.impl.util.ProgrammaticBeanLookup.lookup(ProgrammaticBeanLookup.java:33)
at org.activiti.cdi.impl.ActivitiExtension.initializeProcessEngine(ActivitiExtension.java:91)
at org.activiti.cdi.impl.ActivitiExtension.afterDeploymentValidation(ActivitiExtension.java:80)
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:282)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265)
at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234)
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:399)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:190)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:128)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:306)

anyway… META-INF/beans.xml lists LocalProcessEngineLookup…

yuanqixun
Champ in-the-making
Champ in-the-making
Today, version5.7 will be published, I wait for it, right?

chris_joelly
Champ in-the-making
Champ in-the-making
Yes. i wait for it. but it is still the same behavior. either it is simply not working in Glassfish,
or i am doing something wrong with that example application.

andregs
Champ in-the-making
Champ in-the-making
I'm having the same issue here. How did you solve that?

Thanks,

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

first off, thanks for trying out activiti-cdi and reporting back.

There has been some confusion around enabling an implementation of the ProcessEngineLoookup SPI (like for instance LocalProcessEngineLookup).
I hope to have resolved that with:
http://jira.codehaus.org/browse/ACT-1055

Currently we look up an implementation of ProcessEngineLookup on reception of the AfterDeploymentValidation event from the container. We have a set of implementations which are all marked @Alternative (i.e. disabled)

When using activiti-cdi, one has to "enable" one of these implementations (or provide a different one, for that matter).

There is a couple of problems with this:
  • Per CDI-spec, one cannot enable an @Alternative Bean Class form a different bean archive. However, the notion of bean archive is container-specific, for example, weld-servlet uses a "flat" deployment (ie. all bean archives are merged into one big bean archive, while containers like Jboss 7 use a hierarchical bean archive structure mirroring the deployment structure of the container.) The consequence is that one has to use a different strategy for enabling a ProcessEngineLookup implemenation on Tomcat and Jboss AS 6 than on Jboss AS 7. (for instance)
  • In practice, the semantics of instantiating a bean in this phase (AfterDeploymentValidation) seem not to be well defined. In particular, not all EE-contexts seem to be setup in an application server. It seems that it is too "early" or we are on the wrong Thread, to look up beans properly at that stage.
OK, so we changed that.

Now in order to use activiti-cdi 5.8 on Glassfish 3.1 / Jboss AS 7 you can add a subclass of LocalProcessEngineLookup to your project. So you could just add the following:

public class ProcessEngineConfiguration extends LocalProcessEngineLookup {
}
and that is it.

Or you can try out activiti-cdi 5.9-SNAPSHOT, where you do not have to do anything, from our camunda snapshot repository:
http://fox.camunda.com/mvn/org/activiti/activiti-cdi/
Here is an example, use the "activiti-cdi" maven profile:
https://svn.camunda.com/fox/trunk/demo/activiti5-cdi-jsf-task-management/