users@glassfish.java.net

Re: why does PermissionCacheFactory.resetCaches avoids NPE in custom JACC i

From: <glassfish_at_javadesktop.org>
Date: Fri, 11 Apr 2008 12:11:51 PDT

yep that's a bug. please file an issue at

https://glassfish.dev.java.net/servlets/ProjectIssues

Glassfish implements the recommendation from section "4.12 Optimization of Permission Evaluations", of the Jacc spec.

instead of calling resetCaches, change your policy provider, so that its refresh method does something like the followingl.

private static final String REUSE = "java.security.Policy.supportsReuse";
try {
            if (PolicyContext.getHandlerKeys().contains(REUSE)) {
                PolicyContext.getContext(REUSE);
            }
        } catch(PolicyContextException pe) {
            throw new IllegalStateException(pe.toString());
        }

this will tell GF that the provider is consistent with reuse of previous evaluation results (because it will be notified of plocy changes). that will cause GF to enable its caching. until we fix the bug, GF will have a problem if caching is not enabled by the provider.

thanks for finding this, and we will get started on a fix.

Ron
[Message sent by forum member 'monzillo' (monzillo)]

http://forums.java.net/jive/thread.jspa?messageID=268842