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

Ghostscript is not initialized correctly when enabling via portal properties

    Details

      Description

      Steps to Reproduce:
      1. Install Ghostscript and Imagemagick
      2. Put the following in portal-ext.properties (updating the OS and paths as necessary):

      imagemagick.enabled=true
      imagemagick.global.search.path[unix]=/usr/local/bin:/usr/local/share/ghostscript/fonts:/usr/local/share/fonts/urw-fonts
      

      3. Start the portal
      4. Enable debug logging on the com.liferay.portal.image package
      5. Go to Menu - Content & Data - Documents and Media
      6. Upload a PDF
      7. Check for preview

      Expected result
      Preview is created

      Actual result
      Exception is thrown:

      INFO  [liferay/document_library_pdf_processor-2][GhostscriptImpl:72] Executing command 'null -dBATCH -dSAFER -dNOPAUSE -dNOPROMPT -sFONTPATH=null -sDEVICE=png16m -sOutputFile=/opt/liferay/tomcat/temp/liferay/document_preview/28000.1.0-%d.png -dPDFFitPage -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r300 -dDEVICEWIDTH=1000 -dDEVICEHEIGHT=1294 /opt/liferay/tomcat/temp/20210825135415890THMMLYYD '
      2021-08-25 13:54:16.039 WARN  [liferay/document_library_pdf_processor-2][BaseProcessorMessageListener:40] Unable to process file version 28001
      2021-08-25 13:54:16.040 DEBUG [liferay/document_library_pdf_processor-2][BaseProcessorMessageListener:46] java.lang.NullPointerException
      java.lang.NullPointerException
      	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1090)
      	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
      	at com.liferay.petra.process.ProcessUtil.execute(ProcessUtil.java:55)
      	at com.liferay.portal.image.GhostscriptImpl.execute(GhostscriptImpl.java:75)
      	at com.liferay.portal.kernel.image.GhostscriptUtil.execute(GhostscriptUtil.java:26)
      	at com.liferay.portlet.documentlibrary.util.PDFProcessorImpl._generateImagesGS(PDFProcessorImpl.java:548)
      	at com.liferay.portlet.documentlibrary.util.PDFProcessorImpl._generateImagesGS(PDFProcessorImpl.java:486)
      	at com.liferay.portlet.documentlibrary.util.PDFProcessorImpl._generateImagesGS(PDFProcessorImpl.java:644)
      	at com.liferay.portlet.documentlibrary.util.PDFProcessorImpl._generateImages(PDFProcessorImpl.java:471)
      	at com.liferay.portlet.documentlibrary.util.PDFProcessorImpl._generateImages(PDFProcessorImpl.java:427)
      	at com.liferay.portlet.documentlibrary.util.PDFProcessorImpl.generateImages(PDFProcessorImpl.java:112)
      	at com.liferay.document.library.kernel.util.PDFProcessorUtil.generateImages(PDFProcessorUtil.java:34)
      	at com.liferay.portlet.documentlibrary.messaging.PDFProcessorMessageListener.generate(PDFProcessorMessageListener.java:30)
      	at com.liferay.portlet.documentlibrary.messaging.BaseProcessorMessageListener.doReceive(BaseProcessorMessageListener.java:36)
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.doReceive(BaseMessageListener.java:48)
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:34)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
      	at com.liferay.portal.messaging.internal.SerialDestination$1.run(SerialDestination.java:59)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base/java.lang.Thread.run(Thread.java:829)

        Attachments

          Activity

            People

            Assignee:
            jeremy.chen Jeremy Chen
            Reporter:
            jonathan.mccann Jonathan McCann
            Participants of an Issue:
            Recent user:
            Austin Chiang
            Engineering Assignee:
            Jonathan McCann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              35 weeks, 1 day ago

                Packages

                Version Package
                7.0.X
                7.1.10 DXP FP26
                7.1.10.7 SP7
                7.1.X
                7.2.10 DXP FP15
                7.2.X
                7.3.10.3 DXP SP3
                7.3.X
                7.4.13 DXP GA1
                Master