Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WELD-001408 Unsatisfied dependencies for type ... with qualifiers [@Default] at injection point

I got a stupid problem when deploying my Java Application on JBoss. Before I changed my source code using an interface class everything was fine. So here is my problem:

public interface FWInterface {
   public FWResult process(FWRequest fwRequest, FWResult fwResult,
                           Integer commitRows) throws Exception;
}

...

@Stateless
public class FWHandlerSqrMind extends FWHandlerDefault implements FWInterface {

   public FWResult process(FWRequest fwRequest, FWResult fwResult, Integer commitRows)
                   throws Exception {
                ... some JavaCode here
   }
}

This ends up with the following Error at deployment on JBoss 7.1:

10:05:34,838 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start service jboss.deployment.unit."mdk-exchange-1.1.0.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."mdk-exchange-1.1.0.war".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [FWHandlerAufTracking] with qualifiers [@Default] at injection point [[field] @Inject de.mdkbw.exchange.filewatcher.FWMain.fwhAufTracking] at org.jboss.as.weld.services.WeldService.start(WeldService.java:83) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_15] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_15] at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_15] Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [FWHandlerAufTracking] with qualifiers [@Default] at injection point [[field] @Inject de.mdkbw.exchange.filewatcher.FWMain.fwhAufTracking] at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:311) at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:280) at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:143) at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:163) at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:382) at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:367) at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:379) at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:83) at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)

If I remove the implementation everything is ok. Could anybody tell me what the problem is? Am I too stupid?? Thanks in advance!

like image 271
PT_STAR Avatar asked May 09 '14 10:05

PT_STAR


3 Answers

How do you inject your bean? Like that?

@Inject
private FWHandlerSqrMind handler;

If so could you try to inject it like that:

@Inject
private FWInterface handler;
like image 52
phoenix7360 Avatar answered Oct 14 '22 15:10

phoenix7360


Do you have META-INF/beans.xml or WEB-INF/beans.xml file in your class path?

like image 29
VladS Avatar answered Oct 14 '22 14:10

VladS


Missing beans.xml was the problem in my case (WildFly 8.2.0).
Just placing a simple beans.xml like the following solved this problem:

    <?xml version="1.0"?>
    <beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd" />
like image 6
visvadw Avatar answered Oct 14 '22 15:10

visvadw