gpt4 book ai didi

java - 如何在 Glassfish 中授予该权限

转载 作者:行者123 更新时间:2023-12-01 05:25:17 25 4
gpt4 key购买 nike

在我的 Glassfish 服务器上,我最近启用了安全管理器。一旦我这样做了,neo4j-JCA connector我使用已停止工作,提示该异常:

Caused by: java.security.AccessControlException: access denied (java.lang.management.ManagementPermission monitor)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at sun.management.ManagementFactory.checkAccess(ManagementFactory.java:223)
at sun.management.ManagementFactory.checkMonitorAccess(ManagementFactory.java:228)
at sun.management.RuntimeImpl.getBootClassPath(RuntimeImpl.java:89)
at org.neo4j.kernel.ConfigurationLogging.logConfig(ConfigurationLogging.java:91)
at org.neo4j.kernel.GraphDbInstance.start(GraphDbInstance.java:166)
at org.neo4j.kernel.EmbeddedGraphDbImpl.<init>(EmbeddedGraphDbImpl.java:190)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:80)
at com.netoprise.neo4j.Neo4jManagedConnectionFactory.createDatabase(Neo4jManagedConnectionFactory.java:278)
at com.netoprise.neo4j.Neo4jManagedConnectionFactory.createManagedConnection(Neo4jManagedConnectionFactory.java:154)
at com.sun.enterprise.resource.allocator.ConnectorAllocator.createResource(ConnectorAllocator.java:160)
at com.sun.enterprise.resource.pool.ConnectionPool.createSingleResource(ConnectionPool.java:907)
... 74 more

我知道我必须在我的 server.policy 中写一些东西,但是什么?我已经尝试过了

//Neo4J management permission for logging
grant codeBase "file:${com.sun.aas.installRoot}/neo4j-connector-0.3-SNAPSHOT/-"{
permission java.lang.management.ManagementPermission "monitor";
};

完全没有效果。那么我应该使用什么语法? (注意 neo4j-connector-0.3-SNAPSHOT 是 Neo4J 的 JCA 连接器的名称

最佳答案

尝试将权限放入 JCA 描述 rune 件 ra.xml 中。这是 example :

        <security-permission>
<security-permission-spec> permission java.io.FilePermission
"/tmp/db/fs_store/*", "read,write";
</security-permission-spec>
</security-permission>

关于java - 如何在 Glassfish 中授予该权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9774543/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com