OK, I found a solution. On Russian Hibernate news group someone helpfully posted those two lines:
permission java.lang.RuntimePermission "getProtectionDomain";
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
If you put that in your server.policy file (Sun/AppServer/domains/domain1/config, under grant { ... };) your Hibernate app should stop getting those errors.
Of course all the required libraries (jars) must be present (I put them in WEB-INF/lib, and both servlets and EJBs have access to them).
So this concludes my 3 day hunt for an answer. And here's a short quiz:
Given the following data:
If Hibernate is missing required libraries, it throws NoClassDefFoundError.
If Hibernate is missing permissions, it throws NoClassDefFoundError.
Figure out the correct answer to the following question:
If your app server catches on fire, Hibernate throws ... ?
Bratek
PS. Big thank you to the fellow who posted the correct answer on Russian forum.
|