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
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