[ https://issues.apache.org/jira/browse/PDFBOX-4950?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17189682#comment-17189682 ]
Me commented on PDFBOX-4950: ---------------------------- After switching to an Ubuntu based container image the issue went away. This is probably due to the muslc linked libraries. I'll close this issue myself since its not a pdfbox specific problem, but you now know that usage of it with Alpine will run into problems. > No lcms in java.library.path? > ----------------------------- > > Key: PDFBOX-4950 > URL: https://issues.apache.org/jira/browse/PDFBOX-4950 > Project: PDFBox > Issue Type: Bug > Affects Versions: 2.0.16 > Environment: Alpine 3.10.0 > Docker container > OpenJDK 11 > Reporter: Me > Priority: Major > > Hi. I'm working with on a Camunda (BPM engine) integration that leverages > pdfbox to generate a pdf programmatically. I have the pdfbox jar deployed > with my WAR: > {quote}ls -l /camunda/webapps/test-workflows/WEB-INF/lib/ > -rw-r----- 1 camunda camunda 62983 Aug 3 16:35 activation-1.1.jar > -rw-r----- 1 camunda camunda 46874 Aug 3 16:35 > camunda-bpm-mail-core-1.2.0.jar > -rw-r----- 1 camunda camunda 4332 Aug 3 16:35 > camunda-commons-logging-1.6.1.jar > -rw-r----- 1 camunda camunda 12050 Aug 3 16:35 > camunda-commons-utils-1.6.1.jar > -rw-r----- 1 camunda camunda 19240 Aug 3 16:35 camunda-connect-core-1.1.0.jar > -rw-r----- 1 camunda camunda 23464 Aug 3 16:35 > camunda-identity-ldap-7.10.0.jar > -rw-r----- 1 camunda camunda 246174 Aug 3 16:35 commons-beanutils-1.9.3.jar > -rw-r----- 1 camunda camunda 335042 Aug 3 16:35 commons-codec-1.11.jar > -rw-r----- 1 camunda camunda 575389 Aug 3 16:35 commons-collections-3.2.1.jar > -rw-r----- 1 camunda camunda 752798 Aug 3 16:35 commons-collections4-4.2.jar > -rw-r----- 1 camunda camunda 434678 Aug 3 16:35 commons-lang3-3.4.jar > -rw-r----- 1 camunda camunda 61829 Aug 3 16:35 commons-logging-1.2.jar > -rw-r----- 1 camunda camunda 182954 Aug 3 16:35 commons-text-1.3.jar > -rw-r----- 1 camunda camunda 1558165 Aug 3 16:35 fontbox-2.0.16.jar > -rw-r----- 1 camunda camunda 767916 Aug 3 16:35 httpclient-4.5.7.jar > -rw-r----- 1 camunda camunda 326874 Aug 3 16:35 httpcore-4.4.11.jar > -rw-r----- 1 camunda camunda 41779 Aug 3 16:35 httpmime-4.5.7.jar > -rw-r----- 1 camunda camunda 66519 Aug 3 16:35 jackson-annotations-2.9.0.jar > -rw-r----- 1 camunda camunda 324036 Aug 3 16:35 jackson-core-2.9.7.jar > -rw-r----- 1 camunda camunda 1350857 Aug 3 16:35 jackson-databind-2.9.7.jar > -rw-r----- 1 camunda camunda 603571 Aug 3 16:35 javax.mail-1.5.5.jar > -rw-r----- 1 camunda camunda 170348 Aug 3 16:35 opencsv-4.6.jar > -rw-r----- 1 camunda camunda 2684592 Aug 3 16:35 pdfbox-2.0.16.jar > -rw-r----- 1 camunda camunda 29257 Aug 3 16:35 slf4j-api-1.7.7.jar > -rw-r----- 1 camunda camunda 62599 Aug 3 16:35 smtp-1.6.0.jar > {quote} > When I try to use PDDocument.load(): > {quote}PDDocument pdfDocument = > PDDocument.load(this.getClass().getClassLoader().getResourceAsStream(template)); > {quote} > I observe the following exception that lcms isn't in the java library path: > {quote}01-Sep-2020 14:02:06.445 SEVERE [http-nio-8080-exec-1] > org.camunda.commons.logging.BaseLogger.logError ENGINE-16004 Exception while > closing command context: no lcms in java.library.path: > [/usr/lib/jvm/java-11-openjdk/lib/server, /usr/lib/jvm/java-11-openjdk/lib, > /usr/lib/jvm/java-11-openjdk/../lib, /usr/java/packages/lib, /usr/lib64, > /lib64, /lib, /usr/lib]bpm | java.lang.UnsatisfiedLinkError: no lcms in > java.library.path: [/usr/lib/jvm/java-11-openjdk/lib/server, > /usr/lib/jvm/java-11-openjdk/lib, /usr/lib/jvm/java-11-openjdk/../lib, > /usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib]bpm | at > java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2660)bpm | at > java.base/java.lang.Runtime.loadLibrary0(Runtime.java:829)bpm | at > java.base/java.lang.System.loadLibrary(System.java:1867)bpm | at > java.desktop/sun.java2d.cmm.lcms.LCMS$1.run(LCMS.java:209)bpm | at > java.base/java.security.AccessController.doPrivileged(Native Method)bpm | > at java.desktop/sun.java2d.cmm.lcms.LCMS.getModule(LCMS.java:202)bpm | at > java.desktop/sun.java2d.cmm.lcms.LcmsServiceProvider.getModule(LcmsServiceProvider.java:34)bpm > | at > java.desktop/sun.java2d.cmm.CMMServiceProvider.getColorManagementModule(CMMServiceProvider.java:31)bpm > | at > java.desktop/sun.java2d.cmm.CMSManager.getModule(CMSManager.java:68)bpm | > at > java.desktop/java.awt.color.ICC_ColorSpace.toRGB(ICC_ColorSpace.java:177)bpm > | at > org.apache.pdfbox.pdmodel.graphics.color.PDDeviceRGB.init(PDDeviceRGB.java:68)bpm > | at > org.apache.pdfbox.pdmodel.graphics.color.PDDeviceRGB.toRGBImage(PDDeviceRGB.java:108)bpm > | at > org.apache.pdfbox.pdmodel.PDDocument.<clinit>(PDDocument.java:107)bpm | at > com.test.CreatePDFDocument.execute(CreatePDFDocument.java:29) > {quote} > I'm using OpenJDK 11: > openjdk version "11.0.4" 2019-07-16 > OpenJDK Runtime Environment (build 11.0.4+4-alpine-r1) > OpenJDK 64-Bit Server VM (build 11.0.4+4-alpine-r1, mixed mode) > My OS is Alpine 3.10.0 and have attempted to install everything lcms related. > If I grep my system for anything lcms related I see: > {quote} # find / | grep lcms > /usr/lib/liblcms.so.1.0.19 > /usr/lib/liblcms.so.1 > /usr/lib/pkgconfig/lcms.pc > /usr/lib/pkgconfig/lcms2.pc > /usr/lib/liblcms.a > /usr/lib/liblcms.so > /usr/lib/liblcms2.so > /usr/lib/liblcms2.so.2 > /usr/lib/liblcms2.so.2.0.8 > /usr/include/lcms.h > /usr/include/lcms2.h > /usr/include/lcms2_plugin.h{quote} > Note that /usr/lib is part of the java.library.path cited in the error. > Alpine's default LD_LIBRARY_PATH is supposed to be > /lib:/usr/local/lib:/usr/lib, which should cover the location of the lcms > related so's. > What am I missing here? I'm getting pretty desperate. Thank you in advance > for any advice! -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org