Note that there are some explanatory texts on larger screens.

plurals
  1. POUpdating jetty 7 to jetty 8 : java.lang.NoClassDefFoundError: javax/servlet/FilterRegistration
    text
    copied!<p>im trying to develop an web server by embedding jetty. So with jetty 7.3 everything worked fine. Yesterday I updated the jetty libaries to the newest version 8.0.3 and now I get an Exception by creating a ServletContextHandler.</p> <blockquote> <p>Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/FilterRegistration at org.eclipse.jetty.servlet.ServletContextHandler.(ServletContextHandler.java:126) at org.eclipse.jetty.servlet.ServletContextHandler.(ServletContextHandler.java:106) at org.eclipse.jetty.servlet.ServletContextHandler.(ServletContextHandler.java:94) at org.gemsjax.server.GemsJaxServer.main(GemsJaxServer.java:38)</p> </blockquote> <p>So what I do is:</p> <pre><code> public static void main(String[] args) { Server server = new Server(8080); ServletContextHandler servletContext = new ServletContextHandler(ServletContextHandler.SESSIONS); servletContext.setContextPath("/servlets"); servletContext.addServlet(new ServletHolder( new CollaborationWebSocketServlet()),"/collaboration"); // The ResourceHandler to handle static web content ResourceHandler resourceHandler = new ResourceHandler(); resourceHandler.setDirectoriesListed(true); resourceHandler.setWelcomeFiles(new String[]{ "index.html" }); resourceHandler.setResourceBase("./war/"); ContextHandler resourceContext = new ContextHandler(); resourceContext.setContextPath("/static"); resourceContext.setHandler(resourceHandler); HandlerCollection handlers = new HandlerCollection(); handlers.addHandler(resourceContext); handlers.addHandler(servletContext); server.setHandler(handlers); try { server.start(); server.join(); } catch (Exception e) { e.printStackTrace(); } } </code></pre> <p>So the line that throw the exception is:</p> <pre><code>ServletContextHandler servletContext = new ServletContextHandler(ServletContextHandler.SESSIONS); </code></pre> <p>Im using ubuntu 11.04 with:</p> <p>openjdk java version "1.6.0_22" OpenJDK Runtime Environment (IcedTea6 1.10.2) (6b22-1.10.2-0ubuntu1~11.04.1) OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)</p> <p>Does anyone have a suggestion?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload