This code works locally run multiple times. In our production environment, it works once and then throws a null pointer exception
java.lang.NullPointerException
at com.aspose.font.FontEnvironment.lif(Unknown Source)
at com.aspose.font.I644.lif(Unknown Source)
at com.aspose.font.Font.open(Unknown Source)
at com.squish.uploader.ConvertFont.(FontInstaller.java:550)
FileSystemStreamSource fsss = new FileSystemStreamSource(fontFile.getPath());
FontDefinition fd = new FontDefinition(FontType.TTF, new FontFileDefinition(“ttf”, fsss));
Font font = Font.open(FontType.TTF, fsss);
I have confirmed that nothing is null.
No form of loading a font works more than one time without restarting the webserver.
Tomcat9.62
amazon-corretto-8.332.08.1
All versions of jdk1.8*
Have tried several versions of Java, both native and open, currently running amazon-corretto-8.332.08.1 (the same Java version works correctly locally).