为什么我得到java.util.PropertyPermission faces.PROJECT_STAGE的AccessControlException?

时间:2012-11-16 17:11:26

标签: java security tomcat

我正在尝试部署MyFaces应用程序,启用了Tomcat安全性(因为我的主机需要它),但是当我在本地部署测试它时,我收到此错误。

我尝试过添加

permission java.lang.PropertyPermission "faces.PROJECT_STAGE", "read";

然后

permission java.lang.PropertyPermission "javax.faces.PROJECT_STAGE", "read";

到我的catalina.policy文件,但都没有任何影响。

有人可以告诉我如何解决这个问题吗?

谢谢, 尼尔

下面的完整堆栈跟踪:

SEVERE: An error occured while initializing MyFaces: access denied (java.util.PropertyPermission faces.PROJECT_STAGE read)
java.security.AccessControlException: access denied (java.util.PropertyPermission faces.PROJECT_STAGE read)
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
        at java.security.AccessController.checkPermission(AccessController.java:546)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
        at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)
        at java.lang.System.getProperty(System.java:650)
        at org.apache.myfaces.application.ApplicationImpl.getProjectStage(ApplicationImpl.java:757)
        at javax.faces.context.FacesContext.isProjectStage(FacesContext.java:411)
        at org.apache.myfaces.config.FacesConfigurator.configureLifecycle(FacesConfigurator.java:978)
        at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:429)
        at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:370)
        at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:73)
        at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:143)
        at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:119)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
        at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:124)
        at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:146)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:777)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1315)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
        at org.apache.catalina.core.StandardService.start(StandardService.java:525)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

0 个答案:

没有答案