tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Heudecker <nheudec...@gmail.com>
Subject ClassCastException When Compiling JSP
Date Sun, 31 Jul 2005 05:29:10 GMT
Hi,

Tomcat is unable to compile any of the JSPs in my application (Struts
1.2.7, JDK 5, Tomcat 5.5.9) because of a ClassCastException when
loading up of the Struts TLDs.  I'm posting the problem here because
the application works fine using Resin.

There are two stack traces.  The one that actually presents the
problem is the second one listed. The HTTP 500 error message contains:

exception

org.apache.jasper.JasperException: Unable to load class for JSP
	org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:591)
	org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
	org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1001)
	org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:560)
	org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:209)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
	org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	com.systemmobile.sparrow.util.LoginFilter.doFilter(LoginFilter.java:55)
	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:172)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

root cause

java.lang.ClassNotFoundException: org.apache.jsp.login.index_jsp
	java.net.URLClassLoader$1.run(URLClassLoader.java:200)
	java.security.AccessController.doPrivileged(Native Method)
	java.net.URLClassLoader.findClass(URLClassLoader.java:188)
	org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:158)
	org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:71)
	org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:589)
	org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
	org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1001)
	org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:560)
	org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:209)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
	org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	com.systemmobile.sparrow.util.LoginFilter.doFilter(LoginFilter.java:55)
	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:172)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)


The reason the JSP isn't found is because a ClassCastException was
thrown during compile.  Here's the exception from the logs:

ERROR: 2005-07-30 23:52:50,067: StandardWrapperValve:
Servlet.service() for servlet default threw exception
java.lang.ClassCastException: org.apache.struts.taglib.html.MessagesTei
        at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:420)
        at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:248)
        at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:162)
        at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
        at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
        at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1543)
        at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
        at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
        at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
        at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
        at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)

As I said earlier, the WAR file works fine in Resin.  I've tried
putting the struts.jar into $CATALINA_HOME/common/lib and the problem
persists.  Any help would be very much appreciated.  Thanks for your
time.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message