This discussion is archived
1 Reply Latest reply: Oct 5, 2011 11:27 AM by 856328 RSS

GF 3.1.1 - access denied - server.log

856328 Newbie
Currently Being Moderated
I am upgrading an old NB4.1 produced JSP system that runs on Netscape iplanet to NB7.0.1 built JSP system running on Glassfish 3.1.1. I have four main files: login.html, login.jsp, ApplicationRmiConnection, and MenuManager.jsp . Three of four are working. The login.html is only a startup means to be sent to the login.jsp. The ApplicationRmiConnection is a servlet called by the login.jsp. It reads a properties file, establishes connection with the RMI and database (currently on the OLD system (Netscape iplanet)) which it does quite well. After the ApplicationRmiConnection is established and working the MenuManager.jsp . The first output from the MenuManager.jsp is a series of application.log calls for verification of data passed in from the successful ApplicationRmiConnection database read.

How does GF 3.1.1 loose AccessControl permissions to the server.log to which it is writing? All I am using is application.log statements and it coughs, chokes, and quits.

My output stacktrace is:

INFO: PWC1412: WebModule[null] ServletContext.log():ApplicationRmiConnect: getRealPath("/") = [C:\Program Files\glassfish\glassfish-3.1\glassfish\domains\domain1\applications\MyApplication\]
INFO: PWC1412: WebModule[null] ServletContext.log():MenuMgr: sParms - RMI Connect =
INFO: PWC1412: WebModule[null] ServletContext.log():MenuMgr: caught an Exception
WARNING: StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception access denied ( C:\Program Files\glassfish\glassfish-3.1\glassfish\domains\domain1\logs\server.log read)
at java.lang.SecurityManager.checkPermission(
at java.lang.SecurityManager.checkRead(
at com.sun.enterprise.server.logging.GFFileHandler.publish(
at java.util.logging.Logger.log(
at com.sun.logging.LogDomains$1.log(
at java.util.logging.Logger.doLog(
at java.util.logging.Logger.logp(
at com.sun.enterprise.web.logger.IASLogger.write(
at com.sun.enterprise.web.logger.LoggerBase.log(
at com.sun.enterprise.web.logger.IASLogger.log(
at org.apache.catalina.core.StandardContext.log(
at org.apache.catalina.core.ApplicationContext.log(
at org.apache.catalina.core.ApplicationContextFacade.log(
at org.apache.jsp.MenuMgr_jsp._jspService( from :533)
at org.apache.jasper.runtime.HttpJspBase.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.jasper.servlet.JspServletWrapper.service(
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
at org.apache.jasper.servlet.JspServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.StandardWrapper.service(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardPipeline.doInvoke(
at org.apache.catalina.core.StandardPipeline.invoke(
at com.sun.enterprise.web.WebPipeline.invoke(
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.doService(
at org.apache.catalina.connector.CoyoteAdapter.service(
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(
at com.sun.grizzly.http.ProcessorTask.doProcess(
at com.sun.grizzly.http.ProcessorTask.process(
at com.sun.grizzly.http.DefaultProtocolFilter.execute(
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(
at com.sun.grizzly.DefaultProtocolChain.execute(
at com.sun.grizzly.DefaultProtocolChain.execute(
at com.sun.grizzly.http.HttpProtocolChain.execute(
at com.sun.grizzly.ProtocolChainContextTask.doCall(
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(
at com.sun.grizzly.util.AbstractThreadPool$
  • 1. Re: GF 3.1.1 - access denied - server.log
    856328 Newbie
    Currently Being Moderated
    The problem area has been found. We need to know the best method to replace the two lines of code we commented out. Here is what we found.

    Glassfish 3.1.1 Security does not play well with old RMI security (JDK1.2 vintage). Furthermore, once the old RMI security has messed with the mind of GF3.1.1 security the GF security truly believes it has in some cases no permission to read its own server.log file.

    Here is the offending code commented out in the Server Client Adapter (client wrapper):

    Note: this is legacy rmi code. i.e. manually executed rmic on the appropriate classfiles as this was originally created for java 1.2.

    // if(System.getSecurityManager() == null)
    // System.setSecurityManager(new RMISecurityManager());

    remote = (com.davisco.rmi.ServerAppServantAdapter_Stub)Naming.lookup(stringbuffer.toString());

    A thank you goes out to even if it is five years old.

    Again, this is using the original version of RMI. How do we re-implement the RMI Security Manager without offending GF 3.1.1 security?


  • Correct Answers - 10 points
  • Helpful Answers - 5 points