0 Replies Latest reply: Mar 8, 2007 5:00 AM by 807574 RSS

    AccessControl Exception when invoking remote ejb from portlet class

    807574
      Hi,

      From Portlet class, I am invoking Remote EJB which is deployed in weblogic application server.

      After EJB call it not requst Dispathcer not allowed to include the request ..

      Exception as follows ..

      java.security.AccessControlException: access denied (java.security.SecurityPermission getHttpRequestBase)
      X      at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
      X      at java.security.AccessController.checkPermission(AccessController.java:427)
      X      at org.apache.catalina.connector.HttpRequestFacade.getHttpRequestBase(HttpRequestFacade.java:257)
      X      at org.apache.catalina.core.ApplicationDispatcher.getRequestBase(ApplicationDispatcher.java:1115)
      X      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:759)
      X      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:628)
      X      at org.apache.catalina.core.ApplicationDispatcher.access$100(ApplicationDispatcher.java:123)
      X      at org.apache.catalina.core.ApplicationDispatcher$PrivilegedInclude.run(ApplicationDispatcher.java:154)
      X      at java.security.AccessController.doPrivileged(Native Method)
      X      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:528)
      X      at com.sun.portal.portlet.impl.RequestDispatcherImpl.include(RequestDispatcherImpl.java:95)
      X      at com.gm.gc.sample.SamplePortlet.doView(Unknown Source)
      X      at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:235)
      X      at javax.portlet.GenericPortlet.render(GenericPortlet.java:163)
      X      at com.sun.portal.portletappengine.PortletAppEngineServlet.service(PortletAppEngineServlet.java:271)
      X      at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
      X      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:772)
      X      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:628)
      X      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:539)
      X      at com.sun.portal.container.portlet.impl.PortletContainer.invokePAE(PortletContainer.java:409)
      X      at com.sun.portal.container.portlet.impl.PortletContainer.getMarkup(PortletContainer.java:180)
      X      at com.sun.portal.providers.window.WindowProvider.getPortletContent(WindowProvider.java:386)
      X      at com.sun.portal.providers.window.WindowProvider.getContentInternal(WindowProvider.java:239)
      X      at com.sun.portal.providers.window.WindowProvider.getContent(WindowProvider.java:204)
      X      at com.sun.portal.desktop.context.ReusableProviderCaller.run(ReusableProviderCaller.java:160)


      Source Code
      ===========


      SamplePortlet Class
      protected void doView(RenderRequest request, RenderResponse response)
                     throws PortletException, IOException {
                PortletRequestDispatcher prDispatcher = null;
                String helloString=null;
                SamplePortletHandler spHandler=null;
                
                response.setContentType(request.getResponseContentType());
                try {
                     spHandler=new SamplePortletHandler();               
                     prDispatcher = pContext.getRequestDispatcher("/jsp/SampleView.jsp");                         
                     helloString=spHandler.getHelloString();
                     prDispatcher.include(request, response);
                } catch (Exception e) {
                     e.printStackTrace();
                     request.setAttribute("ERROR_MSG", e.getMessage());
                     prDispatcher = pContext.getRequestDispatcher("/jsp/Error.jsp");
                     prDispatcher.include(request, response);
                }
           }

      Handler Class

      is there any solution?


      Thanks in Advance ...