I've deployed my FilterToBeanProxy to be initialized lazily (I'm using struts). The index page for my webapp loads two frames. Since the index page is cached by the browser, it is not served by the webapp (and therefore doesn't trigger the initialization of FilterToBeanProxy). The two frames result in two requests. One of these requests starts the initialization process, the other thread checks of it is initialized and gets a NPE (Using Acegi 0.8.2):

java.lang.NullPointerException
at net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:125)

This is because the first thing the "doInit" method does is set initialized to true. So the second thread thinks initialization has happened, even though it is not finished yet.

I think the following change should fix the problem... assuming my analysis is correct.

1) change FilterToBeanProxy.doInit to a synchronized method
2) inside doInit, test if "initialized" is true before continuing.

thanks
sam

ps - simply refreshing my page moves past the problem... and changing my index page to be uncached makes the problem less likely.




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Home: http://acegisecurity.sourceforge.net
Acegisecurity-developer mailing list
Acegisecurity-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer

Reply via email to