1 Reply Latest reply: Sep 13, 2011 3:53 PM by rlutz RSS

Force JBoss to refresh cache

rlutz Newbie

Hey all, we're running JBoss 2.4.2, and I just finished up working on a simple little password reset system for our portal. Use case is basically

user gives email -> user receives email with session key and clicks it -> user inputs new password. I'm just updating the jbp_users table via JDBC (md5sum'ing their new password and inserting it in the table), and I can verify that the new hash is correct, but JBoss Portal seems to be caching the old login info.


My question is, can I force JBoss to forget its cached logins and recheck the database for changes, or is there a better way to do this? This isn't running inside a portlet, so I can't juse use getPortletContext().getAttribute("UserModule") to find a user by username and update their password that way.


Anyway, I'm sure I'm doing it wrong, but any help would be greatly appreciated. Thanks so much!

  • 1. Re: Force JBoss to refresh cache
    rlutz Newbie

    I tried changing jboss-service.xml to change the DefaultCacheTimeout to 0 from 1800, and also tried

    String domain = "jmx-console";
    ObjectName jaasMgr = new ObjectName("jboss.security:service=JaasSecurityManager");
    Object[] params = {domain};
    String[] signature = {"java.lang.String"};
    MBeanServer server = (MBeanServer) MBeanServerFactory.findMBeanServer(null).get(0);
    server.invoke(jaasMgr, "flushAuthenticationCache", params, signature);

    I also tried flushing the authenticationCache through the JMX web console, and that didn't seem to work either.


    I can verify that the new password hash is being inserted in the database properly, but JBoss doesn't seem to want to check for the new hash?


    I'm stumped