0 Replies Latest reply on Oct 31, 2014 1:55 PM by dmouch

    Adding picketlink in a web app (war) that already uses deltaspike

    dmouch

      Hi all,

      I am trying to add picketlink to a web application (packaged in war format) that already includes deltaspike:

          <dependency>
              <groupId>org.apache.deltaspike.core</groupId>
              <artifactId>deltaspike-core-api</artifactId>
              <version>1.0.3</version>
          </dependency>

       

          <dependency>
              <groupId>org.apache.deltaspike.core</groupId>
              <artifactId>deltaspike-core-impl</artifactId>
              <version>1.0.3</version>
              <scope>runtime</scope>
          </dependency>

       

      Picketlink version is 2.7.0.CR1 and the application server used is: wildfly 8.1.0.Final

       

      When I try to enable the application from the wildfly console I get this in the console:

      19:52:44,461 INFO  [org.apache.deltaspike.core.util.ProjectStageProducer] (MSC service thread 1-2) Computed the following DeltaSpike ProjectStage: Production

      19:52:45,576 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."myapp.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."myapp.war".WeldStartService: Failed to start service

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_25]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_25]

          at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_25]

      Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001414: Bean name is ambiguous. Name dsWindowContext resolves to beans:

        - Producer Method [WindowContext] with qualifiers [@Default @Named @Any] declared as [[BackedAnnotatedMethod] @Produces @Named @Dependent public org.apache.deltaspike.core.impl.scope.window.WindowContextProducer.getWindowContext()],

        - Producer Method [WindowContext] with qualifiers [@Default @Named @Any] declared as [[BackedAnnotatedMethod] @Produces @Named @Dependent public org.apache.deltaspike.core.impl.scope.window.WindowContextProducer.getWindowContext()]

          at org.jboss.weld.bootstrap.ConcurrentValidator$5.doWork(ConcurrentValidator.java:134)

          at org.jboss.weld.bootstrap.ConcurrentValidator$5.doWork(ConcurrentValidator.java:130)

          at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)

          at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)

          at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_25]

          ... 3 more

       

      19:52:45,583 ERROR [org.jboss.as.controller.management-operation] (XNIO-1 task-6) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "myapp.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"myapp.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"myapp.war\".WeldStartService: Failed to start service

          Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001414: Bean name is ambiguous. Name dsWindowContext resolves to beans:

        - Producer Method [WindowContext] with qualifiers [@Default @Named @Any] declared as [[BackedAnnotatedMethod] @Produces @Named @Dependent public org.apache.deltaspike.core.impl.scope.window.WindowContextProducer.getWindowContext()],

        - Producer Method [WindowContext] with qualifiers [@Default @Named @Any] declared as [[BackedAnnotatedMethod] @Produces @Named @Dependent public org.apache.deltaspike.core.impl.scope.window.WindowContextProducer.getWindowContext()]"}}

      19:52:45,586 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016009: Stopping weld service for deployment myapp.war

      19:52:45,595 ERROR [org.jboss.as.server] (XNIO-1 task-6) JBAS015870: Deploy of deployment "myapp.war" was rolled back with the following failure message:

      {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"myapp.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"myapp.war\".WeldStartService: Failed to start service

          Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001414: Bean name is ambiguous. Name dsWindowContext resolves to beans:

        - Producer Method [WindowContext] with qualifiers [@Default @Named @Any] declared as [[BackedAnnotatedMethod] @Produces @Named @Dependent public org.apache.deltaspike.core.impl.scope.window.WindowContextProducer.getWindowContext()],

        - Producer Method [WindowContext] with qualifiers [@Default @Named @Any] declared as [[BackedAnnotatedMethod] @Produces @Named @Dependent public org.apache.deltaspike.core.impl.scope.window.WindowContextProducer.getWindowContext()]"}}

      19:52:45,644 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment myapp.war (runtime-name: myapp.war) in 60ms

      19:52:45,645 INFO  [org.jboss.as.controller] (XNIO-1 task-6) JBAS014774: Service status report

      JBAS014777:   Services which failed to start:      service jboss.deployment.unit."myapp.war".WeldStartService

       

      I suppose this happens because deltaspike classes are already included in picketlink jar. How do I fix this?