On 2/17/06, Allen Gilliland <[EMAIL PROTECTED]> wrote: > On Fri, 2006-02-17 at 15:06, Jeff Blattman wrote: > > this is in regard to the AAPP addition i am working on, that allows > > users and weblogs to be removed via HTTP deletes ... > > > > i am experiencing some strange behavior from the roller web app after > > deleting users and weblogs. after deleting a user (though AAPP), i get > > an exception if i try to login again: > > > > java.lang.NullPointerException > > > > org.roller.presentation.filters.MainPageCacheFilter.doFilter(MainPageCacheFilter.java:156) > > > > org.roller.presentation.filters.PersistenceSessionFilter.doFilter(PersistenceSessionFilter.java:43) > > > > > > after this exception, the server is dead and any request gives me the > > above exception. if i manually remove my cookie for web container, > > everything clears up. > > this is an Acegi bug of some sort. something gets saved in your session and > Acegi apparently tries to use it without checking if it's null. i'm not sure > what the proper resolution to this would be, maybe somehow trigger a logout > after delete a user?
Not so much a bug, but more of a feature. ;-) Acegi has a "userCache" that keeps the user cached. We need to update (or expire) this when a user's record is updated. In AppFuse, we do this with an AOP interceptor after the saveUser() method executes. http://fisheye5.cenqua.com/viewrep/~raw,r=1.6/appfuse/src/service/org/appfuse/service/UserSecurityAdvice.java http://tinyurl.com/bfdf9 Removing the "userCache" from the daoAuthenticationProvider bean is another solution. <bean id="daoAuthenticationProvider" class="net.sf.acegisecurity.providers.dao.DaoAuthenticationProvider"> <property name="authenticationDao" ref="jdbcAuthenticationDao"/> <!--property name="userCache" ref="userCache"/--> </bean> Matt > > > > > also, after removing a weblog, i still see the weblog and entries for > > that weblog on the front page. clicking on them gives me an error page > > ... but it would be nice to have them disappear immediately. > > yep, that would be important. > > > > > i assume this is because i need to clear out some caches somewhere. any > > pointers on the correct way to do this? > > it's pretty simple actually. there are a variety of invalidate() methods > that are part of the CacheManager class which controls the presentation level > cache. when you have an object that has been changed and you want to notify > the caches then simply call CacheManager.invalidate(object). > > it's fine to pass in an object you just deleted, this is how things work when > an entry, category, etc, is deleted. > > -- Allen > > > > > thanks. > >
