WELD-001408 Unsatisfied Dependencies Exception When Deploying An Application

(Doc ID 1444342.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle WebLogic Server - Version 12.1.1.0 to 12.1.1.0 [Release 12c]
Information in this document applies to any platform.

Symptoms

This problem is fixed with WLS 12.1.2 version.


A J2EE application cannot be  deployed into 12.1.1 WLS server running on Windows platform.

This application is having two modules : WEB, EJB module and a shared library which is used  by those two modules .
The application EAR file is composed of :
  - testcdiEJB.jar (EJB module )
  - testcdiWeb.war (WEB module)
  - lib/ testcdiUtil.jar (library shared by EJB, WEB modules)

The testUtilPojo.class is stored in testcdiUtil.jar .

The Web module is composed of a servlet
which is injecting an EJB pojo, a Pojo (TestUtilPojo) , and an EJB as the following :

public class TestServlet extends HttpServlet {

private static final long serialVersionUID = 1L;

@EJB
Test testEJB;
@Inject
Test testInject;
@Inject
TestUtilPojo testUtilPojo;

@Inject
TestEjbPojo testEjbPojo;

..
}


When deploying this application, it fails with the   'WELD-001408 Unsatisfied dependencies for type' Exception :

<10 mars 2012 17 h 35 CET> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID "1331397331470" for task "2". Error
is: "weblogic.management.DeploymentException: "
weblogic.management.DeploymentException:
at weblogic.application.internal.BaseDeployment.throwAppException(BaseDeployment.java:123)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:239)
at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:61)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:158)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
Truncated. see log file for complete stacktrace
Caused By: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [TestUtilPojo] with qualifiers [@Default] at injection point [[field] @Injecttest.cdi.web.TestServlet.testUtilPojo]
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:258)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:105)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:125)
at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:324)
at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:309)
Truncated. see log file for complete stacktrace
>
<10 mars 2012 17 h 35 CET> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application "testcdi".>
<10 mars 2012 17 h 35 CET> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.management.DeploymentException:
at weblogic.application.internal.BaseDeployment.throwAppException(BaseDeployment.java:123)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:239)


The TestUtilPojo.class cannot not be injected in  TestServlet.java.

Note that storing testcdiUtil.jar  into the APP-INF/lib does not solve the problem.
Moreover, this problem occurs when WLS server is running on Windows  platform. On Linux platform, this problem does not occur.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms