We have been fighting this issue for a couple of days. Searching the
forums, etc. provided no clear answers or GF documentation. I am not saying
I didn't miss something, but any help would be appreciated.
I am working with Netbeans 7.0.1 and Glassfish 3.1.1. I am bringing an
old product of many JSPs into the GF 3.1.1 realm and out of necessity it must
remain a JSP project (for now). After working hard to combine these into
one NB 7.0.1 project I build the project and deploy it.
PROBLEM 1:
After wringing out a few bugs I started getting a "security exception: access
denied" error. This appears to happen when the Libraries I have included
in the Netbeans project properties cannot be accessed. My login page comes
up fine, but the Menu manager page it goes to tries to access (read) one of
the programs in one of the library jar files. I receive the following error:
WARNING: WebappClassLoader.findClassInternal(com.company.utils.Utils)
security exception: access denied (java.io.FilePermission C:\Program
Files\glassfish\glassfish-3.1\glassfish\domains\domain1\applications\CompanyApplication\WEB-INF\classes\com\company\utils\Utils.class
read)
java.security.AccessControlException: access denied (java.io.FilePermission
C:\Program
Files\glassfish\glassfish-3.1\glassfish\domains\domain1\applications\CompanyApplication\WEB-INF\classes\com\company\utils\Utils.class
read)
The 'com\company\utils\Utils.class' is actually in one of the library jar
files the Netbeans packaged into the WEB-INF\lib directory. It is not one
of the java files in the NB src\java directory that is deployed compliled in
the WEB-INF\classes directory. Though it is not an EJB I tried copying the
files in the deployed application WEB-INF\lib directory into the
application\lib\applibs directory. I then put the library names in the
Deploy Libraries entry when doing a clean deploy (undeploy/deploy) of the
application. This generated diffferent errors. Then when I did another
clean deploy and GF 3.1.1 actually let me get to the next JSP. I think
GF was embarassed that it actually let it through because I have never
gotten beyond my login page again.
We even tried without success adding the following in the security.policy
file:
// permissions for Company Application Library Jar files
grant codeBase "file:${com.sun.aas.instanceRoot}/applications/-" {
permission java.io.FilePermission "<<ALL FILES>>", "read";
};
PROBLEM 2 - Even more frustrating
After getting the error mentioned in PROBLEM 1 I then get the following
error:
WARNING: StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet
jsp threw exception
java.security.AccessControlException: access denied (java.io.FilePermission
C:\Program
Files\glassfish\glassfish-3.1\glassfish\domains\domain1\logs\server.log read)
GLASSFISH CAN NO LONGER READ FROM THE server.log
IT IS WRITING TOO!!!! Even worse is that if I try to run another
JSP based project it gets the same server.log error. If I try to redeploy
or do a clean deploy of my main JSP project it also fails immediately with a
java.security.AccessControlException. I cannot get rid of this
AccessControlException until I completely stop Glassfish and start it again.
This means that in a production environment that may have several
applications, EJBs, whatever deployed will have to be shutdown completely
because the JSP based project cannot simply be redeployed. That means that
all other JSP based projects will quit working when the first
AccessControlException takes place.
For PROBLEM 1 or PROBLEM 2 if I have missed some pertinent documentation
please point me to it. If there is some work around, some setup issues, or
even for PROBLEM 2 away to clean out the AccessControlException cache
without having to restart GLASSFISH please help me. Thank you.
--
[Message sent by forum member 'rdblaha1']
View Post: http://forums.java.net/node/841336