5 Replies Latest reply on Mar 9, 2015 7:56 PM by sdnakhla

    Adding picketlink-social to a picketlink-idm-custom-identity model

    jdc

      So I am trying add fb authentication to my app, it has an idm custom identity model and it has delta spike, I just followed the quickstarts.  I managed to get the picketlink authentication with facebook quickstart to work, also this lynx-r/picketlink-deltaspike-authorization-and-idm-custom-identity-model · GitHub,  and they work ok separatly.

       

      But when I add the repo from picketlink-social to my project I get this

       

      11:49:52,879 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-13) MSC000001: Failed to start service jboss.deployment.unit."unikaimagen.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."unikaimagen.war".WeldStartService: Failed to start service
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_65]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_65]
          at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65]
      Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001414: Bean name is ambiguous. Name loginCredentials resolves to beans:
        - Managed Bean [class org.picketlink.credential.DefaultLoginCredentials] with qualifiers [@Default @Named @Any],
        - Managed Bean [class org.picketlink.credential.DefaultLoginCredentials] with qualifiers [@Default @Named @Any]
          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:262) [rt.jar:1.7.0_65]
          ... 3 more
      
      11:49:52,883 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "unikaimagen.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"unikaimagen.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"unikaimagen.war\".WeldStartService: Failed to start service
          Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001414: Bean name is ambiguous. Name loginCredentials resolves to beans:
        - Managed Bean [class org.picketlink.credential.DefaultLoginCredentials] with qualifiers [@Default @Named @Any],
        - Managed Bean [class org.picketlink.credential.DefaultLoginCredentials] with qualifiers [@Default @Named @Any]"}}
      11:49:52,985 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS018559: Deployed "unikaimagen.war" (runtime-name : "unikaimagen.war")
      11:49:52,985 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) JBAS014774: Service status report
      JBAS014777:   Services which failed to start:      service jboss.deployment.unit."unikaimagen.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."unikaimagen.war".WeldStartService: Failed to start service
      

       

      Just by adding picketlink-social

       

      <dependency>
                  <groupId>org.picketlink</groupId>
                  <artifactId>picketlink-social</artifactId>
                  <exclusions>
                      <exclusion>
                          <groupId>com.google.code.guice</groupId>
                          <artifactId>guice</artifactId>
                      </exclusion>
                      <exclusion>
                          <groupId>org.picketlink</groupId>
                          <artifactId>picketlink-federation</artifactId>
                      </exclusion>
                  </exclusions>
              </dependency>
      

      I get  the error above, should I add another exclusion in the dependency?

       

      This is my pom.xml http://pastebin.com/2mPmcFHf

        • 1. Re: Adding picketlink-social to a picketlink-idm-custom-identity model
          jdc

          Hi,

          So after panicking I just realized what the problem is,

          I changed my maven to this

           

          <!-- Import the PicketLink API, we deploy this as library with the application,

                      and can compile against it -->

                  <dependency>

                      <groupId>org.picketlink</groupId>

                      <artifactId>picketlink-api</artifactId>

                  </dependency>

                  <!-- Import the PicketLink implementation, we deploy this as library with

                      the application, but can't compile against it -->

                  <dependency>

                      <groupId>org.picketlink</groupId>

                      <artifactId>picketlink-impl</artifactId>

                      <scope>runtime</scope>

                  </dependency>

                  <!-- Import the PicketLink IDM API, we deploy this as library with the

                      application, and can compile against it -->

                  <dependency>

                      <groupId>org.picketlink</groupId>

                      <artifactId>picketlink-idm-api</artifactId>

                  </dependency>

                  <!-- Import the PicketLink IDM API, we deploy this as library with the

                      application, and can compile against it -->

                  <dependency>

                      <groupId>org.picketlink</groupId>

                      <artifactId>picketlink-idm-impl</artifactId>

                      <scope>runtime</scope>

                  </dependency>

                  <dependency>

                      <groupId>org.picketlink</groupId>

                      <artifactId>picketlink-social</artifactId>

                      <exclusions>

                          <exclusion>

                              <groupId>com.google.code.guice</groupId>

                              <artifactId>guice</artifactId>

                          </exclusion>

                          <exclusion>

                              <groupId>org.picketlink</groupId>

                              <artifactId>picketlink-federation</artifactId>

                          </exclusion>

                      </exclusions>

                  </dependency>

           

                  <!-- Deltaspike API. We use compile scope as we need compile against its

                      API -->

                  <dependency>

                      <groupId>org.apache.deltaspike.core</groupId>

                      <artifactId>deltaspike-core-api</artifactId>

                      <scope>compile</scope>

                  </dependency>

           

                  <!-- Deltaspike Impl. we use runtime scope as we need its implementation

                      dependencies only on runtime -->

                  <dependency>

                      <groupId>org.apache.deltaspike.core</groupId>

                      <artifactId>deltaspike-core-impl</artifactId>

                      <scope>runtime</scope>

                  </dependency>

           

                  <!-- Deltaspike Security Module API. We use compile scope as we need to

                      compile against its API -->

                  <dependency>

                      <groupId>org.apache.deltaspike.modules</groupId>

                      <artifactId>deltaspike-security-module-api</artifactId>

                      <scope>compile</scope>

                  </dependency>

           

                  <!-- Deltaspike Security Impl. we use runtime scope as we need its implementation

                      dependencies only on runtime -->

                  <dependency>

                      <groupId>org.apache.deltaspike.modules</groupId>

                      <artifactId>deltaspike-security-module-impl</artifactId>

                      <scope>runtime</scope>

                  </dependency>

          • 2. Re: Adding picketlink-social to a picketlink-idm-custom-identity model
            alekspo

            I have similar problem. Can you post your all pom.xml?

            • 3. Re: Adding picketlink-social to a picketlink-idm-custom-identity model
              jdc

              http://pastebin.com/MN677frn, can you elaborate your problem

              • 4. Re: Adding picketlink-social to a picketlink-idm-custom-identity model
                alekspo

                Thank you. I solved my problem.

                • 5. Re: Adding picketlink-social to a picketlink-idm-custom-identity model
                  sdnakhla

                  Were you able to get PicketLink Social to make use of your custom identity model objects?  I've tried, but it always ends up using the default org.picketlink.idm.model.basic.User class.  I extended this class as part of my custom identity model, but can't figure out how to get PicketLink Social to use it.