This discussion is archived
1 Reply Latest reply: Sep 22, 2011 11:04 AM by 856147 RSS

Glassfish 3.1.1 and SocketPermission problem with JSPs

856147 Newbie
Currently Being Moderated
Hi folks. I hope this is the correct forum for this post. If not let me know and I'll repost in the appropriate one.

I have a legacy project originally done in pure JSP (with a couple of Servlets) that runs on IPlanet and makes rmi based server calls. My first phase is to port this over to glassfish 3.1.1 and, hopefully later, convert it to JSF w/some more current EJB based business end. I have the jsp's and servlets packaged as a single war and have it deployed on glassfish. I have a Login jsp which redirects to a servlet which sets up a new session, preloads the session with specific data and then forward to a 'menu' jsp page which loads your options based on a database. Note: BOTH the servlet and the menu jsp make rmi calls to the server. Here's the strange part - The servlet is successful in establishing the rmi connection and makes a couple of calls to the rmi to connect to the database and get the appropriate data to store into the session. Then it forwards you to the menu jsp. The menu jsp gets the reference to the rmi connection, as well as other data from the session and attempts to make rmi calls to gather your options for the menu. In this case I get a access denied ( connect,resolve) error. (Full Stack trace below)
Note: I have attempted to add the following to the server.policy file in my domain1 directory:
grant {
permission java.lang.RuntimePermission "";
permission java.util.PropertyPermission "*", "read, write";
permission "", "accept,connect,listen,resolve";     
I realize that this is WAY too open, however, this is day two and I've given up on finesse. At this point I just want to get it working. Then I'll clean it up.....

Still No Joy... So I then added the same entry into the java.policy file for my jdk thinking that maybe it was a java permission, not a glassfish permission. Same error.

The thing that really confuses me is that the Servlet works! and the JSP (which is really just another servlet) does not! Which leads me to believe it has something to do with classpaths or classloaders.

Please Help!! Any thoughts would be appreciated.

As promised - full stacktrace follows.

WARNING: StandardWrapperValve[EtalsMenuMgr]: PWC1406: Servlet.service() for servlet EtalsMenuMgr threw exception access denied ( connect,resolve)
     at java.lang.SecurityManager.checkPermission(
     at java.lang.SecurityManager.checkConnect(
     at sun.rmi.transport.tcp.TCPChannel.checkConnectPermission(
     at sun.rmi.transport.tcp.TCPChannel.newConnection(
     at sun.rmi.server.UnicastRef.invoke(
     at com.cust.rmi.ServerAppServantAdapter_Stub.getUpp(Unknown Source)
     at com.cust.rmi.ServerAppClientAdapter.getUpp(
     at org.apache.jsp.EtalsMenuMgr_jsp._jspService( from :487)
     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$



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