cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r161179 - in cocoon/branches/BRANCH_2_1_X: ./ src/blocks/portal/java/org/apache/cocoon/portlet/ src/java/org/apache/cocoon/components/treeprocessor/sitemap/ src/java/org/apache/cocoon/servlet/
Date Wed, 13 Apr 2005 13:24:57 GMT
Author: vgritsenko
Date: Wed Apr 13 06:24:55 2005
New Revision: 161179

URL: http://svn.apache.org/viewcvs?view=rev&rev=161179
Log:
      Stacktrace of the ResourceNotFound exception is logged only in DEBUG level,
      otherwise only exception message is logged.


Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portlet/CocoonPortlet.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portlet/ManagedCocoonPortlet.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java
    cocoon/branches/BRANCH_2_1_X/status.xml

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portlet/CocoonPortlet.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portlet/CocoonPortlet.java?view=diff&r1=161178&r2=161179
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portlet/CocoonPortlet.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portlet/CocoonPortlet.java
Wed Apr 13 06:24:55 2005
@@ -1161,16 +1161,18 @@
                                     null);
                     return;
                 }
-            } catch (ResourceNotFoundException rse) {
-                if (getLogger().isWarnEnabled()) {
-                    getLogger().warn("The resource was not found", rse);
+            } catch (ResourceNotFoundException e) {
+                if (getLogger().isDebugEnabled()) {
+                    getLogger().warn(e.getMessage(), e);
+                } else if (getLogger().isWarnEnabled()) {
+                    getLogger().warn(e.getMessage());
                 }
 
                 manageException(request, res, env, uri,
                                 "Resource Not Found",
                                 "Resource Not Found",
                                 "The requested portlet could not be found",
-                                rse);
+                                e);
                 return;
 
             } catch (ConnectionResetException e) {

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portlet/ManagedCocoonPortlet.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portlet/ManagedCocoonPortlet.java?view=diff&r1=161178&r2=161179
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portlet/ManagedCocoonPortlet.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portlet/ManagedCocoonPortlet.java
Wed Apr 13 06:24:55 2005
@@ -451,16 +451,18 @@
                                     null);
                     return;
                 }
-            } catch (ResourceNotFoundException rse) {
-                if (getLogger().isWarnEnabled()) {
-                    getLogger().warn("The resource was not found", rse);
+            } catch (ResourceNotFoundException e) {
+                if (getLogger().isDebugEnabled()) {
+                    getLogger().warn(e.getMessage(), e);
+                } else if (getLogger().isWarnEnabled()) {
+                    getLogger().warn(e.getMessage());
                 }
 
                 manageException(request, res, env, uri,
                                 "Resource Not Found",
                                 "Resource Not Found",
                                 "The requested portlet could not be found",
-                                rse);
+                                e);
                 return;
 
             } catch (ConnectionResetException e) {

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java?view=diff&r1=161178&r2=161179
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java
Wed Apr 13 06:24:55 2005
@@ -162,7 +162,11 @@
                                                    Environment env,
                                                    InvokeContext context)
     throws Exception {
-        this.handledErrorsLogger.error(ex.getMessage(), ex);
+        if (ex instanceof ResourceNotFoundException) {
+            this.handledErrorsLogger.error(ex.getMessage());
+        } else {
+            this.handledErrorsLogger.error(ex.getMessage(), ex);
+        }
 
         try {
             prepare(context, env, ex);

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java?view=diff&r1=161178&r2=161179
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java Wed
Apr 13 06:24:55 2005
@@ -1056,7 +1056,7 @@
         }
 
         // Get the cocoon engine instance
-        
+
         if (reloadCocoon(request.getPathInfo(), request.getParameter(Constants.RELOAD_PARAM)))
{
             disposeCocoon();
             initLogger();
@@ -1153,9 +1153,11 @@
                                     null);
                     return;
                 }
-            } catch (ResourceNotFoundException rse) {
-                if (getLogger().isWarnEnabled()) {
-                    getLogger().warn("The resource was not found", rse);
+            } catch (ResourceNotFoundException e) {
+                if (getLogger().isDebugEnabled()) {
+                    getLogger().warn(e.getMessage(), e);
+                } else if (getLogger().isWarnEnabled()) {
+                    getLogger().warn(e.getMessage());
                 }
 
                 manageException(request, res, env, uri,
@@ -1163,7 +1165,7 @@
                                 "Resource Not Found",
                                 "Resource Not Found",
                                 "The requested resource \"" + request.getRequestURI() + "\"
could not be found",
-                                rse);
+                                e);
                 return;
 
             } catch (ConnectionResetException e) {
@@ -1376,7 +1378,7 @@
      */
     protected synchronized void createCocoon()
     throws ServletException {
-        
+
         // Recheck that we need to create the cocoon object. It can have been created by
         // a concurrent invocation to this method.
         if (this.cocoon != null) {
@@ -1526,7 +1528,7 @@
                 }
                 reload = true;
             }
-            
+
             return reload;
         } else {
             return false;

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/status.xml?view=diff&r1=161178&r2=161179
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Wed Apr 13 06:24:55 2005
@@ -196,6 +196,10 @@
 
   <changes>
   <release version="@version@" date="@date@">
+    <action dev="VG" type="update">
+      Stacktrace of the ResourceNotFound exception is logged only in DEBUG level,
+      otherwise only exception message is logged.
+    </action>
     <action dev="SW" type="fix">
       Fix environment handling to allow the root sitemap to be at an abitrary location
       and not only in the main webapp context directory.



Mime
View raw message