struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Musachy Barroso (JIRA)" <j...@apache.org>
Subject [jira] Commented: (WW-3234) Update ClassFinder and PackageBasedActionConfigBuilder to avoid loading unnecessary classes in package scan, avoid spurious warnings and other benefits
Date Thu, 03 Sep 2009 14:04:33 GMT

    [ https://issues.apache.org/struts/browse/WW-3234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46720#action_46720
] 

Musachy Barroso commented on WW-3234:
-------------------------------------

This is something I have wanted to fix for a while, but it is tricky. i will take a look at
your patch, thanks!

> Update ClassFinder and PackageBasedActionConfigBuilder to avoid loading unnecessary classes
in package scan, avoid spurious warnings and other benefits
> -------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3234
>                 URL: https://issues.apache.org/struts/browse/WW-3234
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - Convention
>    Affects Versions: 2.1.7
>            Reporter: Brian Ferris
>         Attachments: struts2-2.1.8-SNAPSHOT-PackageBasedActionConfigBuilder.patch, xworks-2.1.6-SNAPSHOT-ClassFinder.patch
>
>
> By default, the PackageBasedActionConfigBuilder used in the Convention plugin uses the
ClassFinder utility class from XWorks to look for potential action classes on the classpath.
 The behavior of the ClassFinder is to scan every .class file on the classpath and attempt
to load it.  Once all classes have been loaded, the PackageBasedActionConfigBuilder evaluates
each loaded class to see if it is an action (is in the right package?  does it have the proper
name?  does it implement Action?).
> While this works fine, the process of loading EVERY classes on the classpath can produce
a ton of error messages as the ClassFinder attempts to load classes that potentially have
unsatisfied dependencies or other issues.  While these are non-fatal messages, they tend to
initially confuse users (like me!).  See a couple examples I found Googling:
> http://www.mail-archive.com/user@struts.apache.org/msg85317.html
> http://www.mail-archive.com/google-appengine-java@googlegroups.com/msg00048.html
> http://article.gmane.org/gmane.comp.jakarta.struts.user/168495
> I can give more justifications why this is annoying if needed, but even better, here's
a patch to fix the issue.  It's a little tricky because it requires a patch to ClassFinder
(which is in xworks... hopefully you guys can deal with that?) and to PackageBasedActionConfigBuilder.
 The patch to ClassFinder allows specifying an optional class name filter to prevent the load
of classes.  The patch to PackageBasedActionConfigBuilder constructs an appropriate filter
from the various package hints specified in the class.  All together, we get the exact same
class loading behavior without all those annoying error messages.
> Thoughts?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message