求“Unable to compile class for JSP”解决办法

linjiangque 2011-07-19 11:07:50
用localhost打开网页时,出现如下错误。
index.jsp中的27行是一个<html>标签。。。。
————————————————————————————
严重: Servlet.service() for servlet debugjsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 27 in the generated java file
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
...全文
302 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
zn85600301 2011-07-19
  • 打赏
  • 举报
回复
linjiangque 2011-07-19
  • 打赏
  • 举报
回复
我把两个删完后,错误变成这样o(╯□╰)o
——————————————————————————————————————
description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:156)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

linjiangque 2011-07-19
  • 打赏
  • 举报
回复
这里面是有两个文件,该删哪一个?
linjiangque 2011-07-19
  • 打赏
  • 举报
回复
jsp代码很长的,而且在同一个myeclipse里面,其他项目的index.jsp可以运行,只有一个不可以。。。
老张-AI 2011-07-19
  • 打赏
  • 举报
回复
把你的jsp代码贴出来看看。

初步估计是因为jar包冲突,你看下你项目里面的jar包和tomcat里面的jar包是不是冲突了?

特别是如下两个包:
jsp-api.jar
servlet-api.jar
linjiangque 2011-07-19
  • 打赏
  • 举报
回复
经过一系列的Tomcat重新导入,删除了同名文件,JSP文件终于在页面上运行了,感谢各位!
linjiangque 2011-07-19
  • 打赏
  • 举报
回复
你是指TomCat 里的文件若重名的话可以都删了吗?
[Quote=引用 5 楼 zn85600301 的回复:]
http://www.cnblogs.com/panjun-Donet/archive/2010/05/20/1740110.html把tomcat下重复的jar删掉
[/Quote]

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧