3 Replies Latest reply on Dec 29, 2014 8:19 PM by arungujjartest

    CDI Weld bean visibility issue at the time of deployment

    arungujjartest

      Hi,

       

      I have created multiple modules, like DAO, UTIL, MODEL and REST. DAO, UTIL and MODEL generates a jar library which will be included in REST war. I have a CDI Weld beans defied in DAO module. As DAO is included as part of the library in REST war bundle, these beans are not visible and tomcat 8.0.15 is throwing 'org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies' error at server startup. If I move all the files from DAO module to REST war then it works fine but I would like to know how to resolve this dependency issue. Can someone tell me how to fix this issue?

       

      Here is the full stack trace for reference.

       

      28-Dec-2014 20:32:13.140 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:

      org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/zcard]]

              at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)

              at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)

              at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)

              at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)

              at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917)

              at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701)

              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

              at java.util.concurrent.FutureTask.run(FutureTask.java:262)

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

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

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

      Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type CardBalanceDAO with qualifiers @Default

        at injection point [UnbackedAnnotatedField] @Inject com.example.rest.service.CardService.cardBalance

        at com.example.rest.service.CardService.cardBalance(CardService.java:0)

       

       

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

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

              at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)

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

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

              at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)

              at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)

              at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)

              at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)

              ... 4 more