You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vjeran Marcinko <vj...@tis.hr> on 2004/04/23 09:13:48 UTC

Exception/Error page

Hi.

How can I override Tapestry's default exception page (line precise), with
something more friendly for end user (lets' say just 'Internal server error'
message), and just log exception trace to file ?
I was expecting some org.tapestry.error-page application-level property, but
cannot spot any... :-(

Regards,
Vjeran




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


Re: Exception/Error page (HELP!)

Posted by Vjeran Marcinko <vj...@tis.hr>.
Harish, thanx a bunch.

And if anyone would count one newbie wishes, I would suggest that this
procedure has to be included in user guide, and putting one chapter in next
release of TIA book would be my suggestion also. Logging this runtime
exceptions into file by deafult would also be good, because one more copy of
exception report (through commons-logging, beside those on screen) would do
no harm to anyone.

Thanx once again, you saved my day.

-Vjeran

----- Original Message ----- 
From: "Harish Krishnaswamy" <hk...@comcast.net>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Friday, April 23, 2004 6:03 PM
Subject: Re: Exception/Error page (HELP!)


> What class is your exception page pointing to? What you want to do is
> override the exception page which means drop in a page named
> exception.html and exception.page in WEB-INF and have your
> exception.page point to your exception class which should have a
> setException(Throwable t) method. Tapestry will call this method in the
> event of an exception. From within this method you can log your
> exception to where ever you want. Take a look at Tapestry's
> org.apache.tapestry.pages.Exception.java and
> org.apache.tapestry.util.exception.ExceptionAnalyzer.java
>
> -Harish


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


Re: Exception/Error page (HELP!)

Posted by Harish Krishnaswamy <hk...@comcast.net>.
What class is your exception page pointing to? What you want to do is 
override the exception page which means drop in a page named 
exception.html and exception.page in WEB-INF and have your 
exception.page point to your exception class which should have a 
setException(Throwable t) method. Tapestry will call this method in the 
event of an exception. From within this method you can log your 
exception to where ever you want. Take a look at Tapestry's 
org.apache.tapestry.pages.Exception.java and 
org.apache.tapestry.util.exception.ExceptionAnalyzer.java

-Harish


Vjeran Marcinko wrote:

>Aaaarrgh ... I'm little frustrated ... :-(
>
>Don't get me wrong, I am, although short timed, huge Tapestry fan, but
>specifying error page is wide-spread/well-known requirement in all web
>frameworks, which are far below this one, and somehow I cannot find how to
>do it properly in Tapestry. Not in user guide, not in TIA book.
>"Line-precise" exception page is nice feature for developing on my local
>computer, but when deployed, my scheme should look as always : "Internal
>Server Error" page (hiding internals from end users) and exception gets
>logged in file. I can see also some ExceptionDisplay component in library,
>but there are no examples how to use it.
>
>And now most serious thing, and I hope it's just me and my lack of knowledge
>about Tapestry - I can live with my client have to see Tapestry's exception
>page with all detals, but I was shocked when I noticed that same exception
>(presented on exception page) *isn't propagated* to Log4j loggers (file
>appender) ? Plase tell me that I had put something wrong, because I dunno
>how will I take a look at some problem when my client calls me and tells me
>that something has crashed yesterday night, and I cannot see anything in
>file logs ? I certainly cannot tell them to reproduce the error and
>copy-paste exception page ...
>
>And considering changing exception page ... I found some docs about it only
>in some outdated tutorial (Google search), and I'm confused why this chapter
>doesn't still exist somewhere :
>http://tapestry-tutorial.cloudnine.net.nz/pages-example.html
>Basicaly, it suggest same thing as you have written below, but unfortunately
>somehow it doesn't work also :
>
>Unable to present exception page.
>Session id: 0BE415D553F38857B4641C68B3A55A04
>Client address: 127.0.0.1
>Exceptions:
>org.apache.tapestry.ApplicationRuntimeException: Unable to update expression
>'<parsed expression>' of
>org.apache.tapestry.html.BasePage@15d616e[Exception] to
>org.apache.tapestry.ApplicationRuntimeException: Unable to invoke method
>nodeSelected on
>org.apache.tapestry.contrib.tree.components.TreeNodeView$Enhance_0@32bd65[Ho
>me/$Border.treeNodeView]: kjhkjhkj.
>ognl.NoSuchPropertyException: exception
>   target: org.apache.tapestry.html.BasePage@15d616e[Exception]
>ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:133)
>
>Please HELP me ASAP. I cannot deploy my application withut exception
>logging...
>
>-Vjeran
>
>----- Original Message ----- 
>From: "Harish Krishnaswamy" <hk...@comcast.net>
>To: "Tapestry users" <ta...@jakarta.apache.org>
>Sent: Friday, April 23, 2004 2:11 PM
>Subject: Re: Exception/Error page
>
>
>  
>
>>Simply drop in your exception.html and exception.page in WEB-INF.
>>
>>-Harish
>>
>>Vjeran Marcinko wrote:
>>
>>    
>>
>>>Hi.
>>>
>>>How can I override Tapestry's default exception page (line precise), with
>>>something more friendly for end user (lets' say just 'Internal server
>>>      
>>>
>error'
>  
>
>>>message), and just log exception trace to file ?
>>>I was expecting some org.tapestry.error-page application-level property,
>>>      
>>>
>but
>  
>
>>>cannot spot any... :-(
>>>
>>>Regards,
>>>Vjeran
>>>      
>>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>

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


Re: Exception/Error page (HELP!)

Posted by Vjeran Marcinko <vj...@tis.hr>.
Aaaarrgh ... I'm little frustrated ... :-(

Don't get me wrong, I am, although short timed, huge Tapestry fan, but
specifying error page is wide-spread/well-known requirement in all web
frameworks, which are far below this one, and somehow I cannot find how to
do it properly in Tapestry. Not in user guide, not in TIA book.
"Line-precise" exception page is nice feature for developing on my local
computer, but when deployed, my scheme should look as always : "Internal
Server Error" page (hiding internals from end users) and exception gets
logged in file. I can see also some ExceptionDisplay component in library,
but there are no examples how to use it.

And now most serious thing, and I hope it's just me and my lack of knowledge
about Tapestry - I can live with my client have to see Tapestry's exception
page with all detals, but I was shocked when I noticed that same exception
(presented on exception page) *isn't propagated* to Log4j loggers (file
appender) ? Plase tell me that I had put something wrong, because I dunno
how will I take a look at some problem when my client calls me and tells me
that something has crashed yesterday night, and I cannot see anything in
file logs ? I certainly cannot tell them to reproduce the error and
copy-paste exception page ...

And considering changing exception page ... I found some docs about it only
in some outdated tutorial (Google search), and I'm confused why this chapter
doesn't still exist somewhere :
http://tapestry-tutorial.cloudnine.net.nz/pages-example.html
Basicaly, it suggest same thing as you have written below, but unfortunately
somehow it doesn't work also :

Unable to present exception page.
Session id: 0BE415D553F38857B4641C68B3A55A04
Client address: 127.0.0.1
Exceptions:
org.apache.tapestry.ApplicationRuntimeException: Unable to update expression
'<parsed expression>' of
org.apache.tapestry.html.BasePage@15d616e[Exception] to
org.apache.tapestry.ApplicationRuntimeException: Unable to invoke method
nodeSelected on
org.apache.tapestry.contrib.tree.components.TreeNodeView$Enhance_0@32bd65[Ho
me/$Border.treeNodeView]: kjhkjhkj.
ognl.NoSuchPropertyException: exception
   target: org.apache.tapestry.html.BasePage@15d616e[Exception]
ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:133)

Please HELP me ASAP. I cannot deploy my application withut exception
logging...

-Vjeran

----- Original Message ----- 
From: "Harish Krishnaswamy" <hk...@comcast.net>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Friday, April 23, 2004 2:11 PM
Subject: Re: Exception/Error page


> Simply drop in your exception.html and exception.page in WEB-INF.
>
> -Harish
>
> Vjeran Marcinko wrote:
>
> >Hi.
> >
> >How can I override Tapestry's default exception page (line precise), with
> >something more friendly for end user (lets' say just 'Internal server
error'
> >message), and just log exception trace to file ?
> >I was expecting some org.tapestry.error-page application-level property,
but
> >cannot spot any... :-(
> >
> >Regards,
> >Vjeran


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


Re: Exception/Error page

Posted by Harish Krishnaswamy <hk...@comcast.net>.
Simply drop in your exception.html and exception.page in WEB-INF.

-Harish

Vjeran Marcinko wrote:

>Hi.
>
>How can I override Tapestry's default exception page (line precise), with
>something more friendly for end user (lets' say just 'Internal server error'
>message), and just log exception trace to file ?
>I was expecting some org.tapestry.error-page application-level property, but
>cannot spot any... :-(
>
>Regards,
>Vjeran
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>

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