2 Replies Latest reply on Feb 2, 2011 12:04 AM by richard yang

    WELD-001408 Unsatisfied dependencies during deployment of war if for injection of a bean with implementation in a jar of the war

    richard yang Newbie

      I deploy a war in jboss 6 final.
      Got deployment exception such as:

      22:40:51,796 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=vfs:///D:/apps/jboss/jboss-6.0.0.Final/server/epen/deploy/epen-user.war_WeldBootstrapBean state=Create: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [TestService] with qualifiers [@Default] at injection point [[field] @Inject private com.pearson.epen.test.TestController.testService]
           at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:305) [:6.0.0.Final]
           at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:139) [:6.0.0.Final]

      Here is my code structure:
      Controller (jsf bean) class TestController.java is injecting a bean of TestService type:
             private TestService testService;

      TestService is an interface and the only implementation class is TestServiceImpl. However, TestServiceImpl is in a jar (called Impl.jar of the web-inf/lib and TestService is in another jar (Api.jar. As you can see, the controller class is trying to injecting TestService bean but could not find it.

      If I put the controller and TestServiceImpl into one package, i.e. under web-inf/classes, that the deployment is successful.

      By the way, the TestServiceImpl in my case is either seam managed (@Transanctions) or a session bean.

      Is this because that there might be a defect in the war deployer of jboss 6? Is this war related only?