tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Isaacs" <>
Subject RE: JSP won't compile
Date Wed, 01 Sep 2004 17:13:38 GMT
Hi Chuck,

I believe your difficulty at this point is due to a second
"problem", which is that default error page only unwraps two
levels of exceptions.  Your real problem is at the third
level or below, and the two levels that are displayed leave
you clueless as to what the real problem is.  In this situation,
I find the following approach effective at finding the real

1) Modify web.xml to define an error page for java.lang.Throwable.
   For example:


2) Write a JSP for 1 above that includes:


   and scriptlet code that unwraps all levels of the Throwable
   found in the "exception" implicit object.  Some partial code
   for this might look like:

   Throwable t = exception;
   while (null != t)
      // log or output stuff about t

      // unwrap next level
      if (t instanceof JspException)
         t = ((JspException)t).getRootCause();
      else if (t instanceof ServletException)
         t = ((ServletException)t).getRootCause();
         t = t.getCause();

I can't promise there aren't typos in the above, so fix what's
needed if you cut&paste.  From the output of this error page, 
if you are lucky, you should see the real problem.  If yours is
a case of some code catching an exception and re-throwing
something less useful without setting the cause, then you may
not see what you need.



> -----Original Message-----
> From: news [] On Behalf Of Chuck Chopp
> Sent: Wednesday, September 01, 2004 12:31 PM
> To:
> Subject: Re: JSP won't compile
> Shapira, Yoav wrote:
> > This is why you should put your class in a package:
> >
> All of my form and action classes derive from abstract base 
> classes based on 
> ActionForm and Action.  All of my application specific 
> classes are packaged. 
>   I've verified this.
> The class in question is being automatically generated by 
> Tomcat when it 
> tries to compile a JSP.  AFAIK, there's nothing that I need 
> to do w/respect 
> to creating packages for JSPs and none of my JSPs are precompiled.
> When I deploy the exact same webapp to WinXP w/Tomcat v4.1.30 
> & JDK v1.4.2 
> and NetWare v6.5 w/Tomcat v4.1.28 & JDK v1.4.2, the WAR file 
> is unpacked OK 
> at Tomcat startup and all of the JSPs are compiled 
> successfully when the 
> webapp is accessed for the first time.  However, when I 
> deploy the WAR file 
> to OpenVMS Alpha v7.3-1 w/Tomcat v4.1.24 & JDK v1.4.2, the 
> "login.jsp" file 
> fails to be compiled into a Java class.  I can see that 
> "" 
> gets created, but there's no corresponding "login_jsp.class" 
> file and this 
> makes sense based on the error messages I'm seeing.  The 
> initial page to be 
> accessed in the webapp is the welcome page, which is named 
> "index.jsp" and 
> it is located in the webapp's "root" folder.  I can see that 
> "index.jsp" was 
>   used to generate "" and that was, in turn, 
> compiled into 
> "index_jsp.class" w/o any problems.
> I'm still at a loss to explain why this happens on just this 
> one Tomcat 
> implementation.
> -- 
> Chuck Chopp
> ChuckChopp (at) rtfmcsi (dot) com
> RTFM Consulting Services Inc.     864 801 2795 voice & voicemail
> 103 Autumn Hill Road              864 801 2774 fax
> Greer, SC  29651
> Do not send me unsolicited commercial email.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message