Re: Cannot find resource java.lang.IllegalStateException: Cannot find resource

Hi Mohammad Izaz,


I am also getting the same error while using Aspose API.
Error Statement:

java.lang.RuntimeException: java.lang.IllegalStateException: Cannot find resource /resources/Fanwood.otf.

According to the error statement, the code is unable to reach the font fanwood. I have checked the fonts folder, installed the font fanwood. Re run the code, but still getting the same error.
Is there anything what I am missing?

Is there any other reason behind the error statement?
It would be really helpful if you tell me the reasons/causes for this error statement.



Hi Mushir,

You do not need to install fanwood font. You should install the fonts used in your document.

Best Regards,

Hi Mohammad,


I have installed the fonts on the machine where I am using the code. But I am getting the same error. I am getting the same error even if I use a blank document.

I’m getting the same error. If 15.4 is used - error. Revert to the 15.3 Jar with no other changes then the error goes away.

There is a /resources folder inside the Jar but no fonts in there.

We have reverted to 15.3 until this defect is corrected.

Hi,

Can you please try manually setting the location of fonts by following http://www.aspose.com/docs/display/wordsjava/How+to++Specify+True+Type+Fonts+Location and confirm if required fonts are present on that location and you still get the same exception?

Best Regards,

Why is this needed? If the document works with 15.3, but does not work with 15.4 then it’s the release, not the configuration or the document that has the issue. This font is not used in the document.

There’s nothing in the release note to suggest that fanwood is in there or would be needed. The fonts are already in one of the 3 default locations and it works until the 15.4 jar is used. If even fails if the fanwood file is placed there.

Hi Stuart,

GenBasR.ttf was part of 15.3.0 release which has been replaced with Fanwood.otf in 15.5.0 release. No font was included in 15.4.0 release and that is the reason you see this error.

Please test with the latest version i.e. 15.5.0. Hopefully this will resolve the issue.

Best Regards,