3 Replies Latest reply on Apr 7, 2014 5:07 PM by Clay Ferguson

    jBPM Deployable WAR/EAR ???  Please help!

    Clay Ferguson Newbie

      Does anyone happen to know where I can find a sample (example code, or even a maven archetype) that contains a maven build that creates something that can be deployed onto JBoss that will actually be able to startup and run without errors???  I can't seem to build something that can run jBPM code inside JBoss environment (I'm using 6.0.1.Final).  I need a WAR/EAR anything really.  It seems like the jbpm-source download (which I have) would at a very minimum contain a sample WEB App project or something, but I sure can't find it.  Please help!!

        • 1. Re: jBPM Deployable WAR/EAR ???  Please help!
          Maciej Swiderski Master

          take a look at these example that might be useful.

           

          HTH

          1 of 1 people found this helpful
          • 2. Re: jBPM Deployable WAR/EAR ???  Please help!
            Clay Ferguson Newbie

            Maciej, thank you for the rapid response!  I download and ran that code, but I'm getting some Weld Errors for Ambiguous dependencies.  I followed the steps in the readme.  Any ideas what these errors could mean? Obviously weld is finding multiple UserGroupCallback providers or instances and not able to determine which to instantiate, but I'm not sure why?  I'm running inside a 'jbpm-installer' that is version 6.0.1.Final.  Is there a version of the rebate example that has been tested against version 6.0.1.Final perhaps?  Maybe something has changed since the last time it was verified to run ok?

            Both WARS fail in pretty much the same way and I'm sure it's the same problem on both.

            -------------

            13:40:26,048 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.unit."rewards-jsf-6.0.1-SNAPSHOT.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."rewards-jsf-6.0.1-SNAPSHOT.war".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [UserGroupCallback] with qualifiers [@Default] at injection point [[field] @Inject private org.jbpm.examples.util.RewardsApplicationScopedProducer.usergroupCallback]. Possible dependencies [[Managed Bean [class org.jbpm.examples.util.RewardsUserGroupCallback] with qualifiers [@Any @Default], Producer Method [UserGroupCallback] with qualifiers [@Any @Default] declared as [[method] @ApplicationScoped @Produces public org.jbpm.kie.services.cdi.producer.DefaultUserGroupInfoProducer.produceCallback()]]]

            at org.jboss.as.weld.services.WeldService.start(WeldService.java:83)

            at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

            at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_29]

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_29]

            at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_29]

            Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [UserGroupCallback] with qualifiers [@Default] at injection point [[field] @Inject private org.jbpm.examples.util.RewardsApplicationScopedProducer.usergroupCallback]. Possible dependencies [[Managed Bean [class org.jbpm.examples.util.RewardsUserGroupCallback] with qualifiers [@Any @Default], Producer Method [UserGroupCallback] with qualifiers [@Any @Default] declared as [[method] @ApplicationScoped @Produces public org.jbpm.kie.services.cdi.producer.DefaultUserGroupInfoProducer.produceCallback()]]]

            at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:278)

            at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:244)

            at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:107)

            at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:127)

            at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:346)

            at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:331)

            at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:366)

            at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:83)

            at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)

            ... 5 more

            ----------

             

            13:41:40,071 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."rewards-basic-6.0.1-SNAPSHOT.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."rewards-basic-6.0.1-SNAPSHOT.war".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [UserGroupCallback] with qualifiers [@Default] at injection point [[field] @Inject private org.jbpm.examples.util.RewardsApplicationScopedProducer.usergroupCallback]. Possible dependencies [[Managed Bean [class org.jbpm.examples.util.RewardsUserGroupCallback] with qualifiers [@Any @Default], Producer Method [UserGroupCallback] with qualifiers [@Any @Default] declared as [[method] @ApplicationScoped @Produces public org.jbpm.kie.services.cdi.producer.DefaultUserGroupInfoProducer.produceCallback()]]]

            at org.jboss.as.weld.services.WeldService.start(WeldService.java:83)

            at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

            at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_29]

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_29]

            at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_29]

            Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [UserGroupCallback] with qualifiers [@Default] at injection point [[field] @Inject private org.jbpm.examples.util.RewardsApplicationScopedProducer.usergroupCallback]. Possible dependencies [[Managed Bean [class org.jbpm.examples.util.RewardsUserGroupCallback] with qualifiers [@Any @Default], Producer Method [UserGroupCallback] with qualifiers [@Any @Default] declared as [[method] @ApplicationScoped @Produces public org.jbpm.kie.services.cdi.producer.DefaultUserGroupInfoProducer.produceCallback()]]]

            at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:278)

            at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:244)

            at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:107)

            at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:127)

            at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:346)

            at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:331)

            at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:366)

            at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:83)

            at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)

            ... 5 more

            • 3. Re: jBPM Deployable WAR/EAR ???  Please help!
              Clay Ferguson Newbie

              I fixed the Weld errors by doing this (3 Steps)

               

              1) Created a CDI Qualifier like this:

               

              package org.jbpm.examples.ejb;

              import static java.lang.annotation.ElementType.FIELD;
              import static java.lang.annotation.ElementType.METHOD;
              import static java.lang.annotation.ElementType.PARAMETER;
              import static java.lang.annotation.ElementType.TYPE;
              import static java.lang.annotation.RetentionPolicy.RUNTIME;

              import java.lang.annotation.Retention;
              import java.lang.annotation.Target;

              import javax.inject.Qualifier;

              @Qualifier
              @Retention(RUNTIME)
              @Target({ TYPE, METHOD, FIELD, PARAMETER })
              public @interface EnergyQualifier {
              }

               

              2) Annotated class like this:

               

              @Alternative

              @EnergyQualifier

              public class RewardsUserGroupCallback implements UserGroupCallback {

               

              3) Annotated Injection point like this:

               

              @Inject

              @EnergyQualifier

              private UserGroupCallback usergroupCallback

               

              -----------------

              I am pretty sure the 'alternative' stuff in the beans.xml should have made this all work ok, but definitely building the project as it came, unmodified failed to run.  Making the changes above definitely fixed it.  But I'm not sure if there's something I'm missing.  I'm very new to CDI.

               

              I HAVE however noticed tons of people having CDI/Weld errors when trying to run jBPM code and I have tentatively concluded that a more broad use of "@Qualifiers" across the codebase could be very helpful for proper injection of things, to be sure the right thing *cannot* be injected, and to be sure there are no possible 'ambiguous' errors... but like I said, maybe I'm just confused.