Menu

ubuntu tomcat6 AccessControlException

Help
2010-06-24
2013-06-12
  • Brad Clements

    Brad Clements - 2010-06-24

    even though I created a new file in /etc/tomcat6/policy.d and added the recommended grant commands, they do not seem to get applied to the track application file (I haven't yet installed events or mologogo). I did verify that the grant commands are ending up in /var/lib/tomcat6/work/catalina.policy and I have restarted tomcat

    my policy file  has:

    grant codeBase "file:${catalina.home}/webapps/track/WEB-INF/-" {
       permission java.lang.RuntimePermission "getenv.*";
       permission java.util.PropertyPermission "*", "read,write";
       permission java.security.AllPermission;
    };
    

    (plus the events and mologogo) grants.

    I temporarily commented out System.setProperty("sun.net.client.defaultConnectTimeout", timeout) and System.setProperty("sun.net.client.defaultReadTimeout", timeout); in RTConfig.java just to move along, but it still fails on getenv:

    Jun 23, 2010 2:33:04 PM org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Exception sending context initialized event to listener instance of class org.opengts.war.tools.RTConfigContextListener
    java.security.AccessControlException: access denied (java.lang.RuntimePermission getenv.GTS_HOME)
            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.System.getenv(System.java:827)
            at org.opengts.db.DCServerFactory._startupInit(DCServerFactory.java:899)

    The only way I can get track to run is to entirely disable the security manager for tomcat6, I don't want to do that.

    Can someone tell me what I'm doing wrong?

    Thanks

     
  • Martin Flynn

    Martin Flynn - 2010-06-25

    Hello,

    Section 2.2 of the OpenGTS_Config.pdf document does address some permission issues for the Debian/Ubuntu pre-installed version of Tomcat.  However, it may be out-of-date with the latest Debian/Ubuntu releases.  Let me know if you are able to resolve this and I will update the documentation..

    Thank you very much.
    - Martin

     
  • Martin Flynn

    Martin Flynn - 2010-06-25

    Sorry, I meant "Section 2.1.c" of OpenGTS_Config.pdf

     
  • Brad Clements

    Brad Clements - 2010-06-26

    I had already copied and pasted the required policy settings right out of the OpenGTS_Config.pdf file

    I also had added the getenv.* part (found elsewhere via google), see my original post for the grant statement I am using.

    There must be something else up with how tomcat6 is compiled for ubuntu. Perhaps it doesn't like the the grant codeBase argument.

    I'll have to keep chipping away on it.

    Thanks for the reply.

     

Log in to post a comment.