1

我们正在将应用程序从 JBoss 4.2.1.GA 迁移到 JBoss EAP 7。我们希望它刷新身份验证缓存。早期的应用程序使用了 EAP7 JMX 中不可用的 MBean“jboss.security:service=JaasSecurityManager”。

需要一些帮助。

谢谢你。问候,

4

2 回答 2

1

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..

于 2018-08-20T06:22:40.413 回答
0

尝试将缓存类型更改为 infinispan 并添加身份验证缓存过期/驱逐,您可以使用以下 Jboss-CLI 命令: /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)

于 2018-08-21T10:54:26.173 回答