1
votes

Does anyone know how to modify catalina.policy to eliminate this AccessControlException:

Feb 25, 2016 2:31:14 PM org.apache.tomee.catalina.ServerListener install

**SEVERE: TomEE Listener can't start OpenEJB**
java.security.AccessControlException: access denied (**"java.util.PropertyPermission" "tomee.skip-tomcat-log" "read"**)
    at 

java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) at java.security.AccessController.checkPermission(AccessController.java:884) at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1294) at java.lang.System.getProperty(System.java:717) at java.lang.Boolean.getBoolean(Boolean.java:254) at org.apache.tomee.TomEELogConfigurer.configureLogs(TomEELogConfigurer.java:30) at org.apache.tomee.catalina.ServerListener.install(ServerListener.java:170) at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:55) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110) at org.apache.catalina.startup.Catalina.load(Catalina.java:638) at org.apache.catalina.startup.Catalina.load(Catalina.java:663) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)

All I did was click on Enable Security in Eclipse and then restarted the server. Tomcat doesn't even have to load a web app to error out. Tomcat is launched from within Eclipse with the option: -Dwtp.configured.security=true

For the record: Server: Apache Tomcat (TomEE)/7.0.62 (1.7.2) Eclipse: Eclipse Java EE IDE Version: Mars.1 Release (4.5.1) Java: jdk 1.8.0_73

Enable Security checkbox checked in Eclipse on Server Overview page

Driving me cwazy...

1
Please do not post links as they may get corrupted in the future. Stackoverflow supports adding images ;)Vini.g.fer
Apparently I "need at least 10 reputation points to post an image." Hard to achieve in the first post, and a question at that.Tony

1 Answers

1
votes

I had the same issue and I think, there are two ways which I have discovered as a possible solution, only the first tried:

  1. especially for development purposes is useful to enable everything in catalina.policy, so put following code to the end of the file, then the error disappeared to me:

grant { permission java.security.AllPermission; };

  1. I looked into the source code where can be found the given permission and found there is following checking of the given property:

if (!Boolean.getBoolean("tomee.skip-tomcat-log")) { // do some log initialisation ... }

so, if you set the environment property "tomee.skip-tomcat-log" to "true" for the Tomcat, the property could be read and initialisation should not happen so the exception possibly could not be thrown...