Jetty サーバーをセットアップする方法は次のとおりです。
Server server = new Server(80);
server.setStopAtShutdown(true);
ServletHandler servletHandler = new ServletHandler();
servletHandler.addServletWithMapping(Erreur500Servlet.class, "/generate-error-500");
servletHandler.addServletWithMapping(AresServlet.class, "/ares/*");
servletHandler.addFilterWithMapping(RequestLoggingFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
server.setHandler(servletHandler);
server.start(); // at com.company.MyPoc.init(MyPoc.java:44)
server.join();
ただし、起動すると、次の例外が発生しました。
2015-10-20 12:53:07,565 (?:?) [WARN] FAILED com.company.filter.RequestLoggingFilter-896472140: java.lang.NullPointerException
java.lang.NullPointerException: null
at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:100) ~[jetty-servlet-8.0.1.v20110908.jar:8.0.1.v20110908]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) [jetty-util-8.0.1.v20110908.jar:8.0.1.v20110908]
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:753) [jetty-servlet-8.0.1.v20110908.jar:8.0.1.v20110908]
at org.eclipse.jetty.servlet.ServletHandler.doStart(ServletHandler.java:183) [jetty-servlet-8.0.1.v20110908.jar:8.0.1.v20110908]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) [jetty-util-8.0.1.v20110908.jar:8.0.1.v20110908]
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:89) [jetty-server-8.0.1.v20110908.jar:8.0.1.v20110908]
at org.eclipse.jetty.server.Server.doStart(Server.java:262) [jetty-server-8.0.1.v20110908.jar:8.0.1.v20110908]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) [jetty-util-8.0.1.v20110908.jar:8.0.1.v20110908]
at com.company.MyPoc.init(MyPoc.java:44)
私は何が欠けていますか?
桟橋 8.0.1.v20110908