4 Replies Latest reply on Sep 24, 2013 9:28 AM by sdnakhla

    Unsatisfied dependencies for type [PartitionManager] ?

    sdnakhla

      I'm trying to create a simple enterprise application that makes use of PicketLink JPA IDM for user management.  My structure is as follows:

       

      Application EAR

        -- Web app (WAR)

        -- EJB (JAR)

       

      The PicketLink libraries are available as modules on JBoss EAP 6.1.

       

      I'm trying to simply @Inject the PartitionManager, but keep receiving errors.  I've tried injecting it into EJBs and POJOs, both with the same results.  In my WAR, I've got a simple action class that looks like this:

       

      @Named

      public class TestAction {

       

        @Inject

        private PartitionManager partitionManager = null;

       

        public void runTest() {

        if (partitionManager == null) {

        System.err.println("NULL");

        } else {

        System.out.println("NOT NULL");

        }

        }

      }

       

      However, when I try to deploy this class I get the following error:

       

      [0m[31m21:15:47,527 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."MyTest.ear".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."MyTest.ear".WeldStartService: Failed to start service

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_07]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_07]

        at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_07]

      Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [PartitionManager] with qualifiers [@Default] at injection point [[field] @Inject private net.test.web.servlets.TestAction.partitionManager]

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

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

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

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

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

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

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

        at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:64)

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

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

        ... 3 more

       

      I've tried @Injecting both the PartitionManager and the IdentityManager, both leading to the same results.  Can anyone explain why this error is occurring?  Is there something else I need to do to create the PartitionManager or IdentityManager?

        • 1. Re: Unsatisfied dependencies for type [PartitionManager] ?
          shane.bryzak

          It seems that perhaps the picketlink-impl.jar libary (which contains the producer methods for both PartitionManager and IdentityManager) isn't being included.  Could you try adding this dependency to your project to see if it fixes the exception?  If that works, then it indicates there might be a problem with the PicketLink module.

          • 2. Re: Unsatisfied dependencies for type [PartitionManager] ?
            sdnakhla

            That looks like it might be the issue.  I changed my deployment to embed the PicketLink libraries in my EAR, rather than using the JBoss module.  That appears to have solved the problem.

            • 3. Re: Re: Unsatisfied dependencies for type [PartitionManager] ?
              pcraveiro

              Hi Steve,

               

              How you've configured the PicketLink modules ? Using the PicketLink Installer ?

               

              There is an EAP issue that impacts CDI extension/services to be properly loaded when using a module. That maybe be the root cause of your issue.

               

              The PicketLink Installer 1.1.3.Final configures with your EAP 6.1 installation with all the PicketLink modules + subsystem. The subsystem does all the magic when you need to use PicketLink from modules, automatically configuring your deployment with all the necessary extensions and dependencies.

               

              After using the installer you need to change your standalone.xml as follows:

               

              <!-- Add the PicketLink Extension -->
              <extensions>
                ...
                <extension module="org.picketlink.as.extension"/>
              </extensions>
              
              <profile>
                <!-- Add the PicketLink Subsystem. -->
                <subsystem xmlns="urn:jboss:domain:picketlink:1.0" />
                ...
              </profile>
              

              Then inside your deployment, please add a META-INF/jboss-deployment-structure.xml with the following content:

               

              <jboss-deployment-structure>
                <deployment>
                  <dependencies>
                    <module name="org.picketlink.core"/>
                  </dependencies>
                </deployment>
              </jboss-deployment-structure>
              

               

              Documentation about the subsystem will be published very soon.

               

              Regards.
              Pedro Igor

              1 of 1 people found this helpful
              • 4. Re: Re: Unsatisfied dependencies for type [PartitionManager] ?
                sdnakhla

                Pedro, that must be the problem.  I am using PicketLink Installer to configure the module, so it looks like I must be running into that bug.  I will retest using the fix you suggested.  Thanks!!