title: Jira Plugin development | Servlet issue
body: <p>I am a student working on developing a plugin for <strong>JIRA</strong>, and have been having trouble getting my servlet to read my html file. So now I wonder which annotations are right to use ?, and what dependencies?. I don't get any error messages, I just can't open the index.vm page.</p>
  <p>Would really appreciate if anyone could take a look at my code that I attach below, or just help me find the right person who is knowledgeable in this area.</p>
  <p><em><strong>Thanks for the help // Rickard</strong></em></p>
  <p><strong>My Servlet</strong></p>
  <pre><code>package com.i3tex.plugin.servlet;
  
  import com.atlassian.jira.issue.IssueManager;
  import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;
  import com.atlassian.templaterenderer.TemplateRenderer;
  import com.atlassian.velocity.VelocityManager;
  import com.atlassian.webresource.api.assembler.PageBuilderService;
  import com.google.common.collect.Maps;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  import org.springframework.stereotype.Component;
  import javax.inject.Inject;
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  import java.io.IOException;
  import java.util.Map;
  
  @Component
  public class SumalizerServlet extends HttpServlet {
  
      @ComponentImport
      private final VelocityManager velocityManager;
      @ComponentImport
      private PageBuilderService pageBuilderService;
      private IssueManager im;
      private TemplateRenderer tr;
  
  
      private static final Logger log = LoggerFactory.getLogger(
              SumalizerServlet.class
      );
  
      @Inject
      public SumalizerServlet(VelocityManager velocityManager, PageBuilderService pageBuilderService, IssueManager im, TemplateRenderer tr) {
          this.velocityManager = velocityManager;
          this.pageBuilderService = pageBuilderService;
          this.im = im;
          this.tr = tr;
      }
  
      @Override
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          this.pageBuilderService
                  .assembler()
                  .resources()
                  .requireWebResource(&quot;com.i3tex.plugin.Sumalizer:test-resource&quot;);
  
          Map&lt;String, Object&gt; context = Maps.newHashMap();
          context.put(&quot;ic&quot;, this.im.getIssueCount());
          
          String content = this.velocityManager.getEncodedBody(&quot;/templates/&quot;, &quot;index.vm&quot;, &quot;UTF-8&quot;, context);
          
          response.setContentType(&quot;text/html;charset=utf-8&quot;);
          response.getWriter().write(content);
          response.getWriter().close();
      }
  }
  
  </code></pre>
  <p><strong>Atlassian-plugin.xml</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  
  &lt;atlassian-plugin key=&quot;${atlassian.plugin.key}&quot; name=&quot;${project.name}&quot; plugins-version=&quot;2&quot;&gt; 
    &lt;plugin-info&gt; 
      &lt;description&gt;${project.description}&lt;/description&gt;  
      &lt;version&gt;${project.version}&lt;/version&gt;  
      &lt;vendor name=&quot;${project.organization.name}&quot; url=&quot;${project.organization.url}&quot;/&gt;  
      &lt;param name=&quot;plugin-icon&quot;&gt;images/pluginIcon.png&lt;/param&gt;  
      &lt;param name=&quot;plugin-logo&quot;&gt;images/pluginLogo.png&lt;/param&gt; 
    &lt;/plugin-info&gt;  
    
    &lt;resource type=&quot;i18n&quot; name=&quot;i18n&quot; location=&quot;Sumalizer&quot;/&gt;  
    &lt;web-resource key=&quot;Sumalizer-resources&quot; name=&quot;Sumalizer Web Resources&quot;&gt; 
      &lt;resource type=&quot;download&quot; name=&quot;Sumalizer.css&quot; location=&quot;/css/Sumalizer.css&quot;/&gt;  
      &lt;resource type=&quot;download&quot; name=&quot;Sumalizer.js&quot; location=&quot;/js/Sumalizer.js&quot;/&gt;  
      &lt;resource type=&quot;download&quot; name=&quot;images/&quot; location=&quot;/images&quot;/&gt;  
      &lt;context&gt;Sumalizer&lt;/context&gt;
    &lt;/web-resource&gt;  
  
    &lt;!--  Menu link to my servlet  --&gt;
    &lt;web-item name=&quot;Sumalizer&quot; i18n-name-key=&quot;sumalizer.name&quot; key=&quot;sumalizer&quot; section=&quot;find_link/issues_new&quot; weight=&quot;1000&quot;&gt; 
      &lt;description key=&quot;sumalizer.description&quot;&gt;The Sumalizer Plugin&lt;/description&gt;  
      &lt;label key=&quot;sumalizer.label&quot;/&gt;  
      &lt;link linkId=&quot;sumalizer-link&quot;&gt;/plugins/servlet/sumalizer&lt;/link&gt; 
    &lt;/web-item&gt;
  
    &lt;!--  This is my servlet  --&gt;
    &lt;servlet name=&quot;Sumalizer Servlet&quot; i18n-name-key=&quot;sumalizer-servlet.name&quot; key=&quot;sumalizer-servlet&quot; class=&quot;com.i3tex.plugin.servlet.SumalizerServlet&quot;&gt;
      &lt;description key=&quot;sumalizer-servlet.description&quot;&gt;The Sumalizer Servlet Plugin&lt;/description&gt;  
      &lt;url-pattern&gt;/sumalizer&lt;/url-pattern&gt; 
    &lt;/servlet&gt;
  
    &lt;!--  My test resource  --&gt;
    &lt;web-resource key=&quot;test-resource&quot; name=&quot;test-resource&quot;&gt;
      &lt;resource type=&quot;download&quot; name=&quot;test.css&quot; location=&quot;/css/test.css&quot;/&gt;
      &lt;resource type=&quot;download&quot; name=&quot;test.js&quot; location=&quot;/js/test.js&quot;/&gt;
    &lt;/web-resource&gt;
    
  &lt;/atlassian-plugin&gt;
  
  </code></pre>
  <p><strong>This is my Pom.xml</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  
  &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.i3tex.plugin&lt;/groupId&gt;
      &lt;artifactId&gt;Sumalizer&lt;/artifactId&gt;
      &lt;version&gt;0.0.1&lt;/version&gt;
      &lt;organization&gt;
          &lt;name&gt;i3tex&lt;/name&gt;
          &lt;url&gt;http://www.i3tex.com/&lt;/url&gt;
      &lt;/organization&gt;
      &lt;name&gt;Sumalizer&lt;/name&gt;
      &lt;description&gt;This is the Sumalizer plugin.&lt;/description&gt;
      &lt;packaging&gt;atlassian-plugin&lt;/packaging&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.atlassian.templaterenderer&lt;/groupId&gt;
          &lt;artifactId&gt;atlassian-template-renderer-api&lt;/artifactId&gt;
          &lt;version&gt;4.1.1&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.atlassian.jira&lt;/groupId&gt;
          &lt;artifactId&gt;jira-api&lt;/artifactId&gt;
          &lt;version&gt;${jira.version}&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;jta&lt;/groupId&gt;
                  &lt;artifactId&gt;jta&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
      
      &lt;dependency&gt;
          &lt;groupId&gt;com.atlassian.sal&lt;/groupId&gt;
          &lt;artifactId&gt;sal-api&lt;/artifactId&gt;
          &lt;version&gt;2.0.17&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
          &lt;version&gt;2.4&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
          &lt;version&gt;1.6.6&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.atlassian.plugin&lt;/groupId&gt;
          &lt;artifactId&gt;atlassian-spring-scanner-annotation&lt;/artifactId&gt;
          &lt;version&gt;${atlassian.spring.scanner.version}&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      
      &lt;dependency&gt;
          &lt;groupId&gt;javax.inject&lt;/groupId&gt;
          &lt;artifactId&gt;javax.inject&lt;/artifactId&gt;
          &lt;version&gt;1&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
          &lt;version&gt;4.1.1&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax.ws.rs&lt;/groupId&gt;
          &lt;artifactId&gt;jsr311-api&lt;/artifactId&gt;
          &lt;version&gt;1.1.1&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.atlassian.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;atlassian-plugins-core&lt;/artifactId&gt;
          &lt;version&gt;5.3.5&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&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;5.3.4&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
      &lt;build&gt;
          &lt;plugins&gt;
           &lt;plugin&gt;
                  &lt;groupId&gt;com.atlassian.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;jira-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${amps.version}&lt;/version&gt;
                  &lt;extensions&gt;true&lt;/extensions&gt;
                  &lt;configuration&gt;
                      &lt;productVersion&gt;${jira.version}&lt;/productVersion&gt;
                      &lt;productDataVersion&gt;${jira.version}&lt;/productDataVersion&gt;
                      &lt;enableQuickReload&gt;true&lt;/enableQuickReload&gt;
  
                      &lt;instructions&gt;
                          &lt;Atlassian-Plugin-Key&gt;${atlassian.plugin.key}&lt;/Atlassian-Plugin-Key&gt;
  
                          &lt;Export-Package&gt;
                              com.i3tex.api,
                          &lt;/Export-Package&gt;
                          
                          &lt;Import-Package&gt;
                              org.springframework.osgi.*;resolution:=&quot;optional&quot;,
                              org.eclipse.gemini.blueprint.*;resolution:=&quot;optional&quot;,
                              *
                          &lt;/Import-Package&gt;
  
                          &lt;Spring-Context&gt;*&lt;/Spring-Context&gt;
                      &lt;/instructions&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;com.atlassian.plugin&lt;/groupId&gt;
                  &lt;artifactId&gt;atlassian-spring-scanner-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${atlassian.spring.scanner.version}&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;atlassian-spring-scanner&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;phase&gt;process-classes&lt;/phase&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;includeExclude&gt;+com.atlassian.jira.plugins.issue.create.*&lt;/includeExclude&gt;
                      &lt;scannedDependencies&gt;
                          &lt;dependency&gt;
                              &lt;groupId&gt;com.atlassian.plugin&lt;/groupId&gt;
                              &lt;artifactId&gt;atlassian-spring-scanner-external-jar&lt;/artifactId&gt;
                          &lt;/dependency&gt;
                      &lt;/scannedDependencies&gt;
                      &lt;verbose&gt;false&lt;/verbose&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;properties&gt;
          &lt;jira.version&gt;7.13.18&lt;/jira.version&gt;
          &lt;amps.version&gt;8.1.0&lt;/amps.version&gt;
          &lt;osgi.javaconfig.version&gt;0.2.0&lt;/osgi.javaconfig.version&gt;
          &lt;spring.version&gt;4.2.5.RELEASE&lt;/spring.version&gt;
          &lt;plugin.testrunner.version&gt;2.0.1&lt;/plugin.testrunner.version&gt;
          &lt;atlassian.spring.scanner.version&gt;2.2.0&lt;/atlassian.spring.scanner.version&gt;
          &lt;atlassian.plugin.key&gt;${project.groupId}.${project.artifactId}&lt;/atlassian.plugin.key&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
      &lt;/properties&gt;
      
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;releases&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
                  &lt;checksumPolicy&gt;warn&lt;/checksumPolicy&gt;
              &lt;/releases&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
                  &lt;updatePolicy&gt;never&lt;/updatePolicy&gt;
                  &lt;checksumPolicy&gt;warn&lt;/checksumPolicy&gt;
              &lt;/snapshots&gt;
              &lt;id&gt;atlassian-public&lt;/id&gt;
              &lt;url&gt;https://maven.atlassian.com/repository/public&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
      &lt;pluginRepositories&gt;
          &lt;pluginRepository&gt;
              &lt;releases&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
                  &lt;checksumPolicy&gt;warn&lt;/checksumPolicy&gt;
              &lt;/releases&gt;
              &lt;snapshots&gt;
                  &lt;updatePolicy&gt;never&lt;/updatePolicy&gt;
                  &lt;checksumPolicy&gt;warn&lt;/checksumPolicy&gt;
              &lt;/snapshots&gt;
              &lt;id&gt;atlassian-public&lt;/id&gt;
              &lt;url&gt;https://maven.atlassian.com/repository/public&lt;/url&gt;
          &lt;/pluginRepository&gt;
      &lt;/pluginRepositories&gt;
  
  &lt;/project&gt;
  
  </code></pre>