org.activiti.engine.ActivitiException: Could not find an implementation of the org.activiti.cdi.spi.ProcessEngineLookup

cancel
Showing results for 
Search instead for 
Did you mean: 
sherin_mvs
Member II

org.activiti.engine.ActivitiException: Could not find an implementation of the org.activiti.cdi.spi.ProcessEngineLookup

Hi,

    I am new to Activiti.Migrating an application from jboss to weblogic 12c, where I am facing the below exception.We are using activiti version 5.14.

I have the file org.activiti.cdi.spi.ProcessEngineLookup under META-INF/services with the fully qualified class name of  ProcessEngineLookup implementation.

Also tried forcibly loading ProcessEngineLookup  implementation by the following snippet in weblogic.xml present under META-INF of ear

<prefer-application-resources>
        <resource-name>META-INF/services/org.activiti.cdi.spi.ProcessEngineLookup</resource-name>
    </prefer-application-resources>

Not sure what I am missing.

Exception:

org.activiti.engine.ActivitiException: Could not find an implementation of the org.activiti.cdi.spi.ProcessEngineLookup service returning a non-null processEngine. Giving up.
    at org.activiti.cdi.impl.ActivitiExtension.lookupProcessEngine(ActivitiExtension.java:106)
    at org.activiti.cdi.impl.ActivitiExtension.afterDeploymentValidation(ActivitiExtension.java:68)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)
    at org.jboss.weld.injection.MethodInvocationStrategy$SpecialParamPlusBeanManagerStrategy.invoke(MethodInvocationStrategy.java:144)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:309)
    at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:124)

4 Replies
jearles
Established Member II

Re: org.activiti.engine.ActivitiException: Could not find an implementation of the org.activiti.cdi.spi.ProcessEngineLookup

Sherin,

Before we delve too deep into this, can you verify that you're not running multiple Dependency Injection systems in parallel (Spring, CDI, etc)? I believe JBoss favors CDI by default, and I believe Activti favors Spring - so in that migration, you could be including both. It could be a simple issue of the Java layer not knowing how exactly to utilize the ProcessEngine with competing frameworks.

Thanks,
-JEarles

sherin_mvs
Member II

Re: org.activiti.engine.ActivitiException: Could not find an implementation of the org.activiti.cdi.spi.ProcessEngineLookup

Hi JEarles,

      Thanks for the reply.I was not able to unserdstand the context of can you verify that you're not running multiple Dependency Injection systems in parallel.

But there is no spring related jars available in ear.

These are the list of jars available part of my ear lib

activiti-bpmn-converter-5.14.jar
activiti-bpmn-model-5.14.jar
activiti-cdi.jar
activiti-engine-5.14.jar
activiti-ldap-5.14.jar
commons-email-1.2.jar
commons-lang3-3.1.jar
comps_messaging.jar
joda-time-2.1.jar
mybatis-3.2.2.jar
slf4j-log4j12-1.7.6.jar

Also I tried having beans.xml under META-INF with below content

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

Still the same issue

Thanks

Sherin

jearles
Established Member II

Re: org.activiti.engine.ActivitiException: Could not find an implementation of the org.activiti.cdi.spi.ProcessEngineLookup

CDI or  Contexts and Dependency Injection at a surface level, is the ability to use annotations like @Inject, @autowired and so on. If you're not familiar with it, checkout this Wiki page - anyway, what I was trying to verify is that you weren't running activiti-cdi, cdi, and spring's version of cdi. That would cause collisions and most likely lead to the error you're seeing. Your swapping of the XML configuration wouldn't fix this if your application is missing dependencies required to use the beans, or if there are collisions between multiple dependencies.

So you're correct that using Spring is not required; however, spring-beans is a compile dependency of Activiti, and thus spring-core package is as well. Which, could potentially be the problem, because I don't see those in your list of jars and they're used for dependency injection - but I'm not sure missing those dependencies would cause this particular error. However, you should include those, to confirm that theory.

Has your Activiti installation ever worked, or is this a blocking error that hasn't allowed the server to fully boot?


Potentially helpful:
Someone on another blog post had a very similar issue; there solution might help. There are a few other posts about the same exception, but they're less robust and boil down to collisions of dependency injection frameworks.

-JEarles

sherin_mvs
Member II

Re: org.activiti.engine.ActivitiException: Could not find an implementation of the org.activiti.cdi.spi.ProcessEngineLookup

Hi,

   Thanks JEarles. Some how I managed to solve the issue by deploying the exploded ear.But Right now ends up with the below exception.


weblogic.management.DeploymentException: CDI deployment failure:Exception List with 2 exceptions:
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type ProcessEngine with qualifiers @Default
  at injection point [BackedAnnotatedField] @Inject private com.comps.workflow.JBPMProcessEngineBean.processEngine
  at com.comps.workflow.JBPMProcessEngineBean.processEngine(JBPMProcessEngineBean.java:0)

Here is the code snippet

@Stateless
public class ActivitiFacadeBean implements ActivitiFacade {

    private static ComPSLogger log = ComPSLogger.getLog(ActivitiFacadeBean.class);

    @Inject
    private ProcessEngine processEngine;

Thanks

Sherin George