Injecting message driven beans
<p>In an enterprise application, I'm trying to inject MessageDriven beans into the web-application (to a REST service) using netBeans 8.1. I dont get any warnings in the IDE, however, at deploy time i get the following error:</p>

<p>Severe:   Exception while loading the app : CDI deployment failure:WELD-001408: Unsatisfied dependencies for type StatisticsBean with qualifiers @Default
  at injection point [BackedAnnotatedField] @Inject private sv.mycompany.rest.RestService.statisticsBean</p>

<p>Here is one of the beans i'm trying to inject:</p>

<pre><code>@MessageDriven(mappedName = "dzsobTopik")
public class StatisticsBean implements MessageListener{

private  Logger LOGGER = Logger.getLogger(StatisticsBean.class.getSimpleName());
private int scheduledJobs = 0;

@Inject
private JMSContext jmsContext;

private static Map&lt;Integer, Boolean&gt; results = new HashMap&lt;&gt;();

public StatisticsBean() {
}



public static Map&lt;Integer, Boolean&gt; getResults() {
    return results;
}

public void setResults(Map&lt;Integer, Boolean&gt; results) {
    StatisticsBean.results = results;
}



@Override
public void onMessage(Message message) {
    if(message instanceof JobScheduledMessage){
        scheduledJobs++;
    }
    else if(message instanceof JobCompletedMessage &amp;&amp; scheduledJobs&gt;0) {
        if(((JobCompletedMessage) message).getTimestamp()&lt;5){
            LOGGER.log(Level.INFO, "Job successful!");
                results.put(((JobCompletedMessage) message).getJobnumber(), Boolean.TRUE);
                scheduledJobs--;
        }
        else {
                LOGGER.log(Level.INFO, "Job unsuccessful!");
                results.put(((JobCompletedMessage) message).getJobnumber(), Boolean.FALSE);
                scheduledJobs--;
            }
    }
}
}
</code></pre>

<p>And here is my restService class:</p>

<pre><code>@Path("/start")
@Produces(MediaType.APPLICATION_JSON)
public class RestService {

@Inject
private JobScheduler jobScheduler;

@Inject
private StatisticsBean statisticsBean;

@Inject
private FastWorker fastWorker;

@Inject
private SlowWorker slowWorker;

@Inject
private NormalWorker normalWorker;

@GET
@Produces(MediaType.TEXT_PLAIN)
public String startSimulation() throws InterruptedException{
    jobScheduler.queueNewJobs();
     return "Started simulation";
}

@GET
@Path("/jobresult")
public Map&lt;Integer,Boolean&gt; getJobResults(){
    return StatisticsBean.getResults();
}

}
</code></pre>

<p>I have beans.xml in both the ejb and the web module, with discovery mode set to "all" in both cases. What could be the problem?</p>