We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Code works locally, errors on second pass in production environment

This code works locally run multiple times. In our production environment, it works once and then throws a null pointer exception

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.

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).


Is it happening with a specific font file or with any font file? Would you please make sure to use the latest version of the API and if the issue still persists, please let us know.

Yes, it’s any font file and yet we are using the most current version of the API 21.12.

Once Font.open(fd) is called in the running webserver instance it returns a NPE for all subsequent calls. I have tested on multiple webservers running multiple versions of Java with the same results.


We are checking it and will get back to you shortly.


An investigation ticket as FONTJAVA-29 has been logged in our issue management system to further analyze this case. We will look into its details and keep you posted with the status of its rectification. Please be patient and spare us some time.

We are sorry for the inconvenience.

Hello, I’m checking in on this support ticket.

This issue has prevented us from utilizing the license that we purchased.

Thank you,

-Bill Ensley


We are afraid that the earlier logged ticket has not been yet resolved. However, we have recorded your concerns and will surely inform you once we have some updates about resolution of the ticket. Please spare us some time.

We are sorry for the inconvenience.

Any update on this?

I am also facing the same issue.

I am trying aspose font for creating fonts in tomcat. I am facing this issue when a font is created the second time.

First time works, and if i run it in loop works fine. Running in multi thread or in tomcat throws the below exception.

Any help would be great.

com.aspose.font.FontEnvironment.lif(Unknown Source)
com.aspose.font.FontFactory.open(Unknown Source)
com.aspose.font.FontFactory.open(Unknown Source)
com.aspose.font.Font.open(Unknown Source)


The issue has been updated as per the concerns you have shared. We will surely investigate the ticket FONTJAVA-29 from this perspective and let you know as soon as it is resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.

Sorry Dragonriders, I’ve been waiting almost 6 months for a solution and nothing has been done. My next step is to try and bundle my package up and run it as a Lambda in AWS as those are short lived and spawn a new engine that should short circuit this error. I’ve run all the same test you have, I can run it locally until I’m blue in the face but once it runs in a web container like Tomcat, something gets stuck.


We humbly apologize for the delay and the inconvenience you have been facing due to this error. Your concerns have already been recorded and the ticket is escalated to the next level of the priority. We will surely inform you as soon as it is resolved. We again apologize for the inconvenience.