• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Could not initialize class sun.font.SunFontManager in Official Docker Container

New Here ,
May 05, 2020 May 05, 2020

Copy link to clipboard

Copied

I am running the official Docker Coldfusion Container:

eaps-docker-coldfusion.bintray.io/cf/coldfusion:latest

 

When I try to create a PDF using <CFDOCUMENT>, I receive the following error message.

I know that lucee had some problems with this based on the Java version, but I assumed that the official image/container would work.

 

Here is the code block it works great on the exact same version of ColdFusion installed locally.

 

<cfdocument format="pdf" scale="#URL.scale#">
   <cfoutput>#cfhttp.filecontent#</cfoutput>
</cfdocument>

 

 

Thank you

Views

1.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 07, 2020 May 07, 2020

Copy link to clipboard

Copied

I'm not so sure that's going to work. The Docker container has a pretty stripped-down version of CF in it, as far as I can tell. CF normally comes with a bunch of platform-specific libraries as well as CF itself. You can connect it to an external add-on service - which would normally be installed on the same machine as CF - but this external add-on service isn't actually part of the Docker container. There are several Docker environment variables that will let you point it to an external source.

 

Compounding my answer a little bit is that I'm not sure whether the add-on service is responsible for CFDOCUMENT or just the newer CFHTMLTOPDF tags. But I do know that either way, it's using stuff that's not actually part of CF. So I'm not so confident it'll work in any case.

 

Dave Watts, Eidolon LLC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 04, 2020 Sep 04, 2020

Copy link to clipboard

Copied

I just ran into this issue, today.

is there a way to specify a pdf service running on a different machine?

 

Iambradb.com Adobe ColdFusion Specialist.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 11, 2024 Apr 11, 2024

Copy link to clipboard

Copied

Did you ever figure out the solution? I just updated Java to openJDK 11 and getting the same error now. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 11, 2024 Apr 11, 2024

Copy link to clipboard

Copied

@felix822 

 

Try this:

 

Step 1: Get inside the container and run the below command:

 

apt install fontconfig

 

Step 2:   Edit jvm.config file and add the below argument:

 

--add-exports java.desktop/sun.font=ALL-UNNAMED

 

Save the file and restart the container.

 

Thanks,

Vikram

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 12, 2024 Apr 12, 2024

Copy link to clipboard

Copied

Sorry, that did not work for me. But unlike the OP, I am not running a container - it's a VM running Coldfusion 2016 server (Update 17).  

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 13, 2024 Apr 13, 2024

Copy link to clipboard

Copied

LATEST

Perhaps a more appropriate way to add the flag to ColdFusion's jvm.config is:

 

--add-exports=java.desktop/sun.font=ALL-UNNAMED

 

Another tip (for ColdFusion 2016 Update 17): use the latest JDK 11

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation