struts - Failed to load or instantiate TagExtraInfo

由于工作刚接触STRUTS(以前一直用JSF)。今天在搭建环境的时候从同事那边拷过来的工程。用到我的环境中,访问工程页面的时候报异常。
我的环境:myeclipse 8.5 + tomcat 6.0
异常如下:

严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /index.jsp(2,0) Failed to load or instantiate TagExtraInfo class: org.apache.struts.taglib.bean.CookieTei
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
at org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:345)
at org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:378)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:486)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1444)
at org.apache.jasper.compiler.Parser.parse(Parser.java:138)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:154)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:315)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.ylsw.commons.web.EncodingFilter.doFilter(EncodingFilter.java:34)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.chinaums.xm.filter.SessionVerifyFilter.doFilter(SessionVerifyFilter.java:105)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

从网上搜资料,发现解决的办法很多,有的说删除工程web-inf/lib下的jsp-api.jar,servlet-api.jar;有的说拷贝struts中的所有jar文件到工程的
web-inf/lib目录下;有的说是Jar包冲突(个人觉得这种的可能性比较大)。
这些方法我都一一试过了,可是还是一样的报异常。头疼的我啊,那个难受啊。
最后实在没法子了。来了个损招,把tomcat6换成了tomcat5.结果居然生效可以了。可以正常访问了!
这里贴出来,只是给自己提个醒,具体的原因我还是不知道,留待后续在研究。
也给对遇到这种问题的同志们提供一个解决方法建议,如果删除JAR包和添加JAR包都解决不了的话。不妨试试这个。

你可能感兴趣的:(java,apache,tomcat,struts,servlet)