2012-03-19 83 views
1

在我的Glassfish服務器上,我最近啓用了安全管理器。當我這樣做,我用的是neo4j-JCA connector已停止工作,與異常抱怨:如何在Glassfish中允許該權限

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是JCA連接器的Neo4j

的名字

回答

0

嘗試把權限在JCA描述符文件中的ra.xml下面是一個example

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

這是正常的你添加的FilePermission時Glassfish的抱怨一ManagementPermission? – Riduidel 2012-03-23 15:54:42

+0

這只是一個例子,添加適配器所需的正確權限。 – 2012-03-23 18:02:38

相關問題