cancel
Showing results for 
Search instead for 
Did you mean: 

Redirect to error page if EJBTransactionRolledbackException

mundi
Champ in-the-making
Champ in-the-making
Hello,

I am using richfaces and opencmis to connect to an alfresco share.

After doing a opencmis query sometimes I get the error

Exception: javax.ejb.EJBException: org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: I/O error; nested exception is java.net.SocketTimeoutException: Read timed out

this is due to heavy traffic on my alfresco server.
What I want to do is redirect the user to an error site.
I have added the lines

    <error-page>
        <exception-type>java.lang.Exception</exception-type>
        <location>/error.jsf</location>
    </error-page>

to my web.xml file which which redirects the user for all other errors but not for this one. I also tried to address the error directly:

    <error-page>
        <exception-type>javax.ejb.EJBTransactionRolledbackException</exception-type>
        <location>/error.jsf</location>
    </error-page>

but nevertheless the redirection is not done.
Am I missing something? Is there another possiblity to redirect the user in this case?
Thanks for reply
4 REPLIES 4

mrogers
Star Contributor
Star Contributor
How does your CMISRuntimeException get wrapped in an EJBException?   I suspect there is a try / catch swallowing the exception before it can be handled by richfaces.

mundi
Champ in-the-making
Champ in-the-making
Thanks for the reply.
No, there is no try / catch surrounding…

mrogers
Star Contributor
Star Contributor
Perhaps not in your code but something **IS** catching the cmisruntimeexception.

Something is wrapping the CmisRuntimeException in an EJBException.

And how does the EJBException get logged?
Exception: javax.ejb.EJBException: org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: I/O error; nested exception is java.net.SocketTimeoutException: Read timed out

I suspect its there that the exception gets swallowed.

amurad
Champ in-the-making
Champ in-the-making

Thanks for the thread. Could you please mention the page path?