I have the same problem with another package: cgi instead of ssi. I will go through a solution that, as I found, overcome the error.
As with the OP, I had a clean install of Tomcat 7.0.27. I tested CGI. While working on the initial setup, I kept getting the following:
SEVERE: Servlet /TestTomcatApp threw load() exception java.lang.SecurityException: Restricted class org.apache.catalina.servlets.CGIServlet at org.apache.catalina.core.DefaultInstanceManager.checkAccess(DefaultInstanceManager.java:548 )
which is pretty much identical to OP, except for the class involved.
I searched for "Tomcat Restricted DefaultInstanceManager" and found [this java source code] [1]:
private void [More ...] checkAccess(Class<?> clazz, Properties restricted) { while (clazz != null) { if ("restricted".equals(restricted.getProperty(clazz.getName()))) { throw new SecurityException("Restricted class" + clazz); } clazz = clazz.getSuperclass(); } }
The Properties class (which can be linked to a link to a code page with a hot link) showed that the code most likely reads the .properties file. Thus, I was able to reset the catalines .properties and catalina.policy. After carefully reading the documentation in these two files, as well as the link to the [Tomcat SecurityManager Doc] [2], I realized that I had to add the grant statement to the catalina.policy file:
// The Manager application needs access to the following packages to support the // session display functionality. These settings support the following // configurations: // - default CATALINA_HOME == CATALINA_BASE // - CATALINA_HOME != CATALINA_BASE, per instance Manager in CATALINA_BASE // - CATALINA_HOME != CATALINA_BASE, shared Manager in CATALINA_HOME grant codeBase "file:${catalina.base}/webapps/manager/-" { permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util"; **permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.servlets.CGIServlet";** }; grant codeBase "file:${catalina.home}/webapps/manager/-" { permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util"; **permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.servlets.CGIServlet"; };**
(My uploads are in bold)
After restarting Tomcat, the error disappeared.
NOTE. I realized that this whole problem should be caused by security issues with certain modules on Tomcat. My use is intended solely for testing on a single machine, and production is not expected in this mode.
[1] http://grepcode.com/file/repo1.maven.org/maven2/org.apache.tomcat/tomcat-catalina/7.0.0/org/apache/catalina/core/DefaultInstanceManager.java#DefaultInstanceManager.checkAccess % 28java.lang.Class% 29
[2] http://tomcat.apache.org/tomcat-7.0-doc/security-manager-howto.html#Configuring_Tomcat_With_A_SecurityManager