Greetings.

I am sending this email to the Dev list as opposed to the user list as I
feel that it is more Dev related than config etc (please feel free to
correct me if I am off bat here!).

I have posted to the User list about this problem before (Tomcat 50.1.9
issues) in case you would like some reference.

The problem I am encountering is as follows:

I have a farily large Custom Tag Library in use in a number of sites.  The
TLD for the tag library contains all 200 odd custom tag definitions, some of
which use TEI classes (which are obviously referenced in the <teiclass/>
tag.

At compile to of a JSP the TLD is parsed and the jasper attempts to
classload all TEI classes found in the TLD.  If it does not find a
referenced TEI class in the classpath the resulting Exception is bubbled all
the way up and is forwarded to the error page.  

Is this meant to happen?  I noticed in older versions of Tomcat (e.g.
4.1.29) that these exceptions ARE thrown, but are caught and reported by the
Engine component.  In Tomcat 5.0.19 it seems that they are just thrown.

An example of one of these Exceptions is:

=== SNIP ===

StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /logon.jsp(1,1) Failed to load or
instantiate TagExtraInfo class:
com.platform_basic.modules.virtualpage.VirtualPageTEI
        at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.
java:83)
        at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402
)
        at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:126
)
        at
org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:384)
        at
org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:417)
        at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:515)
        at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
        at org.apache.jasper.compiler.Parser.parse(Parser.java:171)
        at
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:25
8)
        at
org.apache.jasper.compiler.ParserController.parse(ParserController.java:139)
        at
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:237)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
        at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:5
53)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
91)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:284)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:204)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:257)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
        at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:245)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:199)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184
)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164
)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:149)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:156)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
        at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
        at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:339)
        at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:415)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:716)
        at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:650)
        at
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:829)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:688)
        at java.lang.Thread.run(Thread.java:534)

=== END SNIP ===

Additionally there is a similar problem whereby the Exception mentioned
above is thrown even if the TEI class the error is being reported on DOES
actually exist in the classpath!!  This is USUALLY on the first request to a
JSP in the site after a restart of Tomcat.  If you refresh, then the page
loads normally!  Is this due to the fact that the Tag Lib has so many custom
tags (over 200)?  It seems that the classloader is not available to Jasper
at the time it tries to compile (and therefore parse the TLD file) the JSP.
This is clearly a guess from my side.

I am also experiencing the following random Exception - in the same site(s)
using the same Custom Tag Library as above - whereby on a request to a JSP
page that has not been compiled after a restart that references custom tags
- SOMETIMES Jasper throws an exception reporting that a tag handler class
for one of the custom tags cannot be found!  I assure you that the class IS
in the site /WEB-INF/classes!  If I refresh the page - then it loads fine!
This happens on random pages/custom tags so I don't think it has to do with
any of the tags themselves!

An example of the exception being thrown:

StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /virtualpage/vpagemain.jsp(23,2) Unable
to load tag handler class "com.platform_basic.security.IfAccessTag" for tag
"pb:ifAccess"
        at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.
java:83)
        at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402
)
        at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:236
)
        at
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1356)
        at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1598)
        at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1827)
        at
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1100)
        at
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1405)
        at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1598)
        at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1827)
        at
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1100)
        at
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1405)
        at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1598)
        at org.apache.jasper.compiler.Parser.parse(Parser.java:171)
        at
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:25
8)
        at
org.apache.jasper.compiler.ParserController.parse(ParserController.java:139)
        at
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:237)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
        at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:5
53)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
91)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:284)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:204)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:257)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
        at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:245)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:199)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184
)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164
)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:149)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:156)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:151)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
        at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
        at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:339)
        at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:415)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:716)
        at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:650)
        at
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:829)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:688)
        at java.lang.Thread.run(Thread.java:534)

Does anyone here know why this would be happening?  It should be noted that
my environment is as follows:

OS:             Windows XP/2000 Server and Redhat Linux 9 (happening on
installations on all three)
JDK:            1.4.2_01
Tomcat: 5.0.19
Apache  2.0.46
Mod_jk          2.03

The sites ARE runnign through mod_jk2 via Apache - not sure if this is
causing the probem?

Any assistance/advise/help here would be greatly appreciated.

PS:     Yoav - I am still assembing a WAR that will demonstrate this
problem!

Best regards and thanks in advance,

Carl Olivier

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to