You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Raphael Di Cicco <rc...@alphacent.com> on 2002/04/09 17:10:08 UTC

Handle exceptions correctly

Hi,

I used to handle exceptions quite weel within my JSP pages. This is what I 
chose to do :
	- always throw Exceptions inside my Java methods and don't catch them inside.
	- don't do a try{} catch{} statement within my JSP pages.
	- but include an error page so that errors get redirected there.

It used to work quite well but now whenever I get a small exception somewhere 
in the code all I have is a message saying :



org.apache.jasper.JasperException: Unable to compile class for JSP        } 
catch (Throwable t) {
          ^
}
^
}
 ^
3 errors

        at ....

The problem is that I don't know what I have changed in my code, not much. Do 
you know what type of problems that can occur with this ?

Thanks for your help

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Handle exceptions correctly

Posted by Raphael Di Cicco <rc...@alphacent.com>.
I found that there was an error IN my error page that's why I had all this 
trouble !



On Tuesday 09 April 2002 17:54, Raphael Di Cicco wrote:
> I know but the exception is pointing to
> if (pageContext != null) pageContext.handlePageException(t);
>
> That's not very useful to find out what happened. And I can tell you these
> are exceptions I'm almost sure.
>
> On Tuesday 09 April 2002 17:49, Jeff Larsen wrote:
> > The error message looks more like your page just has some
> > mismatched brackets and not a problem with exceptions.
> >
> > If you have a hard time finding it in your source jsp. Look
> > at $TOMCAT_HOME/work/host/context/yourfile$jsp.java.
> > This is the compilable java source for your jsp.
> >
> > Jeff
> >
> >
> > ----- Original Message -----
> > From: "Raphael Di Cicco" <rc...@alphacent.com>
> > To: <to...@jakarta.apache.org>
> > Sent: Tuesday, April 09, 2002 10:10 AM
> > Subject: Handle exceptions correctly
> >
> > > Hi,
> > >
> > > I used to handle exceptions quite weel within my JSP pages. This is
> > > what I chose to do :
> > > - always throw Exceptions inside my Java methods and don't catch them
> > > inside. - don't do a try{} catch{} statement within my JSP pages.
> > > - but include an error page so that errors get redirected there.
> > >
> > > It used to work quite well but now whenever I get a small exception
> > > somewhere in the code all I have is a message saying :
> > >
> > >
> > >
> > > org.apache.jasper.JasperException: Unable to compile class for JSP
> > > } catch (Throwable t) {
> > >           ^
> > > }
> > > ^
> > > }
> > >  ^
> > > 3 errors
> > >
> > >         at ....
> > >
> > > The problem is that I don't know what I have changed in my code, not
> > > much. Do you know what type of problems that can occur with this ?
> > >
> > > Thanks for your help
> > >
> > > --
> > > To unsubscribe:   <ma...@jakarta.apache.org>
> > > For additional commands: <ma...@jakarta.apache.org>
> > > Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Handle exceptions correctly

Posted by Raphael Di Cicco <rc...@alphacent.com>.
I know but the exception is pointing to 
if (pageContext != null) pageContext.handlePageException(t);

That's not very useful to find out what happened. And I can tell you these are 
exceptions I'm almost sure.


On Tuesday 09 April 2002 17:49, Jeff Larsen wrote:
> The error message looks more like your page just has some
> mismatched brackets and not a problem with exceptions.
>
> If you have a hard time finding it in your source jsp. Look
> at $TOMCAT_HOME/work/host/context/yourfile$jsp.java.
> This is the compilable java source for your jsp.
>
> Jeff
>
>
> ----- Original Message -----
> From: "Raphael Di Cicco" <rc...@alphacent.com>
> To: <to...@jakarta.apache.org>
> Sent: Tuesday, April 09, 2002 10:10 AM
> Subject: Handle exceptions correctly
>
> > Hi,
> >
> > I used to handle exceptions quite weel within my JSP pages. This is what
> > I chose to do :
> > - always throw Exceptions inside my Java methods and don't catch them
> > inside. - don't do a try{} catch{} statement within my JSP pages.
> > - but include an error page so that errors get redirected there.
> >
> > It used to work quite well but now whenever I get a small exception
> > somewhere in the code all I have is a message saying :
> >
> >
> >
> > org.apache.jasper.JasperException: Unable to compile class for JSP       
> > } catch (Throwable t) {
> >           ^
> > }
> > ^
> > }
> >  ^
> > 3 errors
> >
> >         at ....
> >
> > The problem is that I don't know what I have changed in my code, not
> > much. Do you know what type of problems that can occur with this ?
> >
> > Thanks for your help
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Handle exceptions correctly

Posted by Jeff Larsen <la...@qec.com>.
The error message looks more like your page just has some 
mismatched brackets and not a problem with exceptions.

If you have a hard time finding it in your source jsp. Look
at $TOMCAT_HOME/work/host/context/yourfile$jsp.java.
This is the compilable java source for your jsp.

Jeff


----- Original Message ----- 
From: "Raphael Di Cicco" <rc...@alphacent.com>
To: <to...@jakarta.apache.org>
Sent: Tuesday, April 09, 2002 10:10 AM
Subject: Handle exceptions correctly


> Hi,
> 
> I used to handle exceptions quite weel within my JSP pages. This is what I 
> chose to do :
> - always throw Exceptions inside my Java methods and don't catch them inside.
> - don't do a try{} catch{} statement within my JSP pages.
> - but include an error page so that errors get redirected there.
> 
> It used to work quite well but now whenever I get a small exception somewhere 
> in the code all I have is a message saying :
> 
> 
> 
> org.apache.jasper.JasperException: Unable to compile class for JSP        } 
> catch (Throwable t) {
>           ^
> }
> ^
> }
>  ^
> 3 errors
> 
>         at ....
> 
> The problem is that I don't know what I have changed in my code, not much. Do 
> you know what type of problems that can occur with this ?
> 
> Thanks for your help
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>