Jetspeed 2
  1. Jetspeed 2
  2. JS2-1040

When dom4j library is common lib dir, dom4j DocumentFactory cannot be accessed because of classloaders conclict

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.1
    • Component/s: None
    • Labels:
      None

      Description

      If there are dom4j libraries in both common lib dir and portal's lib dir, then the following errors are found when user tries to add a portlet in a page.

      Jul 6, 2009 11:00:04 AM org.apache.catalina.core.ApplicationContext log
      SEVERE: JetspeedContainerServlet: Error rendering portlet "j2-admin::CategoryPortletSelector": java.lang.ExceptionInInitializerError
      java.lang.ExceptionInInitializerError
      at org.apache.jetspeed.util.DOMUtils.createSerializableElement(DOMUtils.java:64)
      at org.apache.jetspeed.container.impl.PortletResponseContextImpl.createElement(PortletResponseContextImpl.java:106)
      at org.apache.pluto.container.impl.PortletResponseImpl.createElement(PortletResponseImpl.java:145)
      at org.apache.portals.gems.dojo.DojoPortletHelper.contributeScript(DojoPortletHelper.java:70)
      at org.apache.portals.gems.dojo.DojoPortletHelper.enableDojo(DojoPortletHelper.java:107)
      at org.apache.jetspeed.portlets.dojo.AbstractAdminDojoVelocityPortlet.doHeaders(AbstractAdminDojoVelocityPortlet.java:65)
      at javax.portlet.GenericPortlet.render(GenericPortlet.java:248)
      at org.apache.portals.bridges.velocity.GenericVelocityPortlet.render(GenericVelocityPortlet.java:164)
      at org.apache.jetspeed.portlet.PortletObjectProxy.proxyRender(PortletObjectProxy.java:244)
      at org.apache.jetspeed.portlet.PortletObjectProxy.invoke(PortletObjectProxy.java:159)
      at $Proxy26.render(Unknown Source)
      at org.apache.jetspeed.factory.JetspeedPortletInstance.render(JetspeedPortletInstance.java:110)
      at org.apache.jetspeed.container.services.JetspeedFilterChain.doFilter(JetspeedFilterChain.java:142)
      at org.apache.jetspeed.container.services.JetspeedFilterChain.processFilter(JetspeedFilterChain.java:92)
      at org.apache.jetspeed.container.services.JetspeedFilterManager.processFilter(JetspeedFilterManager.java:112)
      at org.apache.jetspeed.container.JetspeedContainerServlet.doGet(JetspeedContainerServlet.java:272)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
      at org.apache.jetspeed.container.invoker.ServletPortletInvoker.invoke(ServletPortletInvoker.java:165)
      at org.apache.jetspeed.container.invoker.JetspeedPortletInvokerService.render(JetspeedPortletInvokerService.java:127)
      at org.apache.pluto.container.impl.PortletContainerImpl.doRender(PortletContainerImpl.java:157)
      at org.apache.jetspeed.container.JetspeedPortletContainerWrapper.doRender(JetspeedPortletContainerWrapper.java:69)
      at org.apache.jetspeed.aggregator.impl.RenderingJobImpl.execute(RenderingJobImpl.java:183)
      at org.apache.jetspeed.aggregator.impl.PortletRendererImpl.renderNow(PortletRendererImpl.java:160)
      at org.apache.jetspeed.aggregator.impl.PortletRendererImpl.renderNow(PortletRendererImpl.java:138)
      at org.apache.jetspeed.aggregator.impl.PageAggregatorImpl.aggregateAndRender(PageAggregatorImpl.java:108)
      at org.apache.jetspeed.aggregator.impl.PageAggregatorImpl.aggregateAndRender(PageAggregatorImpl.java:103)
      at org.apache.jetspeed.aggregator.impl.PageAggregatorImpl.build(PageAggregatorImpl.java:77)
      at org.apache.jetspeed.aggregator.AggregatorValve.invoke(AggregatorValve.java:46)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
      at org.apache.jetspeed.aggregator.HeaderAggregatorValve.invoke(HeaderAggregatorValve.java:53)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
      at org.apache.jetspeed.decoration.DecorationValve.invoke(DecorationValve.java:137)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
      at org.apache.jetspeed.resource.ResourceValveImpl.invoke(ResourceValveImpl.java:84)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
      at org.apache.jetspeed.pipeline.valve.impl.ActionValveImpl.invoke(ActionValveImpl.java:139)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
      at org.apache.jetspeed.container.ContainerValve.invoke(ContainerValve.java:88)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
      at org.apache.jetspeed.container.PageHistoryValve.invoke(PageHistoryValve.java:108)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
      at org.apache.jetspeed.profiler.impl.RefreshUserHomepageValveImpl.invoke(RefreshUserHomepageValveImpl.java:94)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
      at org.apache.jetspeed.profiler.impl.ProfilerValveImpl.invoke(ProfilerValveImpl.java:251)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
      at org.apache.jetspeed.security.impl.LoginValidationValveImpl.invoke(LoginValidationValveImpl.java:158)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
      at org.apache.jetspeed.security.impl.PasswordCredentialValveImpl.invoke(PasswordCredentialValveImpl.java:151)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
      at org.apache.jetspeed.localization.impl.LocalizationValveImpl.invoke(LocalizationValveImpl.java:170)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
      at org.apache.jetspeed.security.impl.AbstractSecurityValve$1.run(AbstractSecurityValve.java:138)
      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:179)
      at org.apache.jetspeed.security.impl.AbstractSecurityValve.invoke(AbstractSecurityValve.java:132)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
      at org.apache.jetspeed.container.url.impl.PortalURLValveImpl.invoke(PortalURLValveImpl.java:67)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
      at org.apache.jetspeed.capabilities.impl.CapabilityValveImpl.invoke(CapabilityValveImpl.java:127)
      at org.apache.jetspeed.pipeline.JetspeedPipeline$Invocation.invokeNext(JetspeedPipeline.java:167)
      at org.apache.jetspeed.pipeline.JetspeedPipeline.invoke(JetspeedPipeline.java:146)
      at org.apache.jetspeed.engine.JetspeedEngine.service(JetspeedEngine.java:225)
      at org.apache.jetspeed.engine.JetspeedServlet.doGet(JetspeedServlet.java:300)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.jetspeed.engine.servlet.XXSUrlAttackFilter.doFilter(XXSUrlAttackFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory
      at org.dom4j.DocumentFactory.getInstance(DocumentFactory.java:97)
      at org.dom4j.tree.AbstractNode.<clinit>(AbstractNode.java:39)
      ... 89 more

      Because dom4j's DocumentFactory depends on Class.forName() to manage a singleton inside, it seems that there's classloader conflicting problem during cross context invocations.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Woonsan Ko
            Reporter:
            Woonsan Ko
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development