users@glassfish.java.net

why does PermissionCacheFactory.resetCaches avoids NPE in custom JACC imple

From: <glassfish_at_javadesktop.org>
Date: Fri, 11 Apr 2008 11:17:26 PDT

<p>
I've written a small JACC implementation that I've configured and used successfully in
Glassfish v2ur1. Good stuff! Works a treat!
</p>

<p>
But, here's the weird part, for some reason I get a NullPointerException in
com.sun.web.security.WebSecurityManager's checkPermission [b]unless[/b] I make a call
to the static method com.sun.enterprise.security.PermissionCacheFactory.resetCaches()
in the static block of my Policy implementation.
</p>

<p>
This method set the private member variable supportsReuse to true and my JACC implemetation
works fine.
</p>

<p>
I can't help but feel this is not doing things the right way.
</p>

<p>
Any ideas?
</p>

<p>
Here a partial stacktrace if I disable my "glassfish workaround":
<br />
[#|2008-04-11T12:50:33.969-0500|SEVERE|sun-appserver9.1|org.apache.coyote.tomcat5.CoyoteAdapter|_ThreadID=17;_ThreadName=httpWorkerThread-4848-1;_RequestID=c7009f02-e877-4d67-817d-ea77c9f220fe;|PWC3989: An exception or error occurred in the container during the request processing<br />
java.lang.NullPointerException<br />
        at com.sun.web.security.WebSecurityManager.checkPermission(WebSecurityManager.java:302)<br />
        at com.sun.web.security.WebSecurityManager.hasUserDataPermission(WebSecurityManager.java:464)<br />
        at com.sun.web.security.RealmAdapter.hasUserDataPermission(RealmAdapter.java:833)<br />
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)<br />
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:609)<br />
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)<br />
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)<br />
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)<br />
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)<br />
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)<br />
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)<br />
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)<br />
<br />
</p>
[Message sent by forum member 'brian_of_fortent' (brian_of_fortent)]

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