Ameya
Ameya

Reputation: 1960

How to flush the authentication cache in JBoss EAP 7

We are migrating an application from JBoss 4.2.1.GA to JBoss EAP 7. We want this to flush authentication cache. The earlier application used the MBean "jboss.security:service=JaasSecurityManager" which isn't available in EAP7 JMX.

Some help needed.

Thank you. Regards,

Upvotes: 1

Views: 2172

Answers (2)

Sweta Patra
Sweta Patra

Reputation: 351

Try changing the cache type to infinispan and add auth cache expiration/eviction,you can use following Jboss-CLI commands: /subsystem=infinispan/cache-container=security:add() /subsystem=infinispan/cache-container=security/local-cache=auth-cache:add() /subsystem=infinispan/cache-container=security:write-attribute(name=default-cache, value=auth-cache) /subsystem=infinispan/cache-container=security/local-cache=auth-cache/expiration=EXPIRATION:add(lifespan=120000, max-idle=60000) /subsystem=infinispan/cache-container=security/local-cache=auth-cache/eviction=EVICTION:add(strategy=LRU, max-entries=1000) /subsystem=security/security-domain=exampleSecurityDomain:write-attribute(name=cache-type, value=infinispan)

Upvotes: 0

Markus Schulz
Markus Schulz

Reputation: 530

for the standalone mode only the JMX-Objectname has changed from EAP4/5 to EAP7... for domain mode you can't use the jmx subsystem. You need to call the jboss-cli (can be called programmatically too).

MBeanServerConnection mbeanServerConnection = ManagementFactory.getPlatformMBeanServer();
ObjectName mbeanName = new ObjectName("jboss.as:subsystem=security,security-domain=" + domain);
mbeanServerConnection.invoke(mbeanName, "flushCache", null, null);

you can use jconsole (or any other jmx-management tool) to explore other mbean signatures..

Upvotes: 1

Related Questions