14 Replies Latest reply on Aug 7, 2013 6:10 PM by scrappy

    Unsatisfied dependencies for ...

    scrappy

      Hi ...

       

         We are currently developing an application, and are using jBoss 7.1.1Final right now, on FreeBSD, with OpenJDK 7 ... all works great, but we're looking at upgrading jBoss, and since we aren't "going production" for at least another 6 months, figured we'd move to Wildfly, even though at Alpha, and see how things worked ... when we try to deploy the WAR file, though, we get the following error:

       

      13:34:39,376 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."openstudent.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."openstudent.war".WeldStartService: Failed to start service

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1900) [jboss-msc-1.2.0.Beta2.jar:1.2.0.Beta2]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]

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

              at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]

      Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Validator] with qualifiers [@Default] at injection point [[UnbackedAnnotatedField] @Inject private org.hibernate.validator.internal.cdi.interceptor.ValidationInterceptor.validator]

              at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:404)

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

              at org.jboss.weld.bootstrap.Validator.validateInterceptor(Validator.java:555)

              at org.jboss.weld.bootstrap.ConcurrentValidator$2.doWork(ConcurrentValidator.java:87)

              at org.jboss.weld.bootstrap.ConcurrentValidator$2.doWork(ConcurrentValidator.java:85)

              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$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_25]

              at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_25]

              ... 3 more

       

          I've searched Google, and even found one Jira from Alpha1 about it, but the 'solution' wasn't very detailed, and seemed to indicate a fix in the server, not the code, but its a very sparse report other then "its fixed" (https://issues.jboss.org/browse/WFLY-1356) ...

       

          Is this something we are doing wrong in our code that can be fixed, or is this a server side thing?   My test was with Alpha3, so after the JIRA referenced above, supposedly ...

       

      Thanks for any input ...

        • 1. Re: Unsatisfied dependencies for ...
          jaikiran

          Marc, welcome to the forums!

           

          Is there a sample application which reproduces this against WildFly 8.0.0.Alpha3? If yes, can you attach it to this thread?

          • 2. Re: Unsatisfied dependencies for ...
            nickarls

            As a minimum, show the injection point and bundled libraries.

            • 3. Re: Unsatisfied dependencies for ...
              scrappy

              Unfortunately, this is a very large application we're running ... 300k lines of code ... so attaching is kind of difficult

              • 4. Re: Unsatisfied dependencies for ...
                scrappy

                Apologies in advance ... I'm not a Java Dev, so forgive my attempt to 'stumble through this'

                 

                The response from the lead developer on this is that its something that the wildfly server is calling, we aren't doing anything with hibernate ... and he's arriving at this, I think, because of

                 

                Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Validator] with qualifiers [@Default] at injection point [[UnbackedAnnotatedField] @Inject private org.hibernate.validator.internal.cdi.interceptor.ValidationInterceptor.validator]

                 

                I have access to all the code / hudson to build again and the wildfly server itself ... just insufficient Java knowledge to do anything with it ... can you elaborate a bit on what you mean by 'injection point'?   Would providing a complete server.log help any?   From startup ->  failed deployment?  

                 

                As for bundled libraries ... would this be the 108 .jar files that are in WEB-INF/lib within the .war file? 

                • 5. Re: Unsatisfied dependencies for ...
                  nickarls

                  108 jars? Goodie, let's see them

                  • 6. Re: Unsatisfied dependencies for ...
                    nickarls

                    By injection point I'm referring to some place you are doing something like

                     

                    @Inject

                    private ValidationInterceptor validator

                     

                    or something like that(?). What class are you injecting (and what provides it)?

                    • 7. Re: Unsatisfied dependencies for ...
                      scrappy

                      I've asked the dev why some of these are included (ie. the jdk14/jdk15 stuff) ... he's looking, but suspects they are dependencies within the dependencies ... but, here's the list as it stands now:

                       

                      activation-1.1.jar

                      ant-1.6.5.jar

                      aopalliance-1.0.jar

                      aspectjrt-1.6.12.jar

                      aspectjweaver-1.6.12.jar

                      bcmail-jdk14-1.38.jar

                      bcmail-jdk14-138.jar

                      bcprov-jdk14-1.38.jar

                      bcprov-jdk14-138.jar

                      bcprov-jdk15-135.jar

                      bctsp-jdk14-1.38.jar

                      castor-1.2.jar

                      cglib-nodep-2.1_3.jar

                      com.springsource.org.aopalliance-1.0.0.jar

                      commonj.sdo-2.1.1.v201112051852.jar

                      commons-beanutils-1.8.3.jar

                      commons-codec-1.7.jar

                      commons-collections-3.2.1.jar

                      commons-digester-2.1.jar

                      commons-exec-1.1.jar

                      commons-fileupload-1.3.jar

                      commons-io-2.4.jar

                      commons-lang3-3.1.jar

                      commons-logging-1.1.1.jar

                      cupertino-1.0.9.jar

                      dark-hive-1.0.9.jar

                      dom4j-1.6.1.jar

                      eclipselink-2.4.1.jar

                      geronimo-stax-api_1.0_spec-1.0.jar

                      guava-14.0-rc1.jar

                      hamcrest-core-1.3.jar

                      httpclient-4.2.1.jar

                      httpcore-4.2.1.jar

                      humanity-1.0.9.jar

                      ironjacamar-jdbc-1.1.0.Beta2.jar

                      itext-2.1.7.jar

                      jackson-core-lgpl-1.7.4.jar

                      jackson-mapper-lgpl-1.7.4.jar

                      jasperreports-4.1.3.jar

                      javaee-api-6.0.jar

                      javax.inject-1.jar

                      javax.persistence-2.0.0.jar

                      jboss-transaction-api_1.1_spec-1.0.1.Final.jar

                      jcommon-1.0.15.jar

                      jdtcore-3.1.0.jar

                      jfreechart-1.0.12.jar

                      jna-3.4.0.jar

                      jsf-api-2.1.21.jar

                      jsf-facelets-1.1.15.jar

                      jsf-impl-2.1.21.jar

                      json-20080701.jar

                      jta-1.1.jar

                      junit-4.11.jar

                      log4j-1.2.17.jar

                      mail-1.4.3.jar

                      myfaces-extcdi-bundle-jsf20-1.0.5.jar

                      org.eclipse.persistence.antlr-3.2.0.v201206041011.jar

                      org.eclipse.persistence.asm-3.3.1.v201206041142.jar

                      org.eclipse.persistence.core-2.4.1.jar

                      org.eclipse.persistence.jpa-2.4.1.jar

                      org.eclipse.persistence.jpa.jpql-2.4.1.jar

                      org.mortbay.jetty-5.1.10.jar

                      org.springframework.aop-3.0.5.RELEASE.jar

                      org.springframework.asm-3.0.5.RELEASE.jar

                      org.springframework.beans-3.0.5.RELEASE.jar

                      org.springframework.context-3.0.5.RELEASE.jar

                      org.springframework.context.support-3.0.5.RELEASE.jar

                      org.springframework.core-3.0.5.RELEASE.jar

                      org.springframework.expression-3.0.5.RELEASE.jar

                      org.springframework.jdbc-3.0.5.RELEASE.jar

                      org.springframework.orm-3.0.5.RELEASE.jar

                      org.springframework.oxm-3.0.5.RELEASE.jar

                      org.springframework.test-3.0.5.RELEASE.jar

                      org.springframework.transaction-3.0.5.RELEASE.jar

                      org.springframework.web-3.0.5.RELEASE.jar

                      pepper-grinder-1.0.9.jar

                      persistence-api-1.0.jar

                      platform-3.4.0.jar

                      poi-3.7.jar

                      poi-ooxml-3.7.jar

                      poi-ooxml-schemas-3.7.jar

                      postgresql-9.1-901-1.jdbc4.jar

                      primefaces-3.5.x.jar

                      redmond-1.0.9.jar

                      rewrite-servlet-2.0.2.Final.jar

                      selenium-api-2.32.0.jar

                      selenium-chrome-driver-2.32.0.jar

                      selenium-core-1.0-20080914.225453.jar

                      selenium-firefox-driver-2.32.0.jar

                      selenium-remote-driver-2.32.0.jar

                      selenium-server-1.0-20081010.060147.jar

                      selenium-server-coreless-1.0-20081010.060147.jar

                      slf4j-api-1.6.6.jar

                      slf4j-log4j12-1.6.6.jar

                      smoothness-1.0.9.jar

                      spring-aop-3.0.6.RELEASE.jar

                      spring-asm-3.0.6.RELEASE.jar

                      spring-beans-3.0.6.RELEASE.jar

                      spring-context-3.0.6.RELEASE.jar

                      spring-core-3.0.6.RELEASE.jar

                      spring-expression-3.0.6.RELEASE.jar

                      spring-mock-1.2.6.jar

                      spring-security-core-3.1.0.RELEASE.jar

                      spring-security-crypto-3.1.0.RELEASE.jar

                      spring-tx-3.0.5.RELEASE.jar

                      stax-api-1.0.1.jar

                      xml-apis-1.3.02.jar

                      xmlbeans-2.3.0.jar

                      • 8. Re: Unsatisfied dependencies for ...
                        scrappy

                        'k, if we are looking specifically for:

                         

                        ===

                        @Inject

                        private ValidationInterceptor validator

                        ===

                         

                        From what I can tell ...  never.   And just to try and keep it simple, I did:

                         

                        grep -ir ValidationInterceptor . | less

                         

                        so wasn't too concerned about exact syntax / case ...

                         

                        We are doing alot of @Inject's, just nothing with that above ...  that said, if i search for 'validator', I am finding alot of stuff like:

                         

                        ===

                        import javax.faces.validator.ValidatorException;

                        ===

                         

                        and

                         

                        ===

                        Object value) throws ValidatorException {

                        ===

                         

                        so *a* validator seems to be being used, but nothing that appears to be @Inject(ed) ...

                        • 9. Re: Unsatisfied dependencies for ...
                          ctomc

                          There are many things you should remove from your lib

                          comments inline

                           

                          Marc Fournier wrote:

                           

                          I've asked the dev why some of these are included (ie. the jdk14/jdk15 stuff) ... he's looking, but suspects they are dependencies within the dependencies ... but, here's the list as it stands now:

                           

                          activation-1.1.jar <-- remove this is part of JDK & app server

                          ant-1.6.5.jar <-- remove this is build tool and as such i doubt it is needed at runtime

                          aopalliance-1.0.jar <-- remove

                          aspectjrt-1.6.12.jar <-- do you use aspects? probably not, so this is safe to remove

                          aspectjweaver-1.6.12.jar <-- same as above

                          bcmail-jdk14-1.38.jar <-- you should have only one of them on class path and it should be for current jdk (jdk16 or 17)

                          bcmail-jdk14-138.jar <-- remove as it is same as above

                          bcprov-jdk14-1.38.jar <-- remove as you have it below

                          bcprov-jdk14-138.jar <-- remove as you have it below

                          bcprov-jdk15-135.jar <-- probably should be upgraded to jdk 1.6 version if it

                          bctsp-jdk14-1.38.jar <-- upgrade version for jdk1.6/1.7

                          castor-1.2.jar <-- i doubt you need it, must be some leftover, probably safe to remove

                          cglib-nodep-2.1_3.jar  <-- probably safe to remove

                          com.springsource.org.aopalliance-1.0.0.jar <-- remove

                          commonj.sdo-2.1.1.v201112051852.jar

                          commons-beanutils-1.8.3.jar <-- you could use server provided ones

                          commons-codec-1.7.jar

                          commons-collections-3.2.1.jar

                          commons-digester-2.1.jar

                          commons-exec-1.1.jar

                          commons-fileupload-1.3.jar

                          commons-io-2.4.jar

                          commons-lang3-3.1.jar

                          commons-codec-1.7.jar

                          commons-logging-1.1.1.jar <-- remove

                          cupertino-1.0.9.jar

                          dark-hive-1.0.9.jar

                          dom4j-1.6.1.jar <-- you probably dont use it directly and you can import it from sever modules

                          eclipselink-2.4.1.jar <-- do you use eclipselink as JPA provider? if not remove this

                          geronimo-stax-api_1.0_spec-1.0.jar <-- remove as this is part of app server

                          guava-14.0-rc1.jar

                          hamcrest-core-1.3.jar

                          httpclient-4.2.1.jar

                          httpcore-4.2.1.jar

                          humanity-1.0.9.jar

                          ironjacamar-jdbc-1.1.0.Beta2.jar <-- remove this is part of app server

                          itext-2.1.7.jar

                          jackson-core-lgpl-1.7.4.jar <-- this should probably be removed as it is part of app server

                          jackson-mapper-lgpl-1.7.4.jar <-- this should probably be removed as it is part of app server

                          jasperreports-4.1.3.jar

                          javaee-api-6.0.jar <-- remove, this is part of app server and will cause problems in your app

                          javax.inject-1.jar <-- remove, this is part of app server and will cause problems in your app

                          javax.persistence-2.0.0.jar <-- remove, this is part of app server and will cause problems in your app

                          jboss-transaction-api_1.1_spec-1.0.1.Final.jar <-- remove, this is part of app server and will cause problems in your app

                          jcommon-1.0.15.jar

                          jdtcore-3.1.0.jar <-- eclipse compiler? you probably dont need this

                          jfreechart-1.0.12.jar

                          jna-3.4.0.jar

                          jsf-api-2.1.21.jar <-- jsf is part of app server, no need to provide it unless you want to overide default JSF impl but i doubt that

                          jsf-facelets-1.1.15.jar <-- same as above

                          jsf-impl-2.1.21.jar <-- same as above

                          json-20080701.jar

                          jta-1.1.jar  <-- remove, this is part of app server and will cause problems in your app

                          junit-4.11.jar <-- this is unit testing framework, this does not belong to runtime, remove

                          log4j-1.2.17.jar <-- safe to remove as server provides it for you

                          mail-1.4.3.jar <-- remove as this is part of app server

                          myfaces-extcdi-bundle-jsf20-1.0.5.jar

                          org.eclipse.persistence.antlr-3.2.0.v201206041011.jar

                          org.eclipse.persistence.asm-3.3.1.v201206041142.jar

                          org.eclipse.persistence.core-2.4.1.jar

                          org.eclipse.persistence.jpa-2.4.1.jar <-- are you using eclipse link as JPA provider?

                          org.eclipse.persistence.jpa.jpql-2.4.1.jar

                          org.mortbay.jetty-5.1.10.jar <-- why are you bundling jetty servlet container? remove this

                          org.springframework.aop-3.0.5.RELEASE.jar <-- remove as you already bundle spring 3.0.6 below

                          org.springframework.asm-3.0.5.RELEASE.jar <-- remove as you already bundle spring 3.0.6 below

                          org.springframework.beans-3.0.5.RELEASE.jar <-- remove as you already bundle spring 3.0.6 below

                          org.springframework.context-3.0.5.RELEASE.jar <-- remove as you already bundle spring 3.0.6 below

                          org.springframework.context.support-3.0.5.RELEASE.jar <-- remove as you already bundle spring 3.0.6 below

                          org.springframework.core-3.0.5.RELEASE.jar <-- remove as you already bundle spring 3.0.6 below

                          org.springframework.expression-3.0.5.RELEASE.jar <-- remove as you already bundle spring 3.0.6 below

                          org.springframework.jdbc-3.0.5.RELEASE.jar <-- remove as you already bundle spring 3.0.6 below

                          org.springframework.orm-3.0.5.RELEASE.jar <-- remove as you already bundle spring 3.0.6 below

                          org.springframework.oxm-3.0.5.RELEASE.jar <-- remove as you already bundle spring 3.0.6 below

                          org.springframework.test-3.0.5.RELEASE.jar <-- remove as you already bundle spring 3.0.6 below

                          org.springframework.transaction-3.0.5.RELEASE.jar <-- remove as you already bundle spring 3.0.6 below

                          org.springframework.web-3.0.5.RELEASE.jar <-- remove as you already bundle spring 3.0.6 below

                          pepper-grinder-1.0.9.jar

                          persistence-api-1.0.jar <-- remove as this is part of app server

                          platform-3.4.0.jar

                          poi-3.7.jar

                          poi-ooxml-3.7.jar

                          poi-ooxml-schemas-3.7.jar

                          postgresql-9.1-901-1.jdbc4.jar <-- jdbc drivers should not be part of deployment but should be configured on app server

                          primefaces-3.5.x.jar

                          redmond-1.0.9.jar

                          rewrite-servlet-2.0.2.Final.jar

                          selenium-api-2.32.0.jar <-- selenium is testing framework, i doubt it should be part of deployment

                          selenium-chrome-driver-2.32.0.jar <-- same as above

                          selenium-core-1.0-20080914.225453.jar <-- same as above

                          selenium-firefox-driver-2.32.0.jar <-- same as above

                          selenium-remote-driver-2.32.0.jar <-- same as above

                          selenium-server-1.0-20081010.060147.jar <-- same as above

                          selenium-server-coreless-1.0-20081010.060147.jar <-- same as above

                          slf4j-api-1.6.6.jar <-- 3rd logging framework? remove

                          slf4j-log4j12-1.6.6.jar <-- same as above

                          smoothness-1.0.9.jar

                          spring-aop-3.0.6.RELEASE.jar

                          spring-asm-3.0.6.RELEASE.jar

                          spring-beans-3.0.6.RELEASE.jar

                          spring-context-3.0.6.RELEASE.jar

                          spring-core-3.0.6.RELEASE.jar

                          spring-expression-3.0.6.RELEASE.jar

                          spring-mock-1.2.6.jar <-- remove this, as this should only be part of testsuite and also it is extermly olde

                          spring-security-core-3.1.0.RELEASE.jar <-- why 3rd different version of spring? 3.0.5, 3.0.6 and now 3.1.0??

                          spring-security-crypto-3.1.0.RELEASE.jar <-- same as above

                          spring-tx-3.0.5.RELEASE.jar

                          stax-api-1.0.1.jar <-- remove part of jdk/app server

                          xml-apis-1.3.02.jar <-- remove part of jdk/app server

                          xmlbeans-2.3.0.jar

                          • 10. Re: Unsatisfied dependencies for ...
                            scrappy

                            'k, dev is going through the above list, but am curious ...

                             

                            as an example: ant-1.6.5.jar

                             

                            we are  using maven, so not even sure where that is coming from ... we are using hudson 3.0.0 to build the .war file, so is this something that hudson is 'auto-including'? 

                             

                            same with:

                             

                            "castor-1.2.jar <-- i doubt you need it, must be some leftover, probably safe to remove"

                             

                            its not in our pom.xml file, nor in our git repo for the application itself ... so is some of this stuff cruft that hudson (or maven?) is pulling in to build, even though we don't need it for the app itself?  and is there something  hudson I should be doing to clean this out before the war file is created?

                            • 11. Re: Unsatisfied dependencies for ...
                              ctomc

                              What probably happend is that those jars came into war as part of transitive dependanices.

                               

                              I would recommend you running

                              mvn dependency:tree

                              that will help you find out where did dependancies come from for more see http://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html

                               

                              and as for "server/jdk" provided jars goes, define them in pom.xml as <scope>provided</scope

                               

                               

                              --

                              tomaz

                              • 12. Re: Unsatisfied dependencies for ...
                                nickarls

                                Do you have an EJB/ManagedBean that is named Validator? If so, how is it defined (class level annotations etc)

                                (referring to http://stackoverflow.com/questions/10346285/unsatisfied-dependencies-for-type-with-qualifiers-default-at-injection)

                                • 13. Re: Unsatisfied dependencies for ...
                                  scrappy

                                  Passed this onto the developer, and he says definitely not to the former, but is reviewing the StackOverflow posting ...

                                  • 14. Re: Unsatisfied dependencies for ...
                                    scrappy

                                    Just a quick update on this, since I hate searching / finding answers on google only to have the thread left dangling ...

                                     

                                    one of our developers played a bit more, and determined that the deploy issue has to do with one of our dependencies apparently having its own dependency on Hibernate 4:

                                     

                                    <dependency>

                                                <groupId>org.apache.myfaces.extensions.cdi.bundles</groupId>

                                                <artifactId>myfaces-extcdi-bundle-jsf20</artifactId>

                                                <version>1.0.5</version>

                                                <scope>compile</scope>

                                            </dependency>

                                     

                                    which conflicts with the Hibernate5 that is bundled with Wildfly ... they are looking into switching from myFaces -> DeltaSpike as a potential fix ...

                                     

                                    myFaces is being used to provide "windows scope" to the application, instead of session scope ...

                                     

                                    Thanks all ...