I'm creating a bundle after an example found in the OSGi core R4.1 specification on page 101-278 (4.8.1 Admin Permission). The example shows how to restrict AdminPermission to bundles of a signer that has a subject name of ACME.
After defining this permission, I then run code from a bundle that needs this permission, and I get a ClassCastException at the point where this permission is (probably) being checked. The partial stack trace is printed below:
java.lang.ClassCastException: [Ljava.lang.String;
at org.eclipse.osgi.framework.internal.core.FilterImpl.compare_Unknown(FilterImpl.java:1251)
at org.eclipse.osgi.framework.internal.core.FilterImpl.compare(FilterImpl.java:578)
at org.eclipse.osgi.framework.internal.core.FilterImpl.match0(FilterImpl.java:455)
at org.eclipse.osgi.framework.internal.core.FilterImpl.match(FilterImpl.java:178)
at org.osgi.framework.AdminPermission.implies(AdminPermission.java:443)
[...]
at equinox_bug_adminpermission.Activator.start(Activator.java:32)
[...]
this occurs when the security check is invoked when calling getHeaders() on a bundle. This is line 32:
Dictionary headers = b.getHeaders();
To be honest, I'm kind of puzzled by this because this seems to be quite a basic example, so I might be overlooking something simple here?
Greetings, Marcel