Jetspeed 2
  1. Jetspeed 2
  2. JS2-612

Get NullPointerException around pageManager in FolderImpl under high load

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.3
    • Fix Version/s: 2.1.3
    • Component/s: PSML
    • Labels:
      None
    • Environment:
      Java 1.5, Oracle 9

      Description

      Get the following exception in jetspeed log when portal is under high load. Looks like pageManager variable is null. I've see similar exceptions at line 877 in FolderImpl under similar conditions

      2006-11-15 03:54:40,382 [TP-Processor12] FATAL org.apache.jetspeed.engine.JetspeedServlet - Fatal error encountered while processing portal request: org.apache.jetspeed.pipeline.PipelineException: org.apache.jetspeed.pipeline.PipelineException: org.apache.jetspeed.pipeline.PipelineException: java.lang.NullPointerException
      org.apache.jetspeed.pipeline.PipelineException: org.apache.jetspeed.pipeline.PipelineException: org.apache.jetspeed.pipeline.PipelineException: java.lang.NullPointerException
      at org.apache.jetspeed.security.impl.PasswordCredentialValveImpl.invoke(PasswordCredentialValveImpl.java:154)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
      at org.apache.jetspeed.localization.impl.LocalizationValveImpl.invoke(LocalizationValveImpl.java:169)
      at com.covisint.cep.jetspeed.pipeline.LocalizationValveImpl.invoke(LocalizationValveImpl.java:68)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
      at org.apache.jetspeed.security.impl.AbstractSecurityValve$1.run(AbstractSecurityValve.java:117)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.Subject.doAsPrivileged(Subject.java:454)
      at org.apache.jetspeed.security.impl.AbstractSecurityValve.invoke(AbstractSecurityValve.java:111)
      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 com.covisint.cep.jetspeed.pipeline.NetworkPortValveImpl.invoke(NetworkPortValveImpl.java:50)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
      at com.covisint.cep.jetspeed.pipeline.LastUrlCookieValveImpl.invoke(LastUrlCookieValveImpl.java:58)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
      at com.covisint.cep.jetspeed.pipeline.ContentPreviewValveImpl.invoke(ContentPreviewValveImpl.java:48)
      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:241)
      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.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.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
      at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: org.apache.jetspeed.pipeline.PipelineException: org.apache.jetspeed.pipeline.PipelineException: java.lang.NullPointerException
      at org.apache.jetspeed.security.impl.LoginValidationValveImpl.invoke(LoginValidationValveImpl.java:164)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
      at org.apache.jetspeed.security.impl.PasswordCredentialValveImpl.invoke(PasswordCredentialValveImpl.java:149)
      ... 40 more
      Caused by: org.apache.jetspeed.pipeline.PipelineException: java.lang.NullPointerException
      at org.apache.jetspeed.profiler.impl.ProfilerValveImpl.invoke(ProfilerValveImpl.java:304)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:166)
      at org.apache.jetspeed.security.impl.LoginValidationValveImpl.invoke(LoginValidationValveImpl.java:159)
      ... 42 more
      Caused by: java.lang.NullPointerException
      at org.apache.jetspeed.om.folder.impl.FolderImpl.getEffectivePageSecurity(FolderImpl.java:477)
      at org.apache.jetspeed.om.folder.impl.FolderImpl.getEffectivePageSecurity(FolderImpl.java:495)
      at org.apache.jetspeed.page.document.impl.NodeImpl.checkConstraints(NodeImpl.java:266)
      at org.apache.jetspeed.om.page.impl.BaseElementImpl.checkConstraints(BaseElementImpl.java:397)
      at org.apache.jetspeed.om.page.impl.BaseElementImpl.checkAccess(BaseElementImpl.java:464)
      at org.apache.jetspeed.om.folder.impl.FolderImpl.filterNodeSetByAccess(FolderImpl.java:1055)
      at org.apache.jetspeed.om.folder.impl.FolderImpl.getAll(FolderImpl.java:838)
      at org.apache.jetspeed.page.impl.DatabasePageManager.getAll(DatabasePageManager.java:925)
      at sun.reflect.GeneratedMethodAccessor127.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:284)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:56)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
      at org.apache.jetspeed.util.interceptors.PageManagerInterceptor.invoke(PageManagerInterceptor.java:46)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
      at $Proxy4.getAll(Unknown Source)
      at org.apache.jetspeed.om.folder.impl.FolderImpl.getAll(FolderImpl.java:833)
      at org.apache.jetspeed.om.folder.proxy.FolderProxy.aggregateChildren(FolderProxy.java:763)
      at org.apache.jetspeed.om.folder.proxy.FolderProxy.getAll(FolderProxy.java:309)
      at org.apache.jetspeed.om.folder.proxy.FolderProxy.getPages(FolderProxy.java:450)
      at org.apache.jetspeed.om.folder.proxy.FolderProxy.getPage(FolderProxy.java:473)
      at org.apache.jetspeed.om.folder.proxy.FolderProxy.selectDefaultPageFromAggregateFolders(FolderProxy.java:715)
      at org.apache.jetspeed.om.folder.proxy.FolderProxy.getDefaultPage(FolderProxy.java:324)
      at org.apache.jetspeed.om.folder.proxy.FolderProxy.invoke(FolderProxy.java:203)
      at $Proxy14.getDefaultPage(Unknown Source)
      at org.apache.jetspeed.portalsite.impl.PortalSiteSessionContextImpl.selectRequestPage(PortalSiteSessionContextImpl.java:465)
      at org.apache.jetspeed.portalsite.impl.PortalSiteSessionContextImpl.selectRequestPage(PortalSiteSessionContextImpl.java:221)
      at org.apache.jetspeed.portalsite.impl.PortalSiteRequestContextImpl.getPage(PortalSiteRequestContextImpl.java:212)
      at org.apache.jetspeed.portalsite.impl.PortalSiteRequestContextImpl.getManagedPage(PortalSiteRequestContextImpl.java:195)
      at org.apache.jetspeed.profiler.impl.ProfilerValveImpl.invoke(ProfilerValveImpl.java:248)
      ... 44 more

        Activity

        Hide
        David Sean Taylor added a comment -

        patch applied and tested

        Show
        David Sean Taylor added a comment - patch applied and tested
        Hide
        David Sean Taylor added a comment -

        I will have a look at this one today...

        Show
        David Sean Taylor added a comment - I will have a look at this one today...
        Hide
        Ethan Adams added a comment -

        My solution is not one that I would contribute b/c it isn't that clean. To fix this, I changed FolderImpl.

        I added:

        public PageManager getPageManager()
        {
        if(pageManager == null)

        { pageManager = (PageManager)CommonServices.getService("PageManager"); }

        return pageManager;
        }

        and then changed all the references to pageManager to getPageManager();

        The CommonServices class is a helper to get access to jetspeed services.

        BTW...I think the source of the problem is in DatabasePageManagerCache.

        if (obj instanceof NodeImpl)
        {
        NodeImpl node = (NodeImpl)obj;
        node.setConstraintsEnabled(constraintsEnabled);
        node.setPermissionsEnabled(permissionsEnabled);
        cacheByPath.put(node.getPath(), entry);
        if (obj instanceof FolderImpl)

        { ((FolderImpl)obj).setPageManager(pageManager); }

        }

        It seems that the folder is returned before the page manager get set. I've also seen issues where the setContstraintsEnabled and setPermissionsEnabled were called and it gave everyone edit access to the page. I fixed this by forcing NodeImpl to always return true when getConstraintsEnabled is called.

        Again, this was just a hack to fix the issue. Maybe someone can figure out why this happens.

        Show
        Ethan Adams added a comment - My solution is not one that I would contribute b/c it isn't that clean. To fix this, I changed FolderImpl. I added: public PageManager getPageManager() { if(pageManager == null) { pageManager = (PageManager)CommonServices.getService("PageManager"); } return pageManager; } and then changed all the references to pageManager to getPageManager(); The CommonServices class is a helper to get access to jetspeed services. BTW...I think the source of the problem is in DatabasePageManagerCache. if (obj instanceof NodeImpl) { NodeImpl node = (NodeImpl)obj; node.setConstraintsEnabled(constraintsEnabled); node.setPermissionsEnabled(permissionsEnabled); cacheByPath.put(node.getPath(), entry); if (obj instanceof FolderImpl) { ((FolderImpl)obj).setPageManager(pageManager); } } It seems that the folder is returned before the page manager get set. I've also seen issues where the setContstraintsEnabled and setPermissionsEnabled were called and it gave everyone edit access to the page. I fixed this by forcing NodeImpl to always return true when getConstraintsEnabled is called. Again, this was just a hack to fix the issue. Maybe someone can figure out why this happens.
        Hide
        Bright Zheng added a comment -

        I got this issue too.

        Ethan,Could you tell me the status about this issue?
        Maybe you fix it,I think
        Thanks.

        Environment:BEA WLS8.1.6+Oracle9.2

        Show
        Bright Zheng added a comment - I got this issue too. Ethan,Could you tell me the status about this issue? Maybe you fix it,I think Thanks. Environment:BEA WLS8.1.6+Oracle9.2
        Hide
        Ethan Adams added a comment -

        I can still reproduce in 2.1.2. Have seen NPE when getEffectivePageSecurity() and getAll() are called, while under light usage.

        Show
        Ethan Adams added a comment - I can still reproduce in 2.1.2. Have seen NPE when getEffectivePageSecurity() and getAll() are called, while under light usage.
        Hide
        Ate Douma added a comment -

        Ethan, can you still reproduce this error or else confirm it to be fixed with 2.1 (or current 2.1.1-dev trunk) so we might be able to close this issue?

        Show
        Ate Douma added a comment - Ethan, can you still reproduce this error or else confirm it to be fixed with 2.1 (or current 2.1.1-dev trunk) so we might be able to close this issue?

          People

          • Assignee:
            David Sean Taylor
            Reporter:
            Ethan Adams
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development