11 Replies Latest reply on May 30, 2013 10:52 AM by Alberto Souza

    @Alternative that depends of beans inside another jar not being loaded

    Alberto Souza Newbie

      Hi,

       

       

      I have an @Alternative bean inside a jar with dependencies that are in other jar with beans.xml too. When server starts, i get an error saying that some dependencies are not satisfied.

       

       

      Here is the exception:

      [code java]

      org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [HttpServletRequest] with qualifiers [@Default] at injection point [[field] @Inject private app.controllers.UsuariosController.request]

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

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

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

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

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

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

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

        at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:83)

        at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

        at java.lang.Thread.run(Thread.java:722)

      [/code]

       

       

      When i run the tests, all dependencies are satisfied. My guess is: When cdi is scanning one jar, classes that are inside another, were not scanned yet. Because of this behaviour, my alternative is not being enabled. When i put all together, everything worked . Any ideas?

       

       

      Alberto