I'll be sure to switch it to a RuntimeException (I'm currently re-working the Services support). Once you change it to derive from Runtime Exception you should be able to use the traditional web.xml method or a Spring Error Handler without having to modify the actions.
-Scott
On 10/24/06, John Thiltges <[EMAIL PROTECTED]> wrote:
Scott,
Thanks for the ideas, but unfortunately I didn't have any luck. I looked into the problem a little more and came up with the following solution:
It appears that because UnauthorizedServiceException derives from Exception, it gets converted to an UndeclaredThrowableException. By changing it to derive from RuntimeException, the exception type does not get lost, and the exception can then be caught in GenerateServiceTicketAction.
Next, I added a catch statement in GenerateServiceTicketAction and added to the webflow so that UnauthorizedServiceException goes to the serviceErrorView view.
If it would be helpful, I can sort through my code and post a patch to cas-dev.
Thanks,
John
Scott Battaglia wrote:You can try adding the following to your web.xml:
Either:
<error-page>
<exception>java.lang.reflect.UndeclaredThrowableException</exception>
<location>/WEB-INF/view/jsp/default/ui/serviceErrorView.jsp</location>
</error-page>
or
<error-page>
<exception>org.jasig.cas.services.UnauthorizedServiceException</exception>
<location>/WEB-INF/view/jsp/default/ui/serviceErrorView.jsp</location>
</error-page>
Let me know if that works for you.
-Scott
On 10/24/06, John Thiltges < [EMAIL PROTECTED]> wrote:Hello group,
When using approvedServices and a service is not found, an
UnauthorizedServiceException is thrown. This appears to cause an error
and the end user sees "CAS is Unavailable. A general exception
occurred..." (WEB-INF/view/jsp/errors.jsp).
Should the serviceErrorView be displayed instead? If not, when is the
serviceErrorView used?
Error message from CAS 3.0.5 (unmodified except for enabling
approvedServices in web.xml):
2006-10-24 10:23:03,609 INFO
[org.jasig.cas.authentication.AuthenticationManagerImpl] -
<AuthenticationHandler:
org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler
successfully authenticated the user which provided the following
credentials: asdf>
2006-10-24 10:23:03,678 ERROR
[org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/cas305].[cas]]
- <Servlet.service() for servlet cas threw exception>
java.lang.reflect.UndeclaredThrowableException
at $Proxy1.grantServiceTicket(Unknown Source)
at
org.jasig.cas.web.flow.GenerateServiceTicketAction.doExecuteInternal(GenerateServiceTicketAction.java:33)
at
org.jasig.cas.web.flow.AbstractLoginAction.doExecute (AbstractLoginAction.java:60)
at
org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:204)
...
at java.lang.Thread.run(Thread.java:595)
Caused by: org.jasig.cas.services.UnauthorizedServiceException : Service:
[http://localhost/asdf] not found in registry.
at
org.jasig.cas.services.advice.ServiceAllowedMethodBeforeAdvice.before(ServiceAllowedMethodBeforeAdvice.java :58)
at
org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed (ReflectiveMethodInvocation.java:170)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:209)
... 63 more
Thanks,
John
--
John Thiltges
Information Services-Systems Group
University of Nebraska - Lincoln
_______________________________________________
Yale CAS mailing list
cas@tp.its.yale.edu
http://tp.its.yale.edu/mailman/listinfo/cas
_______________________________________________
Yale CAS mailing list
cas@tp.its.yale.edu http://tp.its.yale.edu/mailman/listinfo/cas
_______________________________________________
Yale CAS mailing list
cas@tp.its.yale.edu
http://tp.its.yale.edu/mailman/listinfo/cas
_______________________________________________ Yale CAS mailing list cas@tp.its.yale.edu http://tp.its.yale.edu/mailman/listinfo/cas