I am having tons of SecurityManager problems, too. My configuration is Hibernate 3 latest stable (core is 3.3.1.GA), Tomcat 6.0.18, Sun JDK 1.6.0_10-b33, on Ubuntu 8.10.
I get things like this:
Quote:
javax.servlet.ServletException: org/hibernate/exception/ExceptionUtils
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:294)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:115)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:619)
root cause:
java.lang.NoClassDefFoundError: org/hibernate/exception/ExceptionUtils
org.hibernate.exception.NestableDelegate.printStackTrace(NestableDelegate.java:325)
org.hibernate.exception.NestableRuntimeException.printStackTrace(NestableRuntimeException.java:195)
java.util.logging.SimpleFormatter.format(SimpleFormatter.java:72)
org.apache.juli.FileHandler.publish(FileHandler.java:129)
java.util.logging.Logger.log(Logger.java:472)
java.util.logging.Logger.doLog(Logger.java:494)
java.util.logging.Logger.logp(Logger.java:694)
org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:167)
org.apache.juli.logging.DirectJDKLog.warn(DirectJDKLog.java:127)
org.apache.naming.NamingContext.lookup(NamingContext.java:803)
org.apache.naming.NamingContext.lookup(NamingContext.java:140)
org.apache.naming.NamingContext.lookup(NamingContext.java:781)
org.apache.naming.NamingContext.lookup(NamingContext.java:140)
org.apache.naming.NamingContext.lookup(NamingContext.java:781)
org.apache.naming.NamingContext.lookup(NamingContext.java:140)
org.apache.naming.NamingContext.lookup(NamingContext.java:781)
org.apache.naming.NamingContext.lookup(NamingContext.java:153)
org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
...
Thus far I have been unable to get around them by setting appropriate tomcat policies ... even down to the point of setting java.security.AllPermissions.
When I started out, I had some pretty basic things to fix. By reading as much documentation as I could I figured out I needed:
Quote:
permission java.lang.RuntimePermission "getClassLoader";
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.coyote";
permission java.lang.RuntimePermission "accessDeclaredMembers";
permission java.io.FilePermission "${catalina.base}/webapps/mywebapp/WEB-INF/hibernate.cfg.xml", "read";
I guess a more fundamental question is this ... what exactly is this ExceptionUtils trying to tell me? What it seems to really be doing is hiding from me the real cause. It's possibly I just don't know how to read the exception trace it's delivering. The funny part is that usually when tomcat gives up in a NoClassDefFoundError it's because the SecurityManager blocked something, and usually it's pretty explicit about telling me exactly what permission it needs. This time I have been unable to follow it.