AnsweredAssumed Answered

CDI problem in WebLogic

Question asked by petter.f on Oct 10, 2012
Latest reply on Nov 13, 2012 by jbarrez
Hi all,

We are currently trying to refactor our Activiti module into using CDI and I've run into a number of problems. Now, reverting back to step 1 I get the following error:
weblogic.management.DeploymentException: 
   at weblogic.application.internal.BaseDeployment.throwAppException(BaseDeployment.java:123)
   at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:239)
   at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:61)
   at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:158)
   at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
   at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:207)
   at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:96)
   at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:229)
   at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
   at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
   at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
   at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
   at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
   at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
   at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
   at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
   at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
   at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused By: org.jboss.weld.exceptions.DeploymentException: Exception List with 1 exceptions:
Exception 0 :
java.lang.IllegalStateException: CDI BeanManager cannot find an instance of requested type org.activiti.cdi.impl.util.ActivitiServices
   at org.activiti.cdi.impl.util.ProgrammaticBeanLookup.lookup(ProgrammaticBeanLookup.java:33)
   at org.activiti.cdi.impl.ActivitiExtension.lookupProcessEngine(ActivitiExtension.java:110)
   at org.activiti.cdi.impl.ActivitiExtension.afterDeploymentValidation(ActivitiExtension.java:68)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
….snip
What I have done is
  • enabled CDI by adding a beans.xml fil in META_INF
  • changed my maven dependency to activiti-cdi instead of activiti-engine

  • My activiti.cfg.xml is left unchanged:
       <jee:jndi-lookup jndi-name="ActivitiDS" id="dataSource" />
       <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
          <property name="databaseSchemaUpdate" value="false" />
          <property name="dataSource" ref="dataSource" />
          <property name="jobExecutorActivate" value="true" />
          <property name="transactionsExternallyManaged" value="true" />
          <property name="jdbcDriver" value="oracle.jdbc.driver.OracleDriver" />
       </bean>   

    My question is basically; does this have to do with the fact that I'm deploying as an ear in weblogic? If so, what measures do I have to take in order to get it to work?

    Removing the beans.xml file from the deployment makes everything worka "the old way" again.

    I do realize that in the "final" CDI configuration I should also use org.activiti.cdi.CdiStandaloneProcessEngineConfiguration as class for the processEngineConfiguration. Just trying to isolate my problem here…

    Thanks in advance,
    /Petter

    Outcomes