java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.isAsyncStarted()Z
jetty servlet java    2017-07-19 23:31:53    313   
lightingfire   jetty servlet java
错误原因:jetty 的版本和servlet—api版本不同,加载时的顺序不同,先加载servlet-api,而造成的错误。
解决方案:
1、如果是使用的是maven的话,在pom文件中,将jetty的jar包的依赖放在servlet-api的依赖前面
2、如果没有使用maven的话,可以在java build bath->order and export 将jetty的包上移                


完整报错日志:

2014-09-15 01:49:15.572:WARN:oejs.ServletHandler:qtp968838231-22: Error for /myapp/index.jsp
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getJspConfigDescriptor()Ljavax/servlet/descriptor/JspConfigDescriptor;
 at org.apache.jasper.compiler.JspConfig.processWebDotXml(JspConfig.java:106)
 at org.apache.jasper.compiler.JspConfig.init(JspConfig.java:196)
 at org.apache.jasper.compiler.JspConfig.findJspProperty(JspConfig.java:259)
 at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:166)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
 at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:625)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
 at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:738)
 at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:551)
 at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
 at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568)
 at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
 at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111)
 at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:478)
 at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
 at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1045)
 at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
 at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
 at org.eclipse.jetty.server.Server.handle(Server.java:462)
 at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:279)
 at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232)
 at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:534)
 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-09-15 01:49:15.574:WARN:oejut.QueuedThreadPool:qtp968838231-22:
java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.isAsyncStarted()Z
 at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:648)
 at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
 at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568)
 at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
 at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111)
 at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:478)
 at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
 at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1045)
 at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
 at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
 at org.eclipse.jetty.server.Server.handle(Server.java:462)
 at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:279)
 at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232)
 at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:534)
 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)
 
 

 

by 刘迎光@萤火虫工作室
OpenBI交流群:495266201
MicroService 微服务交流群:217722918
mail: liuyg#liuyingguang.cn
博主首页(防止爬虫):http://blog.liuyingguang.cn
OpenBI问答社区:http://openbi.liuyingguang.cn/

Pre: java web项目中集成Jetty作为web容器

Next: saiku2.x配置mondrian3.x中Schema中文乱码问题解决方案


Table of content