title: Jersey: HTTP Status 500
body: <p>I am getting following error in browser</p>
  
  <pre><code>HTTP Status 500 – Internal Server Error
  Type Exception Report
  
  Message Servlet.init() for servlet [jersey-serlvet] threw exception
  
  Description The server encountered an unexpected condition that prevented it from fulfilling the request.
  
  Exception
  
  javax.servlet.ServletException: Servlet.init() for servlet [jersey-serlvet] threw exception
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
      org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367)
      org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
      org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1598)
      org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      java.base/java.lang.Thread.run(Thread.java:830)
  
  Root Cause
  
  java.lang.IllegalArgumentException
      jersey.repackaged.org.objectweb.asm.ClassReader.&lt;init&gt;(ClassReader.java:170)
      jersey.repackaged.org.objectweb.asm.ClassReader.&lt;init&gt;(ClassReader.java:153)
      jersey.repackaged.org.objectweb.asm.ClassReader.&lt;init&gt;(ClassReader.java:424)
      org.glassfish.jersey.server.internal.scanning.AnnotationAcceptingListener.process(AnnotationAcceptingListener.java:170)
      org.glassfish.jersey.server.ResourceConfig.scanClasses(ResourceConfig.java:908)
      org.glassfish.jersey.server.ResourceConfig._getClasses(ResourceConfig.java:862)
      org.glassfish.jersey.server.ResourceConfig.getClasses(ResourceConfig.java:768)
      org.glassfish.jersey.server.ResourceConfig$RuntimeConfig.&lt;init&gt;(ResourceConfig.java:1199)
      org.glassfish.jersey.server.ResourceConfig$RuntimeConfig.&lt;init&gt;(ResourceConfig.java:1171)
      org.glassfish.jersey.server.ResourceConfig.createRuntimeConfig(ResourceConfig.java:1167)
      org.glassfish.jersey.server.ApplicationHandler.&lt;init&gt;(ApplicationHandler.java:344)
      org.glassfish.jersey.servlet.WebComponent.&lt;init&gt;(WebComponent.java:339)
      org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:170)
      org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:362)
      javax.servlet.GenericServlet.init(GenericServlet.java:158)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
      org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367)
      org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
      org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860)
      org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1598)
      org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      java.base/java.lang.Thread.run(Thread.java:830)
  </code></pre>
  
  <p>I am developing a JERSEY webservice in Intellij, deployed in tomcat configured in Intellij only. It is deployed successfully. Logs from tomcat</p>
  
  <pre><code>Connected to server
  [2020-01-04 08:19:50,758] Artifact Tarkshala-Scholars-Engine:war exploded: Artifact is being deployed, please wait...
  04-Jan-2020 08:19:54.184 INFO [RMI TCP Connection(2)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
  [2020-01-04 08:19:54,932] Artifact Tarkshala-Scholars-Engine:war exploded: Artifact is deployed successfully
  [2020-01-04 08:19:54,932] Artifact Tarkshala-Scholars-Engine:war exploded: Deploy took 4,174 milliseconds
  </code></pre>
  
  <p>My web.xml is as following:</p>
  
  <pre><code>&lt;web-app&gt;
    &lt;display-name&gt;Archetype Created Web Application&lt;/display-name&gt;
    &lt;servlet&gt;
      &lt;servlet-name&gt;jersey-serlvet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.glassfish.jersey.servlet.ServletContainer&lt;/servlet-class&gt;
      &lt;init-param&gt;
        &lt;param-name&gt;jersey.config.server.provider.packages&lt;/param-name&gt;
        &lt;param-value&gt;com.tarkshala.scholars.engine.webservices&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;
  
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;jersey-serlvet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>My service is </p>
  
  <pre><code>@Path("/authentication")
  public class AuthenticationService extends SpringApplication {
  
      @GET
      @Path("/greet")
      @Produces(MediaType.APPLICATION_JSON)
      public Response greet(){
  
          return getBean(AuthenticationServiceHandler.class).greet();
      }
  }
  </code></pre>
  
  <p>It looks all fine to me, not sure why is it not working. I am hitting at <a href="http://localhost:8080/authentication/greet" rel="nofollow noreferrer">http://localhost:8080/authentication/greet</a></p>