title: org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:403)
body: <p>I have run into this "WELD-001408 Unsatisfied dependencies for type [Injector] with qualifiers..." error when deploying a Maven project to Glassfish 4. I searched on the internet and added scope, added bean-discovery-mode="all", all other things and still could not get it work. I am learning Spring Framework and Java EE. Would someone please take a look at my code and help me out? Thanks!</p>
  
  <p>stacktrace:</p>
  
  <pre><code>2014-01-28T11:29:44.755-0600|SEVERE: Exception while loading the app
  2014-01-28T11:29:44.755-0600|SEVERE: Undeployment failed for context /MessageBoard
  2014-01-28T11:29:44.786-0600|SEVERE: Exception while loading the app : CDI deployment failure:Exception List with 2 exceptions:
  Exception 0 :
  org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type   [Injector] with qualifiers [@Default] at injection point [[BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedMethod] @Inject org.eclipse.sisu.inject.DefaultBeanLocator.autoPublish(Injector)]
  at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:403)
  at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:325)
  at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:177)
  at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:208)
  at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:519)
  at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:505)
  at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:480)
  at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:536)
  at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:216)
  at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
  at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328)
  </code></pre>
  
  <p>codes:</p>
  
  <pre><code>package com.aaa.chapter5;
  
      public class MessageBoardServiceImpl implements MessageBoardService {
  
  private Map&lt;Long, Message&gt; messages = new LinkedHashMap&lt;Long, Message&gt;();
  
  public List&lt;Message&gt; listMessages() {
  
      return (List)messages.values();
  }
  
  public synchronized void postMessages(Message message) {
      Long id = System.currentTimeMillis();
      message.setId(id);
      messages.put(id, message);
  
  
  }
  }
  
  
  
  package com.aaa.chapter5.web;
  
  
  // Bind controller to URL /reservationForm
  // initial view will be resolved to the name returned in the default GET method
  @Controller
  @RequestMapping("/messagePost*")
  @RequestScoped
  //@SessionAttributes("message") // Command name class was used in earlier Spring versions
  public class MessagePostController {
  
      private MessageBoardService messageBoardService;
  
  
      @Autowired
      public void MessagePostController(MessageBoardService messageBoardService) {
         this.messageBoardService = messageBoardService;
  }
  
  
  // Controller will always look for a default GET method to call first, irrespective of name
  // In this case, named setupForm to ease identification
  @RequestMapping(method = RequestMethod.GET)
  public String setupForm(Model model) {
  // Create inital message object
      Message message = new Message();
  // Add message to model so it can be display in view
      model.addAttribute("message", message);
      return "messagePost";
  }
  
  @RequestMapping(method = RequestMethod.POST)
  public String onSubmit(@ModelAttribute("message") Message message, BindingResult result) { //,    SessionStatus status) { 
      if (result.hasErrors()) {
      // Errors, return to Form view
          return "messagePost";
      } else {
      // No errors make reservation 
          messageBoardService.postMessages(message);
      // Set complete, mark the handler's session processing as complete
      // Allowing for cleanup of session attributes.
      //status.setComplete();
      // Redirect to reservationSuccess URL, defined in ReservationSuccessController
          return "redirect:messageList";
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>pom.xml:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-    instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.aaa.chapter5&lt;/groupId&gt;
  &lt;artifactId&gt;MessageBoard&lt;/artifactId&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;MessageBoard Maven Webapp&lt;/name&gt;
  &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  &lt;properties&gt;
   &lt;glassfish.directory&gt;C:/Tools/glassfish4/glassfish&lt;/glassfish.directory&gt;
   &lt;/properties&gt; 
  
  &lt;dependencies&gt;
    &lt;dependency&gt;
    &lt;groupId&gt;junit&lt;/groupId&gt;
    &lt;artifactId&gt;junit&lt;/artifactId&gt;
    &lt;version&gt;3.8.1&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework&lt;/groupId&gt;
      &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
      &lt;version&gt;4.0.0.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework&lt;/groupId&gt;
      &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
      &lt;version&gt;4.0.0.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
      &lt;artifactId&gt;spring-security-core&lt;/artifactId&gt;
      &lt;version&gt;3.2.0.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.glassfish.web&lt;/groupId&gt;
      &lt;artifactId&gt;javax.servlet.jsp.jstl&lt;/artifactId&gt;
      &lt;version&gt;1.2.2&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework&lt;/groupId&gt;
      &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
      &lt;version&gt;4.0.0.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.maven&lt;/groupId&gt;
      &lt;artifactId&gt;maven-project&lt;/artifactId&gt;
      &lt;version&gt;3.0-alpha-2&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.maven&lt;/groupId&gt;
      &lt;artifactId&gt;maven-plugin-api&lt;/artifactId&gt;
      &lt;version&gt;3.1.1&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.maven&lt;/groupId&gt;
      &lt;artifactId&gt;maven-artifact&lt;/artifactId&gt;
      &lt;version&gt;3.1.1&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework&lt;/groupId&gt;
      &lt;artifactId&gt;spring-aspects&lt;/artifactId&gt;
      &lt;version&gt;4.0.0.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
      &lt;artifactId&gt;aspectjweaver&lt;/artifactId&gt;
      &lt;version&gt;1.7.4&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.glassfish.maven.plugin&lt;/groupId&gt;
      &lt;artifactId&gt;maven-glassfish-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.1&lt;/version&gt;
      &lt;type&gt;maven-plugin&lt;/type&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p></p>
  
  <p></p>
  
  <p>web.xml</p>
  
  <pre><code>&lt;web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
      http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt;
  
  
  &lt;display-name&gt;Archetype Created Web Application&lt;/display-name&gt;
  
  
  &lt;context-param&gt;
   &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
   &lt;param-value&gt;/WEB-INF/board-service.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;listener&gt;
  &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  &lt;servlet&gt;
  &lt;servlet-name&gt;board&lt;/servlet-name&gt;
  &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
  &lt;servlet-name&gt;board&lt;/servlet-name&gt;
  &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>board-service.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:context="http://www.springframework.org/schema/context"
  xmlns:mvc="http://www.springframework.org/schema/mvc"
  xsi:schemaLocation="http://www.springframework.org/schema/mvc     http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
      http://www.springframework.org/schema/beans     http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd"&gt;
  
  &lt;context:component-scan base-package="com.aaa.chapter5" /&gt;  
  &lt;mvc:annotation-driven /&gt; 
  </code></pre>
  
  <p>board-servlet.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:context="http://www.springframework.org/schema/context"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd"&gt;
  
  &lt;context:component-scan base-package="com.aaa.chapter5.web"/&gt;
  &lt;bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
    &lt;property name="prefix" value="/WEB-INF/jsp/" /&gt;
    &lt;property name="suffix" value=".jsp" /&gt;
  
  &lt;/bean&gt;
  
  &lt;/beans&gt;
  
  &lt;bean id="messageBoard"
      class="com.aaa.chapter5.MessageBoardServiceImpl"&gt;
  &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p></p>