Commits

musachy  committed fb3a719

Log class loading errors in ClassFinder

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@1918e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 278d2b4

Comments (0)

Files changed (1)

File src/java/com/opensymphony/xwork2/util/finder/ClassFinder.java

                     if (clazz.isAnnotationPresent(annotation)) {
                         classes.add(clazz);
                     }
-                } catch (ClassNotFoundException e) {
+                } catch (Throwable e) {
+                    if (LOG.isErrorEnabled())
+                        LOG.error("Error loading class [#0]", e, classInfo.getName());
                     classesNotLoaded.add(classInfo.getName());
                 }
             }
                             methods.add(method);
                         }
                     }
-                } catch (ClassNotFoundException e) {
+                } catch (Throwable e) {
+                    if (LOG.isErrorEnabled())
+                        LOG.error("Error loading class [#0]", e, classInfo.getName());
                     classesNotLoaded.add(classInfo.getName());
                 }
             }
                             constructors.add(constructor);
                         }
                     }
-                } catch (ClassNotFoundException e) {
+                } catch (Throwable e) {
+                    if (LOG.isErrorEnabled())
+                        LOG.error("Error loading class [#0]", e, classInfo.getName());
                     classesNotLoaded.add(classInfo.getName());
                 }
             }
                             fields.add(field);
                         }
                     }
-                } catch (ClassNotFoundException e) {
+                } catch (Throwable e) {
+                    if (LOG.isErrorEnabled())
+                        LOG.error("Error loading class [#0]", e, classInfo.getName());
                     classesNotLoaded.add(classInfo.getName());
                 }
             }
                 } else if (classInfo.getPackageName().equals(packageName)){
                     classes.add(classInfo.get());
                 }
-            } catch (ClassNotFoundException e) {
+            } catch (Throwable e) {
+                if (LOG.isErrorEnabled())
+                    LOG.error("Error loading class [#0]", e, classInfo.getName());
                 classesNotLoaded.add(classInfo.getName());
             }
         }