You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@clerezza.apache.org by "Henry Story (JIRA)" <ji...@apache.org> on 2011/07/27 11:19:10 UTC

[jira] [Updated] (CLEREZZA-618) PermissionGatherer throws a lot of exceptions

     [ https://issues.apache.org/jira/browse/CLEREZZA-618?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henry Story updated CLEREZZA-618:
---------------------------------

    Attachment: permissionDescriptions.txt

the output of the grep command on the log files

> PermissionGatherer throws a lot of exceptions
> ---------------------------------------------
>
>                 Key: CLEREZZA-618
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-618
>             Project: Clerezza
>          Issue Type: Bug
>            Reporter: Henry Story
>         Attachments: permissionDescriptions.txt
>
>
> The class org.apache.clerezza.permissiondescriptions.PermissionGatherer throws a lot of exceptions which could be of interest.
> If one applies the following patch 
> diff --git a/parent/permissiondescriptions/src/main/java/org/apache/clerezza/permissiondescriptions/PermissionGatherer.j
> index b85a4dc..cca0737 100644
> --- a/parent/permissiondescriptions/src/main/java/org/apache/clerezza/permissiondescriptions/PermissionGatherer.java
> +++ b/parent/permissiondescriptions/src/main/java/org/apache/clerezza/permissiondescriptions/PermissionGatherer.java
> @@ -200,7 +200,13 @@ public class PermissionGatherer implements BundleListener {
>                                 String className = url.getPath();
>                                 int indexOfLastDot = className.lastIndexOf(".");
>                                 className = className.replaceAll("/", ".").substring(1, indexOfLastDot);
> -                               Class<?> clazz = bundle.loadClass(className);
> +                Class<?> clazz;
> +                try {
> +                    clazz = bundle.loadClass(className);
> +                } catch (Error e) {
> +                    logger.warn("was trying to load "+url.toExternalForm()+ " in bundle "+bundle.getSymbolicName(),e);
> +                    throw e;
> +                }
>                                 if (Permission.class.isAssignableFrom(clazz)) {
>                                         PermissionInfo permissionInfo = clazz.getAnnotation(PermissionInfo.class);
>                                         if (permissionInfo != null) {
> and after running Clerezza one can grep the clerezza.log with
> $ grep -A 1 'WARN FelixDispatchQueue org.apache.clerezza.permissiondescriptions.Permissi'  clerezza.log > ~/permissionDescriptions.txt
> And find the attached errors. Does this indicate a problem? Should permission-descriptions at least catch those errors and continue with the other classes in that package?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira