AuthzForce 更新策略失败

Posted

技术标签:

【中文标题】AuthzForce 更新策略失败【英文标题】:AuthzForce failed update policies 【发布时间】:2017-05-07 20:49:22 【问题描述】:

我正在为一个角色分配权限(仅访问 /resource1)。 但是 Keyrock 给我一个错误“无法更新访问控制 GE 中的策略”。

因此,即使我使用具有只能访问资源 1 的权限的访问令牌请求资源 2(不是资源 1),AuthzForce 也会允许访问,因为策略未更新(可能是其他问题)。

问题是为什么 authzforce 不能更新策略?

现在,我成功地将权限链接到角色(策略更新失败除外),并将角色分配给用户。然后我仔细检查了 Keyrock 和 AuthzForce 的配置。我认为它们之间的联系很好。

Error msg of Keyrock

What makes I think AuthzForce is working well (this is the Wilma's successful log when I send a access request to Wilma with the access token)

请参考上图,下图配置和环境。

// 'local_settings.py' in Keyrock
ACCESS_CONTROL_URL = 'http://127.0.0.1:8080'
ACCESS_CONTROL_MAGIC_KEY = 'abcdefghijkmn'

我的环境:

OS: Ubuntu 16.04
Keyrock: 5.4.0 (https://github.com/ging/fiware-idm)
AuthzForce: 7.0.0
Wilma: 5.4.0 (https://github.com/ging/fiware-pep-proxy)

安装 AuthzForce 5.4.1 时的错误日志 (/var/log/tomcat7/authzforce-ce/error.log)(我使用 AuthzForce 7.0.0 的原因)。我安装authzforce-5.4.1时使用了openjdk-7和tomcat7。

2017-05-09 07:10:47,087|ERROR|localhost-startStop-2|org.springframework.web.context.ContextLoader:324|Context initialization failed|
java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
    at org.apache.catalina.core.ApplicationContext.getInitParameterNames(ApplicationContext.java:368) ~[tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ApplicationContextFacade.getInitParameterNames(ApplicationContextFacade.java:367) ~[tomcat-catalina-7.0.68.jar:7.0.68]
    at org.springframework.web.context.support.WebApplicationContextUtils.registerEnvironmentBeans(WebApplicationContextUtils.java:201) ~[spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.postProcessBeanFactory(AbstractRefreshableWebApplicationContext.java:169) ~[spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:458) ~[spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) ~[spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) ~[spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1962) [tomcat-catalina-7.0.68.jar:7.0.68]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_95]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_95]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_95]
2017-05-09 07:10:47,103|WARN |localhost-startStop-2|org.springframework.web.context.support.XmlWebApplicationContext:1052|Exception thrown from ApplicationListener handling ContextClosedEvent|
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Tue May 09 07:10:46 GMT-08:00 2017]; root of context hierarchy
    at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:347) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1049) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:558) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5115) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5779) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1962) [tomcat-catalina-7.0.68.jar:7.0.68]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_95]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_95]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_95]
2017-05-09 07:10:47,104|WARN |localhost-startStop-2|org.springframework.web.context.support.XmlWebApplicationContext:1060|Exception thrown from LifecycleProcessor on context close|
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Tue May 09 07:10:46 GMT-08:00 2017]; root of context hierarchy
    at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:558) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5115) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5779) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1962) [tomcat-catalina-7.0.68.jar:7.0.68]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_95]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_95]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_95]
2017-05-09 07:11:46,095|ERROR|localhost-startStop-1|org.springframework.web.context.ContextLoader:324|Context initialization failed|
java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
    at org.apache.catalina.core.ApplicationContext.getInitParameterNames(ApplicationContext.java:368) ~[tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ApplicationContextFacade.getInitParameterNames(ApplicationContextFacade.java:367) ~[tomcat-catalina-7.0.68.jar:7.0.68]
    at org.springframework.web.context.support.WebApplicationContextUtils.registerEnvironmentBeans(WebApplicationContextUtils.java:201) ~[spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.postProcessBeanFactory(AbstractRefreshableWebApplicationContext.java:169) ~[spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:458) ~[spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) ~[spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) ~[spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1962) [tomcat-catalina-7.0.68.jar:7.0.68]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_95]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_95]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_95]
2017-05-09 07:11:46,112|WARN |localhost-startStop-1|org.springframework.web.context.support.XmlWebApplicationContext:1052|Exception thrown from ApplicationListener handling ContextClosedEvent|
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Tue May 09 07:11:45 GMT-08:00 2017]; root of context hierarchy
    at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:347) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1049) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:558) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5115) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5779) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1962) [tomcat-catalina-7.0.68.jar:7.0.68]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_95]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_95]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_95]
2017-05-09 07:11:46,113|WARN |localhost-startStop-1|org.springframework.web.context.support.XmlWebApplicationContext:1060|Exception thrown from LifecycleProcessor on context close|
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Tue May 09 07:11:45 GMT-08:00 2017]; root of context hierarchy
    at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:558) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5115) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5779) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1962) [tomcat-catalina-7.0.68.jar:7.0.68]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_95]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_95]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_95]
2017-05-09 07:12:05,523|ERROR|localhost-startStop-1|org.springframework.web.context.ContextLoader:324|Context initialization failed|
java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
    at org.apache.catalina.core.ApplicationContext.getInitParameterNames(ApplicationContext.java:368) ~[tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ApplicationContextFacade.getInitParameterNames(ApplicationContextFacade.java:367) ~[tomcat-catalina-7.0.68.jar:7.0.68]
    at org.springframework.web.context.support.WebApplicationContextUtils.registerEnvironmentBeans(WebApplicationContextUtils.java:201) ~[spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.postProcessBeanFactory(AbstractRefreshableWebApplicationContext.java:169) ~[spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:458) ~[spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) ~[spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) ~[spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1962) [tomcat-catalina-7.0.68.jar:7.0.68]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_95]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_95]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_95]
2017-05-09 07:12:05,549|WARN |localhost-startStop-1|org.springframework.web.context.support.XmlWebApplicationContext:1052|Exception thrown from ApplicationListener handling ContextClosedEvent|
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Tue May 09 07:12:05 GMT-08:00 2017]; root of context hierarchy
    at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:347) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1049) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:558) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5115) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5779) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1962) [tomcat-catalina-7.0.68.jar:7.0.68]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_95]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_95]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_95]
2017-05-09 07:12:05,550|WARN |localhost-startStop-1|org.springframework.web.context.support.XmlWebApplicationContext:1060|Exception thrown from LifecycleProcessor on context close|
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Tue May 09 07:12:05 GMT-08:00 2017]; root of context hierarchy
    at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:558) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5115) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5779) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677) [tomcat-catalina-7.0.68.jar:7.0.68]
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1962) [tomcat-catalina-7.0.68.jar:7.0.68]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_95]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_95]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_95]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_95]

【问题讨论】:

您正在测试哪些版本的 KeyRock、AuthzForce 和 Wilma? 我使用的是最新版本。 Keyrock 是 5.3.0(我检查了 ChangeLog 文件。我使用的是 hub.docker.com/r/ging/fiware-idm 的代码),AuthzForce 是 7.0.0,Wilma 版本我不知道,但我使用了 github.com/ging/fiware-pep-proxy 的代码。 今天的最新版本应该是KeyRock v5.4.1。可以更新吗?不过,我不是 KeyRock(但 AuthzForce)的所有者,所以我会邀请 KeyRock 的所有者来帮助解决这个问题。对于 Wilma,您应该在 github 上查看标签 5.4(最新版本 5.4)。对于 AuthzForce,KeyRock 和 Wilma 已经正式使用 AuthzForce 5.4.1 进行了测试。我们可以尝试使用 7.0.0 来完成这项工作,但可能需要更多的努力。 我正在根据您的建议更改版本,但 AuthzForce 5.4.1 未在 tomcat 上成功部署(当我请求 localhost:8080/authzforce-ce/domains 时出现 404 错误)。日志文件中有很多错误。我应该用 Ubuntu 14.04 安装它吗?我正在使用 Ubuntu 16.04、openjdk-7 和 tomcat7。无论如何,为了您的参考,我将在我的问题中更新“/var/log/tomcat7/authzforce-ce/error.log”的错误。而且我找不到 Keyrock 5.4.1,所以我只是将 github.com/ging/fiware-idm 安装到我的新环境中。感谢您的帮助@CyrilDangerville。 我没有注意到您使用的是 Ubuntu 16.04。事实上,AuthzForce 5.4.1 在 Ubuntu 16.04 上受支持。所以现在让我们在 Ubuntu 16.04 上坚持使用 AuthzForce 7.0.0。对于 KeyRock,正确的 git repo 是 github.com/ging/horizon(如安装指南中所述 - fiware-idm.readthedocs.io/en/latest/…)。您可以从那里获得 5.4.1 版本。 (据我所知,FIWARE 目录和 Docker 页面上给出的 github 链接 - github.com/ging/fiware-idm 已过时。在他们的新 github 上报告此问题可能是个好主意。) 【参考方案1】:

好的,所以解决方案是升级到 KeyRock 5.4.1。

【讨论】:

以上是关于AuthzForce 更新策略失败的主要内容,如果未能解决你的问题,请参考以下文章

Authzforce - 用于策略管理 (PAP) 的现有 GUI

XACML Authzforce PDP 自定义策略

#yyds干货盘点#组策略更新失败:windows无法定位目录对象...

AuthZForce PDP 未按预期运行

redis缓存更新策略

是否有使用 MongoDB 进行 Authzforce 的 DomainDAO 实现?