shuber      2004/08/18 15:01:09 CEST

  Modified files:
    core/src/java/org/jahia/services/applications 
                                                  ServletDispatchingProvider.java 
  Log:
  Improved web application error logging, retrieving nested exception.
  
  Revision  Changes    Path
  1.4       +20 -35    
jahia/core/src/java/org/jahia/services/applications/ServletDispatchingProvider.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/services/applications/ServletDispatchingProvider.java.diff?r1=1.3&r2=1.4&f=h
  
  
  
  Index: ServletDispatchingProvider.java
  ===================================================================
  RCS file: 
/cvs/jahia/core/src/java/org/jahia/services/applications/ServletDispatchingProvider.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ServletDispatchingProvider.java   29 Jul 2004 17:11:47 -0000      1.3
  +++ ServletDispatchingProvider.java   18 Aug 2004 13:01:09 -0000      1.4
  @@ -334,45 +334,30 @@
               }
   
           } catch (ServletException se) {
  -            logger.error("Error in web application",
  -                         new JahiaException("Can't access application " +
  -                                            appBean.getName(),
  -                                            "Servlet Exception occured in 
getAppOutput dispatching process ! Message = [" +
  -                                            se + "]",
  -                                            JahiaException.ERROR_SEVERITY,
  -                                            JahiaException.APPLICATION_ERROR,
  -                                            se));
  -            logger.debug("Can't access application, ServletException " +
  -                         se.toString(), se);
  -            logger.debug(
  -                
"-----------------------------------------------------------------------");
  -            se.printStackTrace();
  -            logger.debug(
  -                
"-----------------------------------------------------------------------");
  +            logger.error ("Error in web application, can't access application " +
  +                          appBean.getName (), se);
  +            Throwable t = se;
  +            int count = 0;
  +            while (JahiaErrorDisplay.getNestedException(t) != null) {
  +                count++;
  +                t = JahiaErrorDisplay.getNestedException(t);
  +                logger.error("Nested exception " + count, t);
  +            }
               return "Error while retrieving application " + appBean.getName();
           } catch (IOException ioe) {
  -            logger.error("Error in web application",
  -                         new JahiaException("Can't access application " +
  -                                            appBean.getName(),
  -                                            "IOException occured in getAppOutput 
dispatching process !",
  -                                            JahiaException.ERROR_SEVERITY,
  -                                            JahiaException.APPLICATION_ERROR,
  -                                            ioe));
  -            logger.debug("Can't access application, IOException " +
  -                         ioe.toString(), ioe);
  +            logger.error ("Error in web application " +
  +                          appBean.getName (), ioe);
               return "Error while retrieving application " + appBean.getName();
           } catch (Throwable t) {
  -            logger.error("Application generated error", t);
  -            logger.error("Error in web application",
  -                         new JahiaException(
  -                "JahiaApplicationsDispatchingServletService for app " +
  -                appBean.getName(),
  -                "Unknown exception occured during dispatching process " +
  -                t.getMessage(),
  -                JahiaException.WARNING_SEVERITY,
  -                JahiaException.APPLICATION_ERROR, t));
  -            logger.debug("Can't access application, Exception " + t.toString(),
  -                         t);
  +            logger.error ("Error in web application for app " +
  +                          appBean.getName (), t);
  +            Throwable th = t;
  +            int count = 0;
  +            while (JahiaErrorDisplay.getNestedException(th) != null) {
  +                count++;
  +                th = JahiaErrorDisplay.getNestedException(th);
  +                logger.error("Nested exception " + count, th);
  +            }
               return "Error while retrieving application " + appBean.getName();
           }
   
  

Reply via email to