DeploymentException: WELD-001408: Unsatisfied dependencies for RequestScope object
arungujjartest Jan 8, 2015 3:42 PMHi,
I am deploying an application using CDI Weld 2.2.7, I have modules like REST, DAO and MODEL, REST generates the war, DAO and MODEL are libraries, that generates jar files. These DAO and MODEL libraries are added as dependency in REST pom.xml.
I have @Request and @Application scoped beans in all the modules (REST, DAO and MODEL). I have empty beans.xml defied in /WEB-INF/classes/META-INF/ folder. I do have beans.xml in DAO and MODEL modules under /src/main/resource/MATA-INF folder.
I am able to generate the build but fails that the time of deployment with error WELD-001408 for @RequestScoped bean. If I comment this bean and deploy everything works fine. Weld is able to find @ApplicationScoped beans but not @RequestScoped bean (TxnLogDiagnosticContext is a RequestScoped bean).
Can someone help with me on how to fix this issue?
Here is the entire exception log:
2015-01-07 22:34:33 DEBUG Reflection:80 - WELD-000601: interface javax.inject.Named is missing @Target. Weld will use this annotation, however this may make the application unportable.
2015-01-07 22:34:34 DEBUG Bootstrap:433 - WELD-000100: Weld initialized. Validating beans
07-Jan-2015 22:34:34.129 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:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type TxnLogDiagnosticContext with qualifiers @Default
at injection point [BackedAnnotatedField] @Inject protected com.example.webservice.interceptor.TxnLogInterceptor.txnLogDC
at com.example.webservice.interceptor.TxnLogInterceptor.txnLogDC(TxnLogInterceptor.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.validateInterceptor(Validator.java:568)
at org.jboss.weld.bootstrap.ConcurrentValidator$2.doWork(ConcurrentValidator.java:85)
at org.jboss.weld.bootstrap.ConcurrentValidator$2.doWork(ConcurrentValidator.java:83)