You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jonathan Rosenberg <jr...@tabbysplace.org> on 2012/01/27 19:00:15 UTC

Catching Exception "in Application"

Vital stats:

Apache Tomcat/7.0.22 	1.6.0_20-b20 	Sun Microsystems Inc. 	Linux
	2.6.34.7-56.40.amzn1.i686

I have a CAS server deployed on this instance.

I am trying to catch errors within the server (e.g., DB down) so I can
display friendly page to user & log error.

In the web.xml for the CAS server I have (I added error-page for
java.lang.Exception, ohters were already there)

<error-page>
		<exception-type>org.springframework.context.ApplicationContextException</exception-type>
		<location>/WEB-INF/view/jsp/brokenContext.jsp</location>
	</error-page>

	<error-page>
		<exception-type>java.lang.Exception</exception-type>
		<location>/WEB-INF/view/jsp/exception.jsp</location>
	</error-page>

	<error-page>
        <error-code>500</error-code>
		<location>/WEB-INF/view/jsp/errors.jsp</location>
	</error-page>

	<error-page>
		<error-code>404</error-code>
		<location>/</location>
	</error-page>

    <error-page>
        <error-code>403</error-code>
        <location>/403.html</location>
    </error-page>

Bu when I trigger an error (i.e., stop DB) I am seeing the default
Tomcat error page:

HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented
it from fulfilling this request.
exception
org.springframework.webflow.execution.ActionExecutionException:
Exception thrown executing [AnnotatedAction@17b2b99 targetAction =
[EvaluateAction@16b653d expression =
authenticationViaFormAction.submit(flowRequestContext,
flowScope.credentials, messageContext), resultExpression = [null]],
attributes = map[[empty]]] in state 'realSubmit' of flow 'login' --
action execution attributes were 'map[[empty]]'
. . .

I'm a newbie to Tomcat & am not sure where to start looking.

--
Jonathan Rosenberg
Founder & Executive Director
Tabby's Place, a Cat Sanctuary
http://www.tabbysplace.org/

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


Re: Catching Exception "in Application"

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jonathan,

On 1/28/12 9:49 AM, Jonathan Rosenberg wrote:
> Thanks to all for your ideas.  The problem turned out to be an
> error in my JSP file.

That was going to be my guess.

> I guess this was causing the original exception to be propagated
> to Tomcat?

Yes.

Make sure your error pages have isErrorPage="true" in your error JSPs,
otherwise bad things can happen. :)

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8oUEIACgkQ9CaO5/Lv0PDJxgCeLW0SoFXFb/bCf0XJ+XcZCunt
KxUAni7NEoFd24P39Rhkkk0/mkzqGSbO
=iyUV
-----END PGP SIGNATURE-----

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


Re: Catching Exception "in Application"

Posted by Jonathan Rosenberg <jr...@tabbysplace.org>.
On Fri, Jan 27, 2012 at 6:46 PM, Terence M. Bandoian <te...@tmbsw.com> wrote:
>  On 1:59 PM, Pid wrote:
>>
>> On 27/01/2012 18:53, Jonathan Rosenberg wrote:
>>>
>>> On Fri, Jan 27, 2012 at 1:45 PM, Pid<pi...@pidster.com>  wrote:
>>>>
>>>> On 27/01/2012 18:38, Jonathan Rosenberg wrote:
>>>>>
>>>>> That is in the original CAS server web.xml.  I left it untouched.
>>>>
>>>> For the rest of the day, as an experiment I will bottom-post to any
>>>> thread containing a reply via top-post.
>>>>
>>>>
>>>>> On Fri, Jan 27, 2012 at 1:35 PM, Pid<pi...@pidster.com>  wrote:
>>>>>>
>>>>>> On 27/01/2012 18:00, Jonathan Rosenberg wrote:
>>>>>>>
>>>>>>> Vital stats:
>>>>>>>
>>>>>>> Apache Tomcat/7.0.22  1.6.0_20-b20    Sun Microsystems Inc.   Linux
>>>>>>>       2.6.34.7-56.40.amzn1.i686
>>>>>>>
>>>>>>> I have a CAS server deployed on this instance.
>>>>>>>
>>>>>>> I am trying to catch errors within the server (e.g., DB down) so I
>>>>>>> can
>>>>>>> display friendly page to user&  log error.
>>>>>>>
>>>>>>>
>>>>>>> In the web.xml for the CAS server I have (I added error-page for
>>>>>>> java.lang.Exception, ohters were already there)
>>>>>>>
>>>>>>> <error-page>
>>>>>>>
>>>>>>> <exception-type>org.springframework.context.ApplicationContextException</exception-type>
>>>>>>>
>>>>>>> <location>/WEB-INF/view/jsp/brokenContext.jsp</location>
>>>>>>>       </error-page>
>>>>>>>
>>>>>>>       <error-page>
>>>>>>>               <exception-type>java.lang.Exception</exception-type>
>>>>>>>               <location>/WEB-INF/view/jsp/exception.jsp</location>
>>>>>>>       </error-page>
>>>>>>>
>>>>>>>       <error-page>
>>>>>>>         <error-code>500</error-code>
>>>>>>>               <location>/WEB-INF/view/jsp/errors.jsp</location>
>>>>>>>       </error-page>
>>>>>>>
>>>>>>>       <error-page>
>>>>>>>               <error-code>404</error-code>
>>>>>>>               <location>/</location>
>>>>>>>       </error-page>
>>>>>>
>>>>>> Is the above correct?  A 404 returns '/'?
>>>>>>
>>>>>>
>>>>>> p
>>>>>>
>>>>>>>     <error-page>
>>>>>>>         <error-code>403</error-code>
>>>>>>>         <location>/403.html</location>
>>>>>>>     </error-page>
>>>>>>>
>>>>>>> Bu when I trigger an error (i.e., stop DB) I am seeing the default
>>>>>>> Tomcat error page:
>>>>>>>
>>>>>>> HTTP Status 500 -
>>>>>>> type Exception report
>>>>>>> message
>>>>>>> description The server encountered an internal error () that
>>>>>>> prevented
>>>>>>> it from fulfilling this request.
>>>>>>> exception
>>>>>>> org.springframework.webflow.execution.ActionExecutionException:
>>>>>>> Exception thrown executing [AnnotatedAction@17b2b99 targetAction =
>>>>>>> [EvaluateAction@16b653d expression =
>>>>>>> authenticationViaFormAction.submit(flowRequestContext,
>>>>>>> flowScope.credentials, messageContext), resultExpression = [null]],
>>>>>>> attributes = map[[empty]]] in state 'realSubmit' of flow 'login' --
>>>>>>> action execution attributes were 'map[[empty]]'
>>>>>>> . . .
>>>>>>>
>>>>>>> I'm a newbie to Tomcat&  am not sure where to start looking.
>>>>>>>
>>>>>>> --
>>>>>>> Jonathan Rosenberg
>>>>>>> Founder&  Executive Director
>>>>>>>
>>>>>>> Tabby's Place, a Cat Sanctuary
>>>>>>> http://www.tabbysplace.org/
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> [key:62590808]
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>> Did you post the whole error page definition block?
>>>> What was the original contents and what have you added?
>>>
>>> Original error-page elements:
>>>
>>>        <error-page>
>>>
>>>  <exception-type>org.springframework.context.ApplicationContextException</exception-type>
>>>                <location>/WEB-INF/view/jsp/brokenContext.jsp</location>
>>>        </error-page>
>>>
>>>        <error-page>
>>>                <exception-type>java.lang.Exception</exception-type>
>>>                <location>/WEB-INF/view/jsp/exception.jsp</location>
>>>        </error-page>
>>>
>>>        <error-page>
>>>         <error-code>500</error-code>
>>>                <location>/WEB-INF/view/jsp/errors.jsp</location>
>>>        </error-page>
>>>
>>>        <error-page>
>>>                <error-code>404</error-code>
>>>                <location>/</location>
>>>        </error-page>
>>>
>>>     <error-page>
>>>         <error-code>403</error-code>
>>>         <location>/403.html</location>
>>>     </error-page>
>>>
>>> I added this
>>>
>>>        <error-page>
>>>                <exception-type>java.lang.Exception</exception-type>
>>>                <location>/WEB-INF/view/jsp/exception.jsp</location>
>>>        </error-page>
>>
>> OK, what error page do you get if you cause the error without this entry?
>>
>>
>> p
>>
>>> --
>>> Jonathan Rosenberg
>>> Founder&  Executive Director
>>>
>>> Tabby's Place, a Cat Sanctuary
>>> http://www.tabbysplace.org/
>
>
> Hi, Jonathan-
>
> From the Java Servlet Specification:
>
> The location element "contains the location of the resource in the web
> application relative to the root of the web application. The value of the
> location must have a leading ‘/’."
>
> I specify locations as I would access them from the web. For example, and
> depending on how your JSPs are mapped, I would use:
>
> <location>/exception.jsp</location>
>
> as the location sub-element for the java.lang.Exception error page. The
> leading /WEB-INF/view/jsp might be getting in the way.
>
> -Terence Bandoian
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

Thanks to all for your ideas.  The problem turned out to be an error
in my JSP file.  I guess this was causing the original exception to be
propagated to Tomcat?

--
Jonathan Rosenberg
Founder & Executive Director
Tabby's Place, a Cat Sanctuary
http://www.tabbysplace.org/

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


Re: Catching Exception "in Application"

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
  On 1:59 PM, Pid wrote:
> On 27/01/2012 18:53, Jonathan Rosenberg wrote:
>> On Fri, Jan 27, 2012 at 1:45 PM, Pid<pi...@pidster.com>  wrote:
>>> On 27/01/2012 18:38, Jonathan Rosenberg wrote:
>>>> That is in the original CAS server web.xml.  I left it untouched.
>>> For the rest of the day, as an experiment I will bottom-post to any
>>> thread containing a reply via top-post.
>>>
>>>
>>>> On Fri, Jan 27, 2012 at 1:35 PM, Pid<pi...@pidster.com>  wrote:
>>>>> On 27/01/2012 18:00, Jonathan Rosenberg wrote:
>>>>>> Vital stats:
>>>>>>
>>>>>> Apache Tomcat/7.0.22  1.6.0_20-b20    Sun Microsystems Inc.   Linux
>>>>>>        2.6.34.7-56.40.amzn1.i686
>>>>>>
>>>>>> I have a CAS server deployed on this instance.
>>>>>>
>>>>>> I am trying to catch errors within the server (e.g., DB down) so I can
>>>>>> display friendly page to user&  log error.
>>>>>>
>>>>>> In the web.xml for the CAS server I have (I added error-page for
>>>>>> java.lang.Exception, ohters were already there)
>>>>>>
>>>>>> <error-page>
>>>>>>                <exception-type>org.springframework.context.ApplicationContextException</exception-type>
>>>>>>                <location>/WEB-INF/view/jsp/brokenContext.jsp</location>
>>>>>>        </error-page>
>>>>>>
>>>>>>        <error-page>
>>>>>>                <exception-type>java.lang.Exception</exception-type>
>>>>>>                <location>/WEB-INF/view/jsp/exception.jsp</location>
>>>>>>        </error-page>
>>>>>>
>>>>>>        <error-page>
>>>>>>          <error-code>500</error-code>
>>>>>>                <location>/WEB-INF/view/jsp/errors.jsp</location>
>>>>>>        </error-page>
>>>>>>
>>>>>>        <error-page>
>>>>>>                <error-code>404</error-code>
>>>>>>                <location>/</location>
>>>>>>        </error-page>
>>>>> Is the above correct?  A 404 returns '/'?
>>>>>
>>>>>
>>>>> p
>>>>>
>>>>>>      <error-page>
>>>>>>          <error-code>403</error-code>
>>>>>>          <location>/403.html</location>
>>>>>>      </error-page>
>>>>>>
>>>>>> Bu when I trigger an error (i.e., stop DB) I am seeing the default
>>>>>> Tomcat error page:
>>>>>>
>>>>>> HTTP Status 500 -
>>>>>> type Exception report
>>>>>> message
>>>>>> description The server encountered an internal error () that prevented
>>>>>> it from fulfilling this request.
>>>>>> exception
>>>>>> org.springframework.webflow.execution.ActionExecutionException:
>>>>>> Exception thrown executing [AnnotatedAction@17b2b99 targetAction =
>>>>>> [EvaluateAction@16b653d expression =
>>>>>> authenticationViaFormAction.submit(flowRequestContext,
>>>>>> flowScope.credentials, messageContext), resultExpression = [null]],
>>>>>> attributes = map[[empty]]] in state 'realSubmit' of flow 'login' --
>>>>>> action execution attributes were 'map[[empty]]'
>>>>>> . . .
>>>>>>
>>>>>> I'm a newbie to Tomcat&  am not sure where to start looking.
>>>>>>
>>>>>> --
>>>>>> Jonathan Rosenberg
>>>>>> Founder&  Executive Director
>>>>>> Tabby's Place, a Cat Sanctuary
>>>>>> http://www.tabbysplace.org/
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> [key:62590808]
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>> Did you post the whole error page definition block?
>>> What was the original contents and what have you added?
>> Original error-page elements:
>>
>> 	<error-page>
>> 		<exception-type>org.springframework.context.ApplicationContextException</exception-type>
>> 		<location>/WEB-INF/view/jsp/brokenContext.jsp</location>
>> 	</error-page>
>>
>> 	<error-page>
>> 		<exception-type>java.lang.Exception</exception-type>
>> 		<location>/WEB-INF/view/jsp/exception.jsp</location>
>> 	</error-page>
>>
>> 	<error-page>
>>          <error-code>500</error-code>
>> 		<location>/WEB-INF/view/jsp/errors.jsp</location>
>> 	</error-page>
>>
>> 	<error-page>
>> 		<error-code>404</error-code>
>> 		<location>/</location>
>> 	</error-page>
>>
>>      <error-page>
>>          <error-code>403</error-code>
>>          <location>/403.html</location>
>>      </error-page>
>>
>> I added this
>>
>> 	<error-page>
>> 		<exception-type>java.lang.Exception</exception-type>
>> 		<location>/WEB-INF/view/jsp/exception.jsp</location>
>> 	</error-page>
> OK, what error page do you get if you cause the error without this entry?
>
>
> p
>
>> --
>> Jonathan Rosenberg
>> Founder&  Executive Director
>> Tabby's Place, a Cat Sanctuary
>> http://www.tabbysplace.org/

Hi, Jonathan-

 From the Java Servlet Specification:

The location element "contains the location of the resource in the web 
application relative to the root of the web application. The value of 
the location must have a leading ‘/’."

I specify locations as I would access them from the web. For example, 
and depending on how your JSPs are mapped, I would use:

<location>/exception.jsp</location>

as the location sub-element for the java.lang.Exception error page. The 
leading /WEB-INF/view/jsp might be getting in the way.

-Terence Bandoian


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


Re: Catching Exception "in Application"

Posted by Pid <pi...@pidster.com>.
On 27/01/2012 18:53, Jonathan Rosenberg wrote:
> On Fri, Jan 27, 2012 at 1:45 PM, Pid <pi...@pidster.com> wrote:
>> On 27/01/2012 18:38, Jonathan Rosenberg wrote:
>>> That is in the original CAS server web.xml.  I left it untouched.
>>
>> For the rest of the day, as an experiment I will bottom-post to any
>> thread containing a reply via top-post.
>>
>>
>>> On Fri, Jan 27, 2012 at 1:35 PM, Pid <pi...@pidster.com> wrote:
>>>> On 27/01/2012 18:00, Jonathan Rosenberg wrote:
>>>>> Vital stats:
>>>>>
>>>>> Apache Tomcat/7.0.22  1.6.0_20-b20    Sun Microsystems Inc.   Linux
>>>>>       2.6.34.7-56.40.amzn1.i686
>>>>>
>>>>> I have a CAS server deployed on this instance.
>>>>>
>>>>> I am trying to catch errors within the server (e.g., DB down) so I can
>>>>> display friendly page to user & log error.
>>>>>
>>>>> In the web.xml for the CAS server I have (I added error-page for
>>>>> java.lang.Exception, ohters were already there)
>>>>>
>>>>> <error-page>
>>>>>               <exception-type>org.springframework.context.ApplicationContextException</exception-type>
>>>>>               <location>/WEB-INF/view/jsp/brokenContext.jsp</location>
>>>>>       </error-page>
>>>>>
>>>>>       <error-page>
>>>>>               <exception-type>java.lang.Exception</exception-type>
>>>>>               <location>/WEB-INF/view/jsp/exception.jsp</location>
>>>>>       </error-page>
>>>>>
>>>>>       <error-page>
>>>>>         <error-code>500</error-code>
>>>>>               <location>/WEB-INF/view/jsp/errors.jsp</location>
>>>>>       </error-page>
>>>>>
>>>>>       <error-page>
>>>>>               <error-code>404</error-code>
>>>>>               <location>/</location>
>>>>>       </error-page>
>>>>
>>>> Is the above correct?  A 404 returns '/'?
>>>>
>>>>
>>>> p
>>>>
>>>>>     <error-page>
>>>>>         <error-code>403</error-code>
>>>>>         <location>/403.html</location>
>>>>>     </error-page>
>>>>>
>>>>> Bu when I trigger an error (i.e., stop DB) I am seeing the default
>>>>> Tomcat error page:
>>>>>
>>>>> HTTP Status 500 -
>>>>> type Exception report
>>>>> message
>>>>> description The server encountered an internal error () that prevented
>>>>> it from fulfilling this request.
>>>>> exception
>>>>> org.springframework.webflow.execution.ActionExecutionException:
>>>>> Exception thrown executing [AnnotatedAction@17b2b99 targetAction =
>>>>> [EvaluateAction@16b653d expression =
>>>>> authenticationViaFormAction.submit(flowRequestContext,
>>>>> flowScope.credentials, messageContext), resultExpression = [null]],
>>>>> attributes = map[[empty]]] in state 'realSubmit' of flow 'login' --
>>>>> action execution attributes were 'map[[empty]]'
>>>>> . . .
>>>>>
>>>>> I'm a newbie to Tomcat & am not sure where to start looking.
>>>>>
>>>>> --
>>>>> Jonathan Rosenberg
>>>>> Founder & Executive Director
>>>>> Tabby's Place, a Cat Sanctuary
>>>>> http://www.tabbysplace.org/
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> [key:62590808]
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>
>> Did you post the whole error page definition block?
>> What was the original contents and what have you added?
> 
> Original error-page elements:
> 
> 	<error-page>
> 		<exception-type>org.springframework.context.ApplicationContextException</exception-type>
> 		<location>/WEB-INF/view/jsp/brokenContext.jsp</location>
> 	</error-page>
> 
> 	<error-page>
> 		<exception-type>java.lang.Exception</exception-type>
> 		<location>/WEB-INF/view/jsp/exception.jsp</location>
> 	</error-page>
> 
> 	<error-page>
>         <error-code>500</error-code>
> 		<location>/WEB-INF/view/jsp/errors.jsp</location>
> 	</error-page>
> 
> 	<error-page>
> 		<error-code>404</error-code>
> 		<location>/</location>
> 	</error-page>
> 
>     <error-page>
>         <error-code>403</error-code>
>         <location>/403.html</location>
>     </error-page>
> 
> I added this
> 
> 	<error-page>
> 		<exception-type>java.lang.Exception</exception-type>
> 		<location>/WEB-INF/view/jsp/exception.jsp</location>
> 	</error-page>

OK, what error page do you get if you cause the error without this entry?


p

> --
> Jonathan Rosenberg
> Founder & Executive Director
> Tabby's Place, a Cat Sanctuary
> http://www.tabbysplace.org/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


-- 

[key:62590808]


Re: Catching Exception "in Application"

Posted by Jonathan Rosenberg <jr...@tabbysplace.org>.
On Fri, Jan 27, 2012 at 1:45 PM, Pid <pi...@pidster.com> wrote:
> On 27/01/2012 18:38, Jonathan Rosenberg wrote:
>> That is in the original CAS server web.xml.  I left it untouched.
>
> For the rest of the day, as an experiment I will bottom-post to any
> thread containing a reply via top-post.
>
>
>> On Fri, Jan 27, 2012 at 1:35 PM, Pid <pi...@pidster.com> wrote:
>>> On 27/01/2012 18:00, Jonathan Rosenberg wrote:
>>>> Vital stats:
>>>>
>>>> Apache Tomcat/7.0.22  1.6.0_20-b20    Sun Microsystems Inc.   Linux
>>>>       2.6.34.7-56.40.amzn1.i686
>>>>
>>>> I have a CAS server deployed on this instance.
>>>>
>>>> I am trying to catch errors within the server (e.g., DB down) so I can
>>>> display friendly page to user & log error.
>>>>
>>>> In the web.xml for the CAS server I have (I added error-page for
>>>> java.lang.Exception, ohters were already there)
>>>>
>>>> <error-page>
>>>>               <exception-type>org.springframework.context.ApplicationContextException</exception-type>
>>>>               <location>/WEB-INF/view/jsp/brokenContext.jsp</location>
>>>>       </error-page>
>>>>
>>>>       <error-page>
>>>>               <exception-type>java.lang.Exception</exception-type>
>>>>               <location>/WEB-INF/view/jsp/exception.jsp</location>
>>>>       </error-page>
>>>>
>>>>       <error-page>
>>>>         <error-code>500</error-code>
>>>>               <location>/WEB-INF/view/jsp/errors.jsp</location>
>>>>       </error-page>
>>>>
>>>>       <error-page>
>>>>               <error-code>404</error-code>
>>>>               <location>/</location>
>>>>       </error-page>
>>>
>>> Is the above correct?  A 404 returns '/'?
>>>
>>>
>>> p
>>>
>>>>     <error-page>
>>>>         <error-code>403</error-code>
>>>>         <location>/403.html</location>
>>>>     </error-page>
>>>>
>>>> Bu when I trigger an error (i.e., stop DB) I am seeing the default
>>>> Tomcat error page:
>>>>
>>>> HTTP Status 500 -
>>>> type Exception report
>>>> message
>>>> description The server encountered an internal error () that prevented
>>>> it from fulfilling this request.
>>>> exception
>>>> org.springframework.webflow.execution.ActionExecutionException:
>>>> Exception thrown executing [AnnotatedAction@17b2b99 targetAction =
>>>> [EvaluateAction@16b653d expression =
>>>> authenticationViaFormAction.submit(flowRequestContext,
>>>> flowScope.credentials, messageContext), resultExpression = [null]],
>>>> attributes = map[[empty]]] in state 'realSubmit' of flow 'login' --
>>>> action execution attributes were 'map[[empty]]'
>>>> . . .
>>>>
>>>> I'm a newbie to Tomcat & am not sure where to start looking.
>>>>
>>>> --
>>>> Jonathan Rosenberg
>>>> Founder & Executive Director
>>>> Tabby's Place, a Cat Sanctuary
>>>> http://www.tabbysplace.org/
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>
>>>
>>> --
>>>
>>> [key:62590808]
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
> Did you post the whole error page definition block?
> What was the original contents and what have you added?

Original error-page elements:

	<error-page>
		<exception-type>org.springframework.context.ApplicationContextException</exception-type>
		<location>/WEB-INF/view/jsp/brokenContext.jsp</location>
	</error-page>

	<error-page>
		<exception-type>java.lang.Exception</exception-type>
		<location>/WEB-INF/view/jsp/exception.jsp</location>
	</error-page>

	<error-page>
        <error-code>500</error-code>
		<location>/WEB-INF/view/jsp/errors.jsp</location>
	</error-page>

	<error-page>
		<error-code>404</error-code>
		<location>/</location>
	</error-page>

    <error-page>
        <error-code>403</error-code>
        <location>/403.html</location>
    </error-page>

I added this

	<error-page>
		<exception-type>java.lang.Exception</exception-type>
		<location>/WEB-INF/view/jsp/exception.jsp</location>
	</error-page>
--
Jonathan Rosenberg
Founder & Executive Director
Tabby's Place, a Cat Sanctuary
http://www.tabbysplace.org/

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


Re: Catching Exception "in Application"

Posted by Pid <pi...@pidster.com>.
On 27/01/2012 18:38, Jonathan Rosenberg wrote:
> That is in the original CAS server web.xml.  I left it untouched.

For the rest of the day, as an experiment I will bottom-post to any
thread containing a reply via top-post.


> On Fri, Jan 27, 2012 at 1:35 PM, Pid <pi...@pidster.com> wrote:
>> On 27/01/2012 18:00, Jonathan Rosenberg wrote:
>>> Vital stats:
>>>
>>> Apache Tomcat/7.0.22  1.6.0_20-b20    Sun Microsystems Inc.   Linux
>>>       2.6.34.7-56.40.amzn1.i686
>>>
>>> I have a CAS server deployed on this instance.
>>>
>>> I am trying to catch errors within the server (e.g., DB down) so I can
>>> display friendly page to user & log error.
>>>
>>> In the web.xml for the CAS server I have (I added error-page for
>>> java.lang.Exception, ohters were already there)
>>>
>>> <error-page>
>>>               <exception-type>org.springframework.context.ApplicationContextException</exception-type>
>>>               <location>/WEB-INF/view/jsp/brokenContext.jsp</location>
>>>       </error-page>
>>>
>>>       <error-page>
>>>               <exception-type>java.lang.Exception</exception-type>
>>>               <location>/WEB-INF/view/jsp/exception.jsp</location>
>>>       </error-page>
>>>
>>>       <error-page>
>>>         <error-code>500</error-code>
>>>               <location>/WEB-INF/view/jsp/errors.jsp</location>
>>>       </error-page>
>>>
>>>       <error-page>
>>>               <error-code>404</error-code>
>>>               <location>/</location>
>>>       </error-page>
>>
>> Is the above correct?  A 404 returns '/'?
>>
>>
>> p
>>
>>>     <error-page>
>>>         <error-code>403</error-code>
>>>         <location>/403.html</location>
>>>     </error-page>
>>>
>>> Bu when I trigger an error (i.e., stop DB) I am seeing the default
>>> Tomcat error page:
>>>
>>> HTTP Status 500 -
>>> type Exception report
>>> message
>>> description The server encountered an internal error () that prevented
>>> it from fulfilling this request.
>>> exception
>>> org.springframework.webflow.execution.ActionExecutionException:
>>> Exception thrown executing [AnnotatedAction@17b2b99 targetAction =
>>> [EvaluateAction@16b653d expression =
>>> authenticationViaFormAction.submit(flowRequestContext,
>>> flowScope.credentials, messageContext), resultExpression = [null]],
>>> attributes = map[[empty]]] in state 'realSubmit' of flow 'login' --
>>> action execution attributes were 'map[[empty]]'
>>> . . .
>>>
>>> I'm a newbie to Tomcat & am not sure where to start looking.
>>>
>>> --
>>> Jonathan Rosenberg
>>> Founder & Executive Director
>>> Tabby's Place, a Cat Sanctuary
>>> http://www.tabbysplace.org/
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>
>>
>> --
>>
>> [key:62590808]
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

Did you post the whole error page definition block?
What was the original contents and what have you added?


p


-- 

[key:62590808]


Re: Catching Exception "in Application"

Posted by Jonathan Rosenberg <jr...@tabbysplace.org>.
That is in the original CAS server web.xml.  I left it untouched.

--
Jonathan Rosenberg
Founder & Executive Director
Tabby's Place, a Cat Sanctuary
http://www.tabbysplace.org/


On Fri, Jan 27, 2012 at 1:35 PM, Pid <pi...@pidster.com> wrote:
> On 27/01/2012 18:00, Jonathan Rosenberg wrote:
>> Vital stats:
>>
>> Apache Tomcat/7.0.22  1.6.0_20-b20    Sun Microsystems Inc.   Linux
>>       2.6.34.7-56.40.amzn1.i686
>>
>> I have a CAS server deployed on this instance.
>>
>> I am trying to catch errors within the server (e.g., DB down) so I can
>> display friendly page to user & log error.
>>
>> In the web.xml for the CAS server I have (I added error-page for
>> java.lang.Exception, ohters were already there)
>>
>> <error-page>
>>               <exception-type>org.springframework.context.ApplicationContextException</exception-type>
>>               <location>/WEB-INF/view/jsp/brokenContext.jsp</location>
>>       </error-page>
>>
>>       <error-page>
>>               <exception-type>java.lang.Exception</exception-type>
>>               <location>/WEB-INF/view/jsp/exception.jsp</location>
>>       </error-page>
>>
>>       <error-page>
>>         <error-code>500</error-code>
>>               <location>/WEB-INF/view/jsp/errors.jsp</location>
>>       </error-page>
>>
>>       <error-page>
>>               <error-code>404</error-code>
>>               <location>/</location>
>>       </error-page>
>
> Is the above correct?  A 404 returns '/'?
>
>
> p
>
>>     <error-page>
>>         <error-code>403</error-code>
>>         <location>/403.html</location>
>>     </error-page>
>>
>> Bu when I trigger an error (i.e., stop DB) I am seeing the default
>> Tomcat error page:
>>
>> HTTP Status 500 -
>> type Exception report
>> message
>> description The server encountered an internal error () that prevented
>> it from fulfilling this request.
>> exception
>> org.springframework.webflow.execution.ActionExecutionException:
>> Exception thrown executing [AnnotatedAction@17b2b99 targetAction =
>> [EvaluateAction@16b653d expression =
>> authenticationViaFormAction.submit(flowRequestContext,
>> flowScope.credentials, messageContext), resultExpression = [null]],
>> attributes = map[[empty]]] in state 'realSubmit' of flow 'login' --
>> action execution attributes were 'map[[empty]]'
>> . . .
>>
>> I'm a newbie to Tomcat & am not sure where to start looking.
>>
>> --
>> Jonathan Rosenberg
>> Founder & Executive Director
>> Tabby's Place, a Cat Sanctuary
>> http://www.tabbysplace.org/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
>
> --
>
> [key:62590808]
>

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


Re: Catching Exception "in Application"

Posted by Pid <pi...@pidster.com>.
On 27/01/2012 18:00, Jonathan Rosenberg wrote:
> Vital stats:
> 
> Apache Tomcat/7.0.22 	1.6.0_20-b20 	Sun Microsystems Inc. 	Linux
> 	2.6.34.7-56.40.amzn1.i686
> 
> I have a CAS server deployed on this instance.
> 
> I am trying to catch errors within the server (e.g., DB down) so I can
> display friendly page to user & log error.
> 
> In the web.xml for the CAS server I have (I added error-page for
> java.lang.Exception, ohters were already there)
> 
> <error-page>
> 		<exception-type>org.springframework.context.ApplicationContextException</exception-type>
> 		<location>/WEB-INF/view/jsp/brokenContext.jsp</location>
> 	</error-page>
> 
> 	<error-page>
> 		<exception-type>java.lang.Exception</exception-type>
> 		<location>/WEB-INF/view/jsp/exception.jsp</location>
> 	</error-page>
> 
> 	<error-page>
>         <error-code>500</error-code>
> 		<location>/WEB-INF/view/jsp/errors.jsp</location>
> 	</error-page>
> 
> 	<error-page>
> 		<error-code>404</error-code>
> 		<location>/</location>
> 	</error-page>

Is the above correct?  A 404 returns '/'?


p

>     <error-page>
>         <error-code>403</error-code>
>         <location>/403.html</location>
>     </error-page>
> 
> Bu when I trigger an error (i.e., stop DB) I am seeing the default
> Tomcat error page:
> 
> HTTP Status 500 -
> type Exception report
> message
> description The server encountered an internal error () that prevented
> it from fulfilling this request.
> exception
> org.springframework.webflow.execution.ActionExecutionException:
> Exception thrown executing [AnnotatedAction@17b2b99 targetAction =
> [EvaluateAction@16b653d expression =
> authenticationViaFormAction.submit(flowRequestContext,
> flowScope.credentials, messageContext), resultExpression = [null]],
> attributes = map[[empty]]] in state 'realSubmit' of flow 'login' --
> action execution attributes were 'map[[empty]]'
> . . .
> 
> I'm a newbie to Tomcat & am not sure where to start looking.
> 
> --
> Jonathan Rosenberg
> Founder & Executive Director
> Tabby's Place, a Cat Sanctuary
> http://www.tabbysplace.org/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


-- 

[key:62590808]