Kann javax.servlet.ServletException nicht instanziieren
Ich versuche eine Instanz der Klasse @ zu erstell javax.servlet.ServletException mit folgendem Code
public class MyTroubleViewer {
public static void main(String[] args) {
javax.servlet.ServletException servletException = new javax.servlet.ServletException("Hello");
System.out.println(servletException.getMessage());
}
}
Aber ich bekomme eine Ausnahme beim Erstellen:
Exception in thread "main" java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/ServletException
...
Maven hilft mir bei Abhängigkeiten:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
Was mache ich falsch