title: Spring io @Autowired: The blank final field may not have been initialized
body: <p>what I assume is a pretty basic question here-</p>
  
  <p>There are several flavors of questions regarding this error, but none in the first 5 results that have the added nuance of Spring.</p>
  
  <p>I have the beginnings of a REST-ful webapp written in spring. I am trying to connect it to a database.</p>
  
  <p>I have an entity named Workspace and am trying to use the spring injection of a bean( correct terminology ?) to save an instance of the workspace entity</p>
  
  <pre><code>package com.parrit;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.util.Assert;
  import org.springframework.web.bind.annotation.RequestBody;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.RestController;
  
  import com.parrit.models.Workspace;
  import com.parrit.models.WorkspaceRepository;
  
  @RestController
  @RequestMapping("/workspace")
  public class WorkspaceController {
  
      @Autowired
      private final WorkspaceRepository repository;
  
      @RequestMapping(method = RequestMethod.POST)
      void save( @RequestBody String workspaceHTML) {
          Workspace ws = new Workspace();
          ws.setHTML(workspaceHTML);
          repository.save(ws);
      }
  }
  </code></pre>
  
  <p>My error is on the repository variable <code>private final WorkspaceRepository repository</code>. The compiler is complaining that it may not be initialized and attempting to run the app yields the same result.</p>
  
  <p>How do I get an instance of this repository object into my controller in order to do save operations on it?</p>