边城愚人

如果我不在边城,我一定是在前往边城的路上。

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  31 随笔 :: 0 文章 :: 96 评论 :: 0 Trackbacks
	最近在学Acegi,就试着运行一个小例子,不成想抛出下面的异常
org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 23 in the generated java file The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory Stacktrace: org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423) org.apache.jasper.compiler.Compiler.compile(Compiler.java:308) org.apache.jasper.compiler.Compiler.compile(Compiler.java:286) org.apache.jasper.compiler.Compiler.compile(Compiler.java:273) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 上网搜,发现不少人有这个问题,但都没有解决办法。后来想到可能和tomcat6有关,因为我在工程的lib中添加了很多包(一堆什么Spring
依赖),所以把他们一删JSP就不抛异常了。我估计是,工程中和tomcat6 lib中重复的包在加载时是先被加载(也就是tomcat6中相同的包没
有被加载),而工程中的包版本要比tomcat6中的低,造成上面的异常。我对照着tomcat中包,发现工程中出现诸如catalina.jar、jsp-api.jar
、servlet-api.jar等这样的重复包,把它们从工程中删了就应该行了(对于上面的异常,原因应该是包jsp-api.jar)。看来不是什么包都可
以一股脑往工程里加阿。


posted on 2007-08-21 21:55 kafka0102 阅读(24541) 评论(15)  编辑  收藏 所属分类: Other

评论

# re: The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的异常的原因及解决办法 2007-09-26 00:08 oh
我lib下面没有你说的catalina等三个jar,还是不行,可能还会有什么其他jar?  回复  更多评论
  

# re: The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的异常的原因及解决办法 2007-10-12 07:22 korea boy
I think that you must be deleted servlet.jar in "C:\Program Files\Java\jdk1.6.0_01\jre\lib\ext"  回复  更多评论
  

# re: The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的异常的原因及解决办法 2007-10-12 07:23 korea boy
Ah.... Sorry;;; NO must be;;; YES shoud be
really sorry;;;;  回复  更多评论
  

# re: The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的异常的原因及解决办法 2008-01-21 15:27 乐拓宇
xml_apis.lib包是否出现版本重复也会出现  回复  更多评论
  

# re: The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的异常的原因及解决办法 2008-06-21 03:22 joey@jsense.nl
恢复上次提交

groetjes joey  回复  更多评论
  

# re: The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的异常的原因及解决办法 2008-12-31 10:58 guess
thanks  回复  更多评论
  

# re: The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的异常的原因及解决办法 2009-03-19 14:02 古老古朴
谢谢!  回复  更多评论
  

# re: The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的异常的原因及解决办法 2009-04-27 17:01 初学者
肯定是重复加载lib的问题,或者加载多余的lib的问题。
  回复  更多评论
  

# re: The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的异常的原因及解决办法 2009-05-08 09:20 chenzhd
不要误人子弟!!!  回复  更多评论
  

# re: The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的异常的原因及解决办法 2009-06-13 16:13 fangke
确实是多了两个包,javax.servlet.jar 、javax.servlet.jsp,我用得是jboss,包冲突得问题。谢谢。
  回复  更多评论
  

# re: The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的异常的原因及解决办法 2009-07-14 14:45
我的解决了,我的问题是在Tomcat5.5下面发布正常,但是在Tomcat6.0下面就报这个错误了。
不过这个错误肯定 是编译Jsp的那个包有冲突。找了半天我工程下面也没找到jsp-api.jar,不过多了一个javax.servlet.jsp.jar删掉这个包就行了。  回复  更多评论
  

# re: The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的异常的原因及解决办法 2010-10-20 09:30 熙男
@进
正确的  回复  更多评论
  

# re: The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的异常的原因及解决办法 2011-12-03 02:47 ss
可是删了项目就有错了...还是运行不了  回复  更多评论
  

# re: The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的异常的原因及解决办法 2015-10-13 18:38 青青子衿
必须给个赞 解决了很大的问题  回复  更多评论
  

# re: The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的异常的原因及解决办法 2016-04-04 16:29 lw
赞一个,解决问题了  回复  更多评论
  


只有注册用户登录后才能发表评论。


网站导航: