title: Getting Error scanning file when running jetty 9 on java 8 using the maven jetty plugin
body: <p>I'm running a trivial <code>Hello World</code> web application using <a href="/questions/tagged/servlet-3.1" class="post-tag" title="show questions tagged &#39;servlet-3.1&#39;" rel="tag">servlet-3.1</a>, <a href="/questions/tagged/jetty-9" class="post-tag" title="show questions tagged &#39;jetty-9&#39;" rel="tag">jetty-9</a> running on <a href="/questions/tagged/jdk-8" class="post-tag" title="show questions tagged &#39;jdk-8&#39;" rel="tag">jdk-8</a> and using the <code>maven-jetty-plugin</code>.</p>
  
  <pre><code>public class HelloWorldServlet extends HttpServlet {
  
      @Override
      protected void doGet(HttpServletRequest request, HttpServletResponse response)  {
          try {
              String message = "Hello Jetty From the HelloWorldServlet";
              OutputStream stream = response.getOutputStream();
              stream.write(message.getBytes());
              stream.flush();
          } catch (IOException ex) {
              Logger.getLogger(HelloWorldServlet.class.getName()).log(Level.SEVERE, null, ex);
          }
      }
  </code></pre>
  
  <p>And well mapped in the <code>web.xml</code> file:</p>
  
  <pre><code>&lt;servlet&gt;
          &lt;servlet-name&gt;hello&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.tarrsalah.jetty.example.HelloWorldServlet&lt;/servlet-class&gt;                
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;hello&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>But it seems that jetty can't fin my servlet class when running mvn jetty:run , what am I missing here ?</p>
  
  <pre><code>--- jetty-maven-plugin:9.1.3.v20140225:run (default-cli) @ jetty-example ---
  2014-04-02 10:09:46.126:INFO::main: Logging initialized @12796ms
  Configuring Jetty for project: jetty-example
  webAppSourceDirectory not set. Trying src/main/webapp
  Reload Mechanic: automatic
  Classes = /home/tarrsalah/src/misc/jetty-exampe/target/classes
  Context path = /
  Tmp directory = /home/tarrsalah/src/misc/jetty-exampe/target/tmp
  Web defaults = org/eclipse/jetty/webapp/webdefault.xml
  Web overrides =  none
  web.xml file = file:/home/tarrsalah/src/misc/jetty-exampe/src/main/webapp/WEB-INF/web.xml
  Webapp directory = /home/tarrsalah/src/misc/jetty-exampe/src/main/webapp
  2014-04-02 10:09:46.291:INFO:oejs.Server:main: jetty-9.1.3.v20140225
  2014-04-02 10:09:46.954:INFO:oeja.AnnotationConfiguration:main: Scanned 1 container path jars, 0 WEB-INF/lib jars, 1 WEB-INF/classes dirs in 82ms for context o.e.j.m.p.JettyWebAppContext@1f38957{/,file:/home/tarrsalah/src/misc/jetty-exampe/src/main/webapp/,STARTING}{file:/home/tarrsalah/src/misc/jetty-exampe/src/main/webapp/}
  2014-04-02 10:09:46.954:WARN:oejw.WebAppContext:main: Failed startup of context o.e.j.m.p.JettyWebAppContext@1f38957{/,file:/home/tarrsalah/src/misc/jetty-exampe/src/main/webapp/,STARTING}{file:/home/tarrsalah/src/misc/jetty-exampe/src/main/webapp/}
  java.lang.RuntimeException: Error scanning file HelloWorldServlet.class
      at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:705)
      at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
      at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
      at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
      at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
      at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:821)
      at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:159)
      at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:542)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
      at java.lang.Thread.run(Thread.java:744)
  Caused by: 
  java.lang.IllegalArgumentException
      at org.objectweb.asm.ClassReader.&lt;init&gt;(Unknown Source)
      at org.objectweb.asm.ClassReader.&lt;init&gt;(Unknown Source)
      at org.objectweb.asm.ClassReader.&lt;init&gt;(Unknown Source)
      at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:970)
      at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:700)
      at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
      at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
      at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
      at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
      at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:821)
      at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:159)
      at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:542)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
      at java.lang.Thread.run(Thread.java:744)
  2014-04-02 10:09:46.958:WARN:oejsh.RequestLogHandler:main: !RequestLog
  2014-04-02 10:09:47.108:INFO:oejs.ServerConnector:main: Started ServerConnector@506594a5{HTTP/1.1}{0.0.0.0:8080}
  2014-04-02 10:09:47.109:INFO:oejs.Server:main: Started @13779ms
  Started Jetty Server
  </code></pre>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
      &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;9.1.3.v20140225&lt;/version&gt;              
  &lt;/plugin&gt;
  </code></pre>
  
  <hr>
  
  <p><strong>Update:</strong></p>
  
  <p>Worked after changing the configuration of <code>maven-compiler-plugin</code>  from 1.8 to 1.7, What'is wrong with using <a href="/questions/tagged/java-8" class="post-tag" title="show questions tagged &#39;java-8&#39;" rel="tag">java-8</a> with <a href="/questions/tagged/jetty-9" class="post-tag" title="show questions tagged &#39;jetty-9&#39;" rel="tag">jetty-9</a> ?</p>