title: Can't instantiate javax.servlet.ServletException
body: <p>I am trying to create instance of class <em>javax.servlet.ServletException</em> with following code</p>
  
  <pre><code>public class MyTroubleViewer {
   public static void main(String[] args) {
    javax.servlet.ServletException servletException = new javax.servlet.ServletException("Hello");
    System.out.println(servletException.getMessage());
   }
  }
  </code></pre>
  
  <p>But I get exception on creating:</p>
  
  <pre><code>Exception in thread "main" java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/ServletException
  ...
  </code></pre>
  
  <p>Maven helps me with dependecies:</p>
  
  <pre><code>&lt;dependency&gt;
   &lt;groupId&gt;javax&lt;/groupId&gt;
   &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
   &lt;version&gt;6.0&lt;/version&gt;
   &lt;type&gt;jar&lt;/type&gt;
   &lt;scope&gt;compile&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>What am I doing wrong?</p>