Jetspeed 2
  1. Jetspeed 2
  2. JS2-734

Drop jetspeed- prefix support for local PA deployment

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.2.0
    • Component/s: Container
    • Labels:
      None

      Description

      It's fairly easy to demonstrate the issue. In the init() method of a simple Portlet, if I attempt to get the PortletContext and then call getResource on it like so:

      PortletContext context = portletConfig.getPortletContext();
      try

      { URL resource = context.getResource("/"); }

      catch (MalformedURLException e)

      { e.printStackTrace(); }

      I'll get the following:

      2007-06-14 15:13:31,125 [http-8080-Processor25] ERROR org.apache.jetspeed.factory.JetspeedPortletFactory - PortletFactory: Failed to load portlet foo.test.MyPortlet
      java.lang.NullPointerException
      at org.apache.jetspeed.container.JetspeedPortletContext.getResource(JetspeedPortletContext.java:193)
      at foo.test.MyPortlet.init(Unknown Source)
      at org.apache.jetspeed.factory.JetspeedPortletInstance.init(JetspeedPortletInstance.java:84)
      at org.apache.jetspeed.factory.JetspeedPortletFactory.getPortletInstance(JetspeedPortletFactory.java:229)
      at org.apache.jetspeed.aggregator.impl.HeaderAggregatorImpl.renderHeaderFragment(HeaderAggregatorImpl.java:1056)
      at org.apache.jetspeed.aggregator.impl.HeaderAggregatorImpl.aggregateAndRender(HeaderAggregatorImpl.java:1037)
      at org.apache.jetspeed.aggregator.impl.HeaderAggregatorImpl.aggregateAndRender(HeaderAggregatorImpl.java:1029)
      at org.apache.jetspeed.aggregator.impl.HeaderAggregatorImpl.aggregateAndRender(HeaderAggregatorImpl.java:1029)
      at org.apache.jetspeed.aggregator.impl.HeaderAggregatorImpl.build(HeaderAggregatorImpl.java:1007)
      at org.apache.jetspeed.aggregator.HeaderAggregatorValve.invoke(HeaderAggregatorValve.java:48)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
      at org.apache.jetspeed.decoration.DecorationValve.invoke(DecorationValve.java:97)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
      at org.apache.jetspeed.pipeline.valve.impl.ActionValveImpl.invoke(ActionValveImpl.java:182)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
      at org.apache.jetspeed.container.ContainerValve.invoke(ContainerValve.java:76)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
      at org.apache.jetspeed.profiler.impl.ProfilerValveImpl.invoke(ProfilerValveImpl.java:255)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
      at org.apache.jetspeed.security.impl.LoginValidationValveImpl.invoke(LoginValidationValveImpl.java:159)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
      at org.apache.jetspeed.security.impl.PasswordCredentialValveImpl.invoke(PasswordCredentialValveImpl.java:149)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
      at org.apache.jetspeed.localization.impl.LocalizationValveImpl.invoke(LocalizationValveImpl.java:169)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
      at org.apache.jetspeed.security.impl.AbstractSecurityValve$1.run(AbstractSecurityValve.java:118)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.Subject.doAsPrivileged(Subject.java:454)
      at org.apache.jetspeed.security.JSSubject.doAsPrivileged(JSSubject.java:195)
      at org.apache.jetspeed.security.impl.AbstractSecurityValve.invoke(AbstractSecurityValve.java:112)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
      at org.apache.jetspeed.container.url.impl.PortalURLValveImpl.invoke(PortalURLValveImpl.java:67)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
      at org.apache.jetspeed.capabilities.impl.CapabilityValveImpl.invoke(CapabilityValveImpl.java:128)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
      at org.apache.jetspeed.pipeline.JetspeedPipeline.invoke(JetspeedPipeline.java:145)
      at org.apache.jetspeed.engine.JetspeedEngine.service(JetspeedEngine.java:214)
      at org.apache.jetspeed.engine.JetspeedServlet.doGet(JetspeedServlet.java:242)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
      at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:688)
      at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:658)
      at org.apache.jsp.index_jsp._jspService(index_jsp.java:44)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.jetspeed.engine.servlet.XXSUrlAttackFilter.doFilter(XXSUrlAttackFilter.java:51)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:613)

      It appears the PortletContext gets created but the wrapped servlet context that it uses is null.

      1. getResource.zip
        5 kB
        Deryk Sinotte
      2. local-deploy-diff.txt
        1.0 kB
        Woonsan Ko

        Activity

        Ate Douma made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Vivek Kumar made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Ate Douma made changes -
        Assignee Ate Douma [ adouma ] Vivek Kumar [ firevelocity ]
        Ate Douma made changes -
        Summary Calling PortletContext.getResource in Portlet.init can throw NullPointerException Drop jetspeed- prefix support for local PA deployment
        Issue Type Bug [ 1 ] Task [ 3 ]
        Ate Douma made changes -
        Priority Minor [ 4 ] Critical [ 2 ]
        Ate Douma made changes -
        Status In Progress [ 3 ] Open [ 1 ]
        Ate Douma made changes -
        Priority Major [ 3 ] Minor [ 4 ]
        Ate Douma made changes -
        Fix Version/s 2.2 [ 12312318 ]
        Ate Douma made changes -
        Assignee David Sean Taylor [ taylor ] Ate Douma [ adouma ]
        David Sean Taylor made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        David Sean Taylor made changes -
        Assignee David Sean Taylor [ taylor ]
        Woonsan Ko made changes -
        Attachment local-deploy-diff.txt [ 12360245 ]
        Deryk Sinotte made changes -
        Field Original Value New Value
        Attachment getResource.zip [ 12360132 ]
        Deryk Sinotte created issue -

          People

          • Assignee:
            Vivek Kumar
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development