关闭

java.security.AccessControlException: access denied (java.util.PropertyPermi

4321人阅读 评论(0) 收藏 举报
分类:
重新把项目导入到新电脑的环境中!启动TOMCAT时报出:
java.security.AccessControlException: access denied (java.util.PropertyPermission LOG_INI write)
 at java.security.AccessControlContext.checkPermission(Unknown Source)
 at java.security.AccessController.checkPermission(Unknown Source)
 at java.lang.SecurityManager.checkPermission(Unknown Source)
 at java.lang.System.setProperty(Unknown Source)
 at com.ebs.manage.front.mainGateServlet.init(mainGateServlet.java:50)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
 at java.security.AccessController.doPrivileged(Native Method)
 at javax.security.auth.Subject.doAsPrivileged(Unknown Source)
 at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
 at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
 at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:115)
 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1133)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
 at org.apache.catalina.core.StandardService.start(StandardService.java:448)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)

解决办法:在D:\Program Files\jdk6\jre\lib\security\java.policy中加入如下文红色标记就解决了


// Standard extensions get all permissions by default



grant codeBase "file:${{java.ext.dirs}}/*" {
permission java.security.AllPermission;
};


// default permissions granted to all domains


grant { 
// Allows any thread to stop itself using the java.lang.Thread.stop()
// method that takes no argument.
// Note that this permission is granted by default only to remain
// backwards compatible.
// It is strongly recommended that you either remove this permission
// from this policy file or further restrict it to code sources
// that you specify, because Thread.stop() is potentially unsafe.
// See the API specification of java.lang.Thread.stop() for more
        // information.
permission java.lang.RuntimePermission "stopThread";


// allows anyone to listen on un-privileged ports
permission java.net.SocketPermission "localhost:1024-", "listen";


// "standard" properies that can be read by anyone


permission java.util.PropertyPermission "java.version", "read";
permission java.util.PropertyPermission "java.vendor", "read";
permission java.util.PropertyPermission "java.vendor.url", "read";
permission java.util.PropertyPermission "java.class.version", "read";
permission java.util.PropertyPermission "os.name", "read";
permission java.util.PropertyPermission "os.version", "read";
permission java.util.PropertyPermission "os.arch", "read";
permission java.util.PropertyPermission "file.separator", "read";
permission java.util.PropertyPermission "path.separator", "read";
permission java.util.PropertyPermission "line.separator", "read";


permission java.util.PropertyPermission "java.specification.version", "read";
permission java.util.PropertyPermission "java.specification.vendor", "read";
permission java.util.PropertyPermission "java.specification.name", "read";


permission java.util.PropertyPermission "java.vm.specification.version", "read";
permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
permission java.util.PropertyPermission "java.vm.specification.name", "read";
permission java.util.PropertyPermission "java.vm.version", "read";
permission java.util.PropertyPermission "java.vm.vendor", "read";
permission java.util.PropertyPermission "java.vm.name", "read";
permission java.security.AllPermission;
};

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:406946次
    • 积分:3103
    • 等级:
    • 排名:第11100名
    • 原创:46篇
    • 转载:61篇
    • 译文:0篇
    • 评论:40条
    最新评论