Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic Linux distro requires Fontconfig for font support #64

Open
jinsihou19 opened this issue Feb 18, 2019 · 29 comments
Open

Generic Linux distro requires Fontconfig for font support #64

jinsihou19 opened this issue Feb 18, 2019 · 29 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jinsihou19
Copy link

java.lang.NullPointerException
at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)
at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219).
at sun.awt.FontConfiguration.init(FontConfiguration.java:107)
at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774)
at sun.font.SunFontManager$2,run(SunFontManager.java:431)
at java.security.AccessController.doPrivileged(NativeMethod)
at sun.font.SunFontManager.<init>(SunFontManager.java:376)
at sun.awt.FcFontManager.<init>(FcFontManager.java:35)
at sun.awt.X11FontManager.<init>(X11FontManagerjava:57)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeMethod)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
at java.security.AccessController.doPrivileged(NativeMethod)
at sun.font.FontManagerFactory.getInstance(FontManagerFactoryjava:74)
at sun.font.SunFontManager.getInstance(SunFontManager.java:250)
at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:264)
at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:250)
at sun.awt.SunToolkit.getFontMetrics(SunToolkit.java:652)
at sun.awt.HeadlessToolkit.getFontMetrics(HeadlessToolkit.java:413)

Platform information

OS: Linux version 4.4.0-1067-aws (buildd@lgw01-amd64-033) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10) ) 
Version: 
openjdk version "1.8.0_202"
OpenJDK Runtime Environment Corretto-8.202.08.2 (build 1.8.0_202-b08)
OpenJDK 64-Bit Server VM Corretto-8.202.08.2 (build 25.202-b08, mixed mode)
@navyxliu
Copy link
Contributor

@jinsihou19
Did you install fontconfig?
if you use AWT, it relies on fontconfig to figure out what fonts your system has installed.

@navyxliu navyxliu self-assigned this Feb 18, 2019
@jinsihou19
Copy link
Author

@navyxliu yes. But it seems like the underlying issue is that fontconfig can't find any fonts because there are no fonts:

find / -name '*.ttf'

see this

@navyxliu
Copy link
Contributor

Thank you for your feedback.

If you do install fontconfig, you might encounter a new problem. please note that both fontmanager and fonts are provided by your system.

In your platform information, the Ubuntu version is blank. Could you give us more information about your platform? if you're using docker, you can point us to the docker image.

Is your application using GUI? if yes, you need to install some fonts. Otherwise, try to set your JRE headless mode.

java -Djava.awt.headless=true

@jinsihou19
Copy link
Author

Thank you, I will try it next time.

@EricEdens EricEdens reopened this Mar 1, 2019
@EricEdens
Copy link
Contributor

Let's re-open this to see if it's practical to declare fontconfig as a dependency in the generic Linux RPM. It'd be good to collect some data:

  1. What's the increase in footprint for container users?
  2. Are there any RPM-based distros that don't have fontconfig, or that have fontconfig but call it something else?

Also, here's a minimal repro case:

public class Fonts {
    public static void main(String... args) {
        java.awt.GraphicsEnvironment
                .getLocalGraphicsEnvironment()
                .getAvailableFontFamilyNames();
    }
}

@EricEdens EricEdens changed the title NullPointerException in Corretto NullPointerException when loading fonts in Corretto for generic Linux RPM Mar 1, 2019
@navyxliu
Copy link
Contributor

navyxliu commented Mar 1, 2019

if you really put fontconfig in spec file, we can only declare it in headful part?

@csbodine
Copy link

csbodine commented Mar 4, 2019

What about spending some time on Issue #65 to provide a headless variant that doesn't NEED fonts to be installed?

@EricEdens
Copy link
Contributor

@csbodine, interestingly, this issue is arising because the generic Linux RPM is headless, in the sense that it doesn't declare RPM dependencies on packages that are typically associated with headful activities. In this case, the NPE is fixed if the fontconfig package is installed.

@navyxliu, your question is the heart of this issue. Another way of phrasing it is: should our headless variants support loading fonts?

To get another datapoint, I installed java-1.8.0-openjdk-headless on an AL2 image, and then executed the Fonts example from above, and it throws the same NPE.

@davecurrie davecurrie added the question Further information is requested label Mar 5, 2019
@andydkelly-ig
Copy link

We are experiencing this error when installing our product bundled with Corretto 8 on a headless Linux environment. Is this bug being investigated or is there a workaround not published here?

@EricEdens
Copy link
Contributor

@andydkelly-ig : Are you deploying to an RPM-based system? If so, running yum install fontconfig will solve the issue. Alternatively, if you package your product as an RPM you can add fontconfig as a dependency there.

We're exploring a few long term options. One is to add fontconfig as a dependency to our RPM. Before doing that, I'd like to research the impact on resource-constrained headless users, and to verify that fontconfig is going to be generally available.

@andydkelly-ig
Copy link

@EricEdens thanks for this. We are working on giving this a go today/tomorrow and will report back to confirm it resolved for us. Thanks for responding.

@tanayjha
Copy link

tanayjha commented Mar 8, 2019

Got the same error on ubuntu18.04. Doing a apt-get install libfontconfig1 fixes it. However, the issue is that we want to ship the JDK to the customer machine. So it would be great, if we can have a more permanent fix for this. Any ETA by which we can expect this to be fixed? Thanks!

@declankilker
Copy link

@EricEdens - FYI - installing fontconfig alone didn't fix the issue for me on RHEL 7. I also had to install package urw-fonts.

@EricEdens
Copy link
Contributor

@tanayjha - Thanks for the Ubuntu 18.04 datapoint. No ETA yet, but we're busy brainstorming! Given that you ship on Ubuntu, it'd be good to get your feedback on #29. (Vending the deb from a repository would give us more latitude in expressing package dependencies.)

@declankilker -- Can you post repro steps? The following worked for me on a RHEL 7.6 EC2 instance using ami-036affea69a1101c9. The cat step shows the contents of the test program that I used.

$ sudo rpm -i https://d2znqt9b1bc64u.cloudfront.net/java-1.8.0-amazon-corretto-devel-1.8.0_202.b08-2.x86_64.rpm
$ sudo yum install fontconfig
$ cat Fonts.java 
import java.awt.GraphicsEnvironment;

public class Fonts {
    public static void main(String... args) {
        String[] fonts = GraphicsEnvironment
                .getLocalGraphicsEnvironment()
                .getAvailableFontFamilyNames();

        for (String font : fonts) {
            System.out.println(font);
        }
    }
}
$ javac Fonts.java
$ java Fonts
DejaVu Sans
DejaVu Sans Condensed
DejaVu Sans Light
Dialog
DialogInput
Monospaced
SansSerif
Serif

@declankilker
Copy link

@EricEdens - In our case we bundle the Corretto JDK in our Install4j installer. At installation, Install4j unpacks the JRE and attempts to run the installer. We were encountering the NPE at this point when the fontconfigs and urw-fonts packages were not present. We only encountered this issue after moving from a Sun JDK. Hope this helps.

@EricEdens
Copy link
Contributor

So, I've thought about this issue for a while. Here are the potential solutions that I've thought of. Let me know if you have additional thoughts or ideas!

Potential solution 1: Update the RPM and DEB to express dependencies on fontconfig, freetype, and some font.

I have three problems with this solution. First, we're adding footprint to the installation, and we've received feedback from resource-constrained users such as our Docker users wanting to decrease footprint. Second, the solution only addresses RPM and DEB users, but not tarball users. Third, I'm not 100% confident that all RPM and DEB systems have consistent naming for fontconfig, freetype, and some font. So, we might alienate some users who would have worked otherwise.

Potential solution 2: Bundle pre-built versions of fontconfig, freetype in the generic Linux JDK along with some font.

I have two problems with this solution. First, it adds resource, and the aforementioned resource-constrained users have been asking us to decrease our footprint. Second, we're trying to stay cognizant and respectful to the overall Linux community, many of whom have concerns about bundling pre-built dependencies.

Potential solution 3: Update our installation instructions to say that fontconfig, freetype, and a font are optional dependencies.

This feels like a good compromise. Resource-constrained users will be able to avoid the extra dependencies, while users who need fonts will have steps to install them on their own. We'll be able to give one-line solutions for yum and apt that will make it easy for users to install the dependencies.

Lastly, @declankilker, I looked into an app that used Installer4j and it bundled the Corretto 8 runtime. When attempting to install it in an ubuntu:18.04 docker container, it threw java.lang.UnsatisfiedLinkError: jre/jre/lib/amd64/libfontmanager.so: libfreetype.so.6:. After installing fontconfig (like you mentioned), installation proceeded without this error. So, perhaps the solution is to ask your users to install fontconfig as a prerequisite?

@tanayjha
Copy link

tanayjha commented Apr 1, 2019

@EricEdens thanks for working on this. We are in the same boat as @declankilker and I think I speak for the both of us when I say that perhaps the solution is to ask your users to install fontconfig as a prerequisite is not an acceptable solution for us. The issue is we ship our app to thousands of customers. Asking all of them to install a dependency as a prerequisite is not a viable option for us.

@davecurrie davecurrie added bug Something isn't working and removed question Further information is requested labels Apr 1, 2019
@EricEdens EricEdens added enhancement New feature or request and removed bug Something isn't working labels Apr 1, 2019
@EricEdens
Copy link
Contributor

@tanayjha : How about updating your installer to check for fontconfig? If it's not present, install it from the system's package manager.

@EricEdens EricEdens changed the title NullPointerException when loading fonts in Corretto for generic Linux RPM Generic Linux distro requires Fontconfig for font support Apr 1, 2019
@tanayjha
Copy link

@EricEdens sorry was discussing this on a separate ticket. But the answer to that question is that we have considered that option but the issue is that we will have to consider different cases for different linux flavours that we support which has its own set of challenges. Hence we were looking at the possibility of bundling the fonts ourselves with our installer. (basically option 2 in your post above)
In fact if we bundle the LucidaSansRegular.ttf font in a fonts directory in jre/lib it mitigates the NPE. However since the Lucida font is licensed we were hoping to use an open source font to get around this issue. We tried with the DejaVu font but that does not work.
Looking at the code revealed why LucidaSansRegular.ttf worked in the first place. Basically the existence of that file determines the value of the variable isOpenJDK. And if that gets set to false, we don't hit the function causing the NPE.
Now I can definitely think of a simple way to modify the code and get it working with the open source font. The question is, how feasible is that? Does that sound like a good option to you?
(Side note: I have tried using the fontconfig.properties file to specify the mapping to the open source fonts but that does not work. I suspect the reason to be: https://docs.oracle.com/javase/7/docs/webnotes/adoptionGuide/index.html#swing (Support for Linux and Solaris 11 fonts))

@EricEdens
Copy link
Contributor

@tanayjha, bundling fonts with Amazon Corretto is one solution that we've discussed. There are challenges to this approach, as you've described in your post. Given that we have various ideas of how to solve this problem, each with their own tradeoffs, we're not ready to commit to a solution at this point.

It would be helpful, though, to learn about your experiences in this area. Since it sounds like you're interested in building Corretto, I've created #117 to document how to do this. I'll put in a comment with some tips to get you started.

@SwamiKalagiri
Copy link

SwamiKalagiri commented Jan 10, 2020

@tanayjha - Thanks for the Ubuntu 18.04 datapoint. No ETA yet, but we're busy brainstorming! Given that you ship on Ubuntu, it'd be good to get your feedback on #29. (Vending the deb from a repository would give us more latitude in expressing package dependencies.)

@declankilker -- Can you post repro steps? The following worked for me on a RHEL 7.6 EC2 instance using ami-036affea69a1101c9. The cat step shows the contents of the test program that I used.

$ sudo rpm -i https://d2znqt9b1bc64u.cloudfront.net/java-1.8.0-amazon-corretto-devel-1.8.0_202.b08-2.x86_64.rpm
$ sudo yum install fontconfig
$ cat Fonts.java 
import java.awt.GraphicsEnvironment;

public class Fonts {
    public static void main(String... args) {
        String[] fonts = GraphicsEnvironment
                .getLocalGraphicsEnvironment()
                .getAvailableFontFamilyNames();

        for (String font : fonts) {
            System.out.println(font);
        }
    }
}
$ javac Fonts.java
$ java Fonts
DejaVu Sans
DejaVu Sans Condensed
DejaVu Sans Light
Dialog
DialogInput
Monospaced
SansSerif
Serif

we had same issue while registering fonts with AWT Graphics Environment + Corretto 8 JRE on CentOS 7.3. After installing the fontConfig package , it is worked like a charm. Thanks @EricEdens !

@pialinag
Copy link

I am facing issue upgrading my application from oracle java 1.8 to corretto jdk8.202.08.2_64bit and jdk8.212.04.2_64bit.
My app uses activiti, which calls java awt classes to draw its bpmn modelling diagram.
Initially I was getting following NPE :
java.lang.NullPointerException
sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)
sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)
sun.awt.FontConfiguration.init(FontConfiguration.java:107)
sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774)
sun.font.SunFontManager$2.run(SunFontManager.java:431)

Then I figured out it was the missing font libraries.

Just for the sake of investigation, I created my own fontconfig.properties in corretto jre/lib

I also find the fontmanager rpm package, needed by fontconfig, is also installed in my servers:
rpm -qa |grep -i font
fontconfig-2.10.95-10.el7.x86_64
fontpackages-filesystem-1.44-8.el7.noarch

And I copied the following fonts from jdk1.8/jre/lib to corretto jre/lib:
LucidaSansDemiBold.ttf, LucidaBrightDemiBold.ttf, LucidaSansRegular.ttf,LucidaBrightDemiItalic.ttf ,LucidaTypewriterBold.ttf,LucidaBrightItalic.ttf,LucidaTypewriterRegular.ttf,LucidaBrightRegular.ttf
LucidaTypewriterBoldOblique.ttf,LucidaSansDemiOblique.ttf,LucidaTypewriterOblique.ttf,LucidaSansOblique.ttf

Now I see the rectangles and lines in the diagram alright, but the text is not getting displayed.
Firstly, why is it that corretto jre/lib does not have fontconfig or fonts, yet it needs these to be present?
Is it ok to manually create fontconfig.properties and copy font ttf files to corretto jre/lib folder?

@alvdavi
Copy link
Contributor

alvdavi commented Apr 17, 2020

Hi,

There is no need to create a fontconfig.properties nor to copy the lucida fonts from other JDKs. Once fontconfig is installed in the system, Corretto should be able to get the fonts from it. A way to confirm fontconfig is working is to run:

fc-match sans

If you get no answer, that probably means there are no fonts installed on the system that fontconfig can use. Dejavu fonts are the most common ones to install.

Finally, I strongly recommend the usage of a newer version of Corretto, https://github.com/corretto/corretto-8/releases/tag/8.252.09.1 being our latest release, as it contains plenty of fixes, including security ones, not present in 202 or 212.

@ocind
Copy link

ocind commented Oct 6, 2020

hi @navyxliu @EricEdens , we are using corretto 8 for lambda and we are also facing this issue.
Similar issue have also been reported for Corretto 11

We recently migrated our Lambda runtime from openjdk java 8 to corretto 8 and this causes a regression issue in our application. Our application generates an Excel file, and the Excel library that we are using (apache-poi) uses this class.

There is a workaround mentioned here, but I don't think it's a very good permanent solution.

I would like to know if you have already decided on an approach on how to solve this problem, especially when using Corretto in AWS Lambda. Since in AWS Lambda we cannot touch the runtime, there is nothing much that we can do.

Exception trace:
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:82) at java.security.AccessController.doPrivileged(Native Method) at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) at java.awt.Font.getFont2D(Font.java:491) at java.awt.Font.canDisplayUpTo(Font.java:2064) at java.awt.font.TextLayout.singleFont(TextLayout.java:470) at java.awt.font.TextLayout.<init>(TextLayout.java:531) at org.apache.poi.ss.util.SheetUtil.getDefaultCharWidth(SheetUtil.java:273) at org.apache.poi.xssf.streaming.AutoSizeColumnTracker.<init>(AutoSizeColumnTracker.java:117) at org.apache.poi.xssf.streaming.SXSSFSheet.<init>(SXSSFSheet.java:82) at org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:661) at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:682)

@exwindchiller
Copy link

I'm experiencing similar challenges running a silent mode Install Anywhere Windchill installer on RedHat 7.9 using Corretto 8. I've applied all the work arounds I've found here and elsewhere, but can't get past the failure. The RedHat 7 bug related to this issue was closed with release of an OpenJDK fix.

========= Finding VM =================================================
Valid VM types.......................... J2
Expanded Valid VM types.................  JRE_J2 JDK_J2
JVM specified using LAX_VM
* Using VM:.........(LAX_VM)............ /opt/ptc/Windchill_11.1/Java/jre/bin/java

========= Forking JAVA =============================================
LAX Version = 18.0
XMLScriptReader: unable to parse the provided script file.  File may have been invalid...
java.lang.NullPointerException
        at Flexeraan9.am(Unknown Source)

I've experienced no problems with the CentOS 7.9 server that is built using the same IaC as the RedHat server. I have applied none of the work arounds to CentOS.

Any other suggestions for someone way in over their head?

Thanks, Mike

RedHat Vitals

  • redhat-release-server.x86_64 7.9-5.el7_9
  • /opt/ptc/Windchill_11.1/Java/jre/bin/java -version
    • openjdk version "1.8.0_275"
    • OpenJDK Runtime Environment Corretto-8.275.01.1 (build 1.8.0_275-b01)
    • OpenJDK 64-Bit Server VM Corretto-8.275.01.1 (build 25.275-b01, mixed mode)

RedHat State of Fonts

rpm -qa | grep 'xorg-x11-fonts-Type1\|stix-fonts\|dejavu-\|fontconfig\|freetype'  
freetype-2.8-14.el7_9.1.x86_64
fontconfig-2.13.0-4.3.el7.x86_64
dejavu-serif-fonts-2.33-6.el7.noarch
dejavu-sans-fonts-2.33-6.el7.noarch
dejavu-fonts-common-2.33-6.el7.noarch
dejavu-sans-mono-fonts-2.33-6.el7.noarch
fc-match sans && fc-match serif
DejaVuSans.ttf: "DejaVu Sans" "Book"
DejaVuSerif.ttf: "DejaVu Serif" "Book"

Fails with or without this file:

grep prefer /etc/fonts/local.conf
    <prefer><family>Utopia</family></prefer>
    <prefer><family>Utopia</family></prefer>
    <prefer><family>Utopia</family></prefer>
    <prefer><family>Utopia</family></prefer>
    <prefer><family>Utopia</family></prefer>

CentOS Vitals

  • centos-release.x86_64 7-9.2009.1.el7.centos
  • /opt/ptc/Windchill_11.1/Java/jre/bin/java -version
    • openjdk version "1.8.0_275"
    • OpenJDK Runtime Environment Corretto-8.275.01.1 (build 1.8.0_275-b01)
    • OpenJDK 64-Bit Server VM Corretto-8.275.01.1 (build 25.275-b01, mixed mode)

CentOS State of Fonts

rpm -qa | grep 'xorg-x11-fonts-Type1\|stix-fonts\|dejavu-\|fontconfig\|freetype'  
dejavu-fonts-common-2.33-6.el7.noarch
dejavu-sans-fonts-2.33-6.el7.noarch
dejavu-sans-mono-fonts-2.33-6.el7.noarch
dejavu-serif-fonts-2.33-6.el7.noarch
fontconfig-2.13.0-4.3.el7.x86_64
freetype-2.8-14.el7_9.1.x86_64
stix-fonts-1.1.0-5.el7.noarch
xorg-x11-fonts-Type1-7.5-9.el7.noarch
fc-match sans && fc-match serif
DejaVuSans.ttf: "DejaVu Sans" "Book"
DejaVuSerif.ttf: "DejaVu Serif" "Book"

@fan-spec
Copy link

hi @navyxliu @EricEdens , we are using corretto 8 for lambda and we are also facing this issue. Similar issue have also been reported for Corretto 11

We recently migrated our Lambda runtime from openjdk java 8 to corretto 8 and this causes a regression issue in our application. Our application generates an Excel file, and the Excel library that we are using (apache-poi) uses this class.

There is a workaround mentioned here, but I don't think it's a very good permanent solution.

I would like to know if you have already decided on an approach on how to solve this problem, especially when using Corretto in AWS Lambda. Since in AWS Lambda we cannot touch the runtime, there is nothing much that we can do.

Exception trace: java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:82) at java.security.AccessController.doPrivileged(Native Method) at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) at java.awt.Font.getFont2D(Font.java:491) at java.awt.Font.canDisplayUpTo(Font.java:2064) at java.awt.font.TextLayout.singleFont(TextLayout.java:470) at java.awt.font.TextLayout.<init>(TextLayout.java:531) at org.apache.poi.ss.util.SheetUtil.getDefaultCharWidth(SheetUtil.java:273) at org.apache.poi.xssf.streaming.AutoSizeColumnTracker.<init>(AutoSizeColumnTracker.java:117) at org.apache.poi.xssf.streaming.SXSSFSheet.<init>(SXSSFSheet.java:82) at org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:661) at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:682)

Hi @ocind . We meet the same problem with you, and we try the workaround to add a layer for our lambda, but we get another error which is " Code uncompressed size is greater than max allowed size of 272629760". Do you have any new udpate for this problem? Or the still there is only workaround (add layer) for this problem?

@smirnoal
Copy link

Hi all, could you please try it out, it should work now

@vikukp
Copy link

vikukp commented Nov 23, 2022

Using Amazon Corretto-8.322.06.2.

We are facing NPE at java.lang.NullPointerException
at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)
at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)
at sun.awt.FontConfiguration.init(FontConfiguration.java:107)
at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:776)
at sun.font.SunFontManager$2.run(SunFontManager.java:431)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.SunFontManager.(SunFontManager.java:376)
at sun.awt.X11FontManager.(X11FontManager.java:57)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
at sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.java:190)
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:224)
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:252)
at sun.java2d.HeadlessGraphicsEnvironment.getAvailableFontFamilyNames(HeadlessGraphicsEnvironment.java:94)
at org.eclipse.birt.chart.device.g2d.G2dRendererBase.(G2dRendererBase.java:250)

Tried with Installing FontConfig, fontconfig.properties, setting Java_Font Path but NO Luck Please Help us

@vikukp
Copy link

vikukp commented Nov 23, 2022

Using Amazon Corretto-8.322.06.2.

We are facing NPE at java.lang.NullPointerException at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264) at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219) at sun.awt.FontConfiguration.init(FontConfiguration.java:107) at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:776) at sun.font.SunFontManager$2.run(SunFontManager.java:431) at java.security.AccessController.doPrivileged(Native Method) at sun.font.SunFontManager.(SunFontManager.java:376) at sun.awt.X11FontManager.(X11FontManager.java:57) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:422) at java.lang.Class.newInstance(Class.java:442) at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83) at java.security.AccessController.doPrivileged(Native Method) at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) at sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.java:190) at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:224) at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:252) at sun.java2d.HeadlessGraphicsEnvironment.getAvailableFontFamilyNames(HeadlessGraphicsEnvironment.java:94) at org.eclipse.birt.chart.device.g2d.G2dRendererBase.(G2dRendererBase.java:250)

Tried with Installing FontConfig, fontconfig.properties, setting Java_Font Path but NO Luck Please Help us

----- OS : Red Hat Enterprise Linux release 8.5 (Ootpa)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests