Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-67059

org.apache.log4j.xml.DOMConfigurator.doConfigure() will fail if on JBoss 5.2

    Details

    • Branch Version/s:
      6.2.x
    • Backported to Branch:
      Committed
    • Story Points:
      1.5
    • Fix Priority:
      3

      Description

      Reproduction steps:
      1) Install Liferay 6.2 on JBoss EAP 5.2

      (https://dev.liferay.com/discover/portal/-/knowledge_base/6-1/installing-liferay-on-jboss-5-1, it is for JBoss EAP 5.1+ Liferay 6.1 but also applies to JBoss EAP 5.2 + Liferay 6.2)

      2) Patch the Liferay .war with latest fix pack
      3) Start the portal, login as Admin, place a DM portlet onto the Welcome page
      4) Upload any PDF file

      Expected: A preview to be generated, no errors shown in the server
      Actual behavior: No preview is generated, server throws:

      12:20:44,010 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]Exception in thread "main"
      12:20:44,012 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
      12:20:44,015 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]
      12:20:44,017 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]    at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:127)
      12:20:44,019 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]
      12:20:44,021 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:694)
      12:20:44,022 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]
      12:20:44,024 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:660)
      12:20:44,027 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]
      12:20:44,028 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]    at com.liferay.util.log4j.Log4JUtil.configureLog4J(Log4JUtil.java:113)
      12:20:44,031 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]
      12:20:44,033 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]    at com.liferay.util.log4j.Log4JUtil.configureLog4J(Log4JUtil.java:60)
      12:20:44,036 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]
      12:20:44,039 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]    at com.liferay.util.log4j.Log4JUtil.initLog4J(Log4JUtil.java:182)
      12:20:44,042 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]
      12:20:44,044 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]    at com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable.call(PDFProcessorImpl.java:907)
      12:20:44,047 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]
      12:20:44,048 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]    at com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable.call(PDFProcessorImpl.java:1)
      12:20:44,050 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]
      12:20:44,051 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]    at com.liferay.portal.kernel.process.ProcessExecutor.main(ProcessExecutor.java:192)
      12:20:44,053 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]
      12:20:44,054 ERROR [STDERR] [com.liferay.portlet.documentlibrary.util.PDFProcessorImpl$LiferayPDFBoxProcessCallable@87abf31]Caused by: java.lang.ClassNotFoundException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
      

      This is because xercesImpl.jar and {{xml-­apis.jar}} are removed from the JBoss's classpath because of classloading incompatibilities.
      https://issues.liferay.com/browse/LPS-40543?focusedCommentId=363777&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-363777

      The statement

      Log4JUtil.java
      domConfigurator.doConfigure(
      			urlReader, LogManager.getLoggerRepository());
      

      will throw the ClassNotFoundException because Xerces and its dependency, xml-apis is not in the classpath.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                felix.zhang Felix Zhang
                Reporter:
                istvan.dezsi Istvan Dezsi
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  2 years, 41 weeks, 6 days ago

                  Packages

                  Version Package
                  6.2.X EE