https://issues.apache.org/bugzilla/show_bug.cgi?id=48007#c5
authorkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 9 Mar 2010 15:04:53 +0000 (15:04 +0000)
committerkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 9 Mar 2010 15:04:53 +0000 (15:04 +0000)
Improve exception processing in CustomObjectInputStream#resolveClass(),
to help find the cause behind BZ 48007.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@920912 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/util/CustomObjectInputStream.java

index ec5b3d4..543b65d 100644 (file)
@@ -75,8 +75,14 @@ public final class CustomObjectInputStream
         try {
             return Class.forName(classDesc.getName(), false, classLoader);
         } catch (ClassNotFoundException e) {
-            // Try also the superclass because of primitive types
-            return super.resolveClass(classDesc);
+            try {
+                // Try also the superclass because of primitive types
+                return super.resolveClass(classDesc);
+            } catch (ClassNotFoundException e2) {
+                // Rethrow original exception, as it can have more information
+                // about why the class was not found. BZ 48007
+                throw e;
+            }
         }
     }