如何刷新JBoss EAP 7中的身份验证缓存

如何刷新JBoss EAP 7中的身份验证缓存,jboss,jboss-eap-7,Jboss,Jboss Eap 7,我们正在将一个应用程序从JBoss 4.2.1.GA迁移到JBoss EAP 7。 我们想让它刷新身份验证缓存。早期的应用程序使用MBean“jboss.security:service=JaasSecurityManager”,这在EAP7 JMX中不可用 需要一些帮助 多谢各位。 关于,对于独立模式,只有JMX对象名已从EAP4/5更改为EAP7。。。 对于域模式,不能使用jmx子系统。您需要调用jboss cli(也可以通过编程方式调用) 您可以使用jconsole(或任何其他jmx管理工

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

需要一些帮助

多谢各位。
关于,

对于独立模式,只有JMX对象名已从EAP4/5更改为EAP7。。。 对于域模式,不能使用jmx子系统。您需要调用jboss cli(也可以通过编程方式调用)


您可以使用jconsole(或任何其他jmx管理工具)浏览其他mbean签名。

尝试将缓存类型更改为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属性(name=default cache,value=auth cache)
/subsystem=infinispan/cache container=security/local cache=auth cache/expiration=expiration:add(寿命=120000,最大空闲=60000)
/subsystem=infinispan/cache container=security/local cache=auth cache/execution=execution:add(strategy=LRU,max entries=1000)

/subsystem=security/security domain=exampleSecurityDomain:write属性(name=cache type,value=infinispan)

1.登录jmx控制台:2.向下滚动并找到此域:jboss.security 3.单击MBean:service=JaasSecurityManager 4.向下滚动并调用此方法:void flushAuthenticationCache()如果要以编程方式刷新整个缓存,请使用以下代码:MBeanServer server=MBeanServerLocator.locateJBoss();字符串jaasMgrName=“jboss.security:service=JaasSecurityManager”;ObjectName jaasMgr=新的ObjectName(jaasMgrName);字符串domainName=“name”//例如,“jmx控制台”对象[]参数={domainName};String[]签名={String.class.getName()};调用(jaasMgr,“FlushaAuthenticationCache”,参数,签名);要从缓存中仅删除一个用户条目,请使用以下代码:MBeanServer server=MBeanServerLocator.locateJBoss();字符串jaasMgrName=“jboss.security:service=JaasSecurityManager”;ObjectName jaasMgr=新的ObjectName(jaasMgrName);字符串domainName=“name”//例如,“jmx控制台”主体用户=新的SimplePrincipal(“用户名”);对象[]参数={domainName,user};String[]签名={String.class.getName(),


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