jfinal 报异常:java.lang.NoSuchMethodError: javax.servlet.ServletContext.getJspConfigDescriptor

佰亿互联 发布于 2013/01/31 17:10
阅读 17K+
收藏 1

jfinal 是1.2版的,访问时出现下面异常:

HTTP ERROR 500

Problem accessing /admin/site. Reason:

javax.servlet.ServletContext.getJspConfigDescriptor()Ljavax/servlet/descriptor/JspConfigDescriptor;

Caused by:

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:374)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:578)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
	at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:276)
	at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:103)
	at com.jfinal.render.JspRender.render(JspRender.java:56)
	at com.jfinal.core.ActionHandler.handle(ActionHandler.java:94)
	at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
	at org.eclipse.jetty.server.Server.handle(Server.java:365)
	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)
	at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926)
	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
	at java.lang.Thread.run(Thread.java:619)
Powered by Jetty://

不知道如何解决?

加载中
0
佰亿互联
佰亿互联
问题解决了,是我的myeclipse 6自带的servlet版本低了,需要将那个移出,在tomcat 中找到jsp-api.jar和servlet-api.jar,加到项目lib中就行了。
佰亿互联
佰亿互联
jetty
JFinal
JFinal
开发时用的 tomcat 还是 JFinal 集成的 jetty ?
1
菜鸟级技术主管
我和楼主的情况一样,用楼上哥的“把JAVA EE 5 Libraries库删除”方法解决了,谢谢!
0
戴威
戴威
你配置了JfinalConfig么?
0
佰亿互联
佰亿互联

配置了!

public void configConstant(Constants me) {
  // 加载少量必要配置,随后可用getProperty(...)获取值
  loadPropertyFile("tbynet.properties");
  me.setDevMode(getPropertyToBoolean("devMode", false));
  me.setViewType(ViewType.JSP);
  }

0
佰亿互联
佰亿互联

@JFinal在不在呀?

0
JFinal
JFinal
jetty-server-6.1.26.jar 换成  jetty-server-8.1.8.jar 了没有,这里有下载: http://code.google.com/p/jfinal/downloads/list
咖啡男孩
jfinal3.0配合jetty-server-8.1.8.jar,视图使用jsp,也会有这个问题。
0
佰亿互联
佰亿互联
是的,我是用demo改的,jsp版的demo也运行不起来,freemarker倒是可以。
0
佰亿互联
佰亿互联
有人碰到这样的问题吗?是什么原因呢?
0
kxf327
kxf327
该评论暂时无法显示,详情咨询 QQ 群:912889742
佰亿互联
佰亿互联
需要先将myeclipse里自带的servlet包移除(这步很重要的,不然只加后面的不管用的),然后再加上tomcat中的两个jar包
0
ohaozy
ohaozy
使用Jfinal1.2后会报该这个错误,如果使用myeclipse,把JAVA EE 5 Libraries库删除,即可解决问题,此问题请波波查证一下,是否为新版本jettry带了导致冲突的JAR包。
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部