title: No qualifying bean of type 'com.atlassian.confluence.user.UserAccessor' available error
body: <p>I am developing a Confluence Server plugin and I keep getting this error whenever I access my servlet module.</p>
  <blockquote>
  <p>com.atlassian.util.concurrent.LazyReference$InitializationException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘dso.intern.plugin.BulkUserCreatorToolServlet’: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.atlassian.confluence.user.UserAccessor’ available: expected
  at least 1 bean which qualifies as autowire candidate.</p>
  </blockquote>
  <p>Here's my code:</p>
  <pre><code>@Named(&quot;BulkUserCreatorToolServlet&quot;)
  public class BulkUserCreatorToolServlet extends HttpServlet{
  
      private final UserAccessor userAccessor;
  
      public BulkUserCreatorToolServlet(UserAccessor userAccessor){
          this.userAccessor = userAccessor;
      }
  
      @Override
      protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
  
          // Create a factory for disk-based file items
          DiskFileItemFactory factory = new DiskFileItemFactory();
  
          // Configure a repository (to ensure a secure temp location is used)
          ServletContext servletContext = this.getServletConfig().getServletContext();
          File repository = (File) servletContext.getAttribute(&quot;javax.servlet.context.tempdir&quot;);
          factory.setRepository(repository);
  
          // Create a new file upload handler
          ServletFileUpload upload = new ServletFileUpload(factory);
  
          try{
              //Parse the request to get file items
              List&lt;FileItem&gt; fileItems = upload.parseRequest(request);
  
              // Process the uploaded items
              Iterator&lt;FileItem&gt; iter = fileItems.iterator();
              String contentType = null;
              while(iter.hasNext()){
                  FileItem item = iter.next();
  
                  if(!item.isFormField()){
                      String content = item.getString();
                      StringReader sReader = new StringReader(content);
                      Iterable&lt;CSVRecord&gt; records = CSVFormat.DEFAULT.withFirstRecordAsHeader().parse(sReader);
                      for(CSVRecord record : records){
                          String username = record.get(&quot;ï»¿Username&quot;);    //UTF-8 BOM
                          String fullname = record.get(&quot;Fullname&quot;);
                          String email = record.get(&quot;Email&quot;);
                          String password = record.get(&quot;Password&quot;);
                          String groupsToBeAddedInto = record.get(&quot;GroupsToBeAddedInto&quot;);
  
                          DefaultUser defaultUser = new DefaultUser(username, fullname, email);
                          ConfluenceUser newUser = userAccessor.createUser(defaultUser, Credential.unencrypted(password));
                       userAccessor.addMembership(UserAccessor.GROUP_CONFLUENCE_USERS, username);
                          
                      }
                  }
              }
              
              response.setContentType(&quot;text/html; charset=UTF-8&quot;);
  
              PrintWriter out = response.getWriter();
              out.println(&quot;&lt;!DOCTYPE html&gt;&quot;);
              out.println(&quot;&lt;html&gt;&lt;head&gt;&quot;);
              out.println(&quot;&lt;meta name=\&quot;decorator\&quot; content=\&quot;atl.admin\&quot; /&gt;&quot;);
              out.println(&quot;&lt;title&gt;Response Page&lt;/title&gt;&lt;/head&gt;&lt;/html&gt;&quot;);
  
          }
          catch(FileUploadException e){
              e.printStackTrace();
          }
          catch(Exception e){
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  <p>How should I fix this?</p>