Community
Participate
Eclipse IDE
If my plugin attempts to load a class through the context class loader (ContextFinder) when a security manager is installed, the load fails with ClassNotFoundException. If I remove the security manager, the class load succeeds. The problem is due to the way ContextFinder checks the call stack. It is looking for the first class on the stack that is not the context finder itself and not loaded by the boot class loader. In the case of a security manager, however, I think there is another class that should be skipped: the (currently anonymous) inner class that performs the doPrivileged() operation. I will attach a test project that reproduces the problem. It works fine when run normally, but it fails if the following VM options are added to the launch config: -Djava.security.manager -Djava.security.policy=<policy-file> (Of course, the policy file should grant all permissions, else there are lots of other problems :-). The attached project includes such a file.) I'm also going to attach a patch that worked for me... but perhaps there is a cleaner solution.
Created attachment 25333 [details] Test case See description for how to run
Created attachment 25334 [details] Proposed Patch
Need to investigate for 3.1.1.
+1 We must fix this for 3.1.1.
Created attachment 25558 [details] Improvement from previous patch This patch avoids the creation of a new inner class by having ContextFinder implement PrivilegedAction itself.
New patch reviewed. Good to go.
Fixed in R3_1_maintenance branch and HEAD (3.2)
*** Bug 117088 has been marked as a duplicate of this bug. ***