Resource not found on saving diagram (aspose.diagram Java 19.4)

Hello Aspose team, hello community!

Using Aspose.Diagram for Java I get java.lang.IllegalStateException: Cannot find resource {0}. when saving a Diagram to png image.
This works well on Windows workstations and also on CentOS based Oracle Linux distribution. It fails however on our production server environment.

The problematic platform is:

  • OS: SLES 11 SP3 (x86_64)
  • JDK: OpenJDK (zulu) 1.8.0_192 or 1.8.0_202
  • aspose diagram 19.4
  • Kernel: 3.0.101-0.47.106.56-xen

I could strip down the issue to a few lines of codes (see below).
I strongly suspect my problem is a missing font or some other graphics related resource because:

  1. Loading and modifying of visio diagrams works (EditConnectorGeometry is running well)
  2. All my working platforms are either Windows or desktop optimized linux versions

Java snippet:

File inFile = new File("visio/file/path/...");
String outFileName = "save/it/here.png";
byte inBytes[] = java.nio.file.Files.readAllBytes(inFile.toPath());
Diagram d = new Diagram(new ByteArrayInputStream(inBytes));
d.save(outFileName, SaveFileFormat.PNG);

Resulting trace:

JVM: 1.8.0_202
Loading 'visio.vsdx'
Creating diagram
Writing 'visio.vsdx.png'
Cannot find resource {0}.
Exception in thread "main" java.lang.IllegalStateException: Cannot find resource {0}.
        at com.aspose.diagram.a.c.q.a(Unknown Source)
        at com.aspose.diagram.a.d.ba.i(Unknown Source)
        at com.aspose.diagram.a.d.ba.g(Unknown Source)
        at com.aspose.diagram.a.d.ba.d(Unknown Source)
        at com.aspose.diagram.a.d.bc.a(Unknown Source)
        at com.aspose.diagram.a.d.bc.a(Unknown Source)
        at com.aspose.diagram.a.d.bc.a(Unknown Source)
        at com.aspose.diagram.nb.<init>(Unknown Source)
        at com.aspose.diagram.gg.a(Unknown Source)
        at com.aspose.diagram.gg.b(Unknown Source)
        at com.aspose.diagram.gg.a(Unknown Source)
        at com.aspose.diagram.gg.a(Unknown Source)
        at com.aspose.diagram.ps.a(Unknown Source)
        at com.aspose.diagram.ps.a(Unknown Source)
        at com.aspose.diagram.Diagram.a(Unknown Source)
        at com.aspose.diagram.Diagram.save(Unknown Source)
        at test.SimpleVisioDemo.main(SimpleVisioDemo.java:33)

Thanks for your help!
Martin

@martin.n

Could you please share your sample diagram file with us so that we can further investigate the scenario accordingly.

Hello, thanks for reply!
I attached a diagram where the issue is visible. It is an aspose generated visio file from the examples code.
Please note that I can not save the whole thing is problematic only on one of our platforms.
I’m very interested what resource is missing but I can not see anything from the stack trace without the source code.

Best regards,
Martin

EditConnectorGeometry_Out.zip (22.1 KB)

@martin.n

Yes, it seems environment specific issue as API is converting your Diagram into PNG Image correctly while running in Windows and Linux environments. Therefore, we have logged an investigation ticket as DIAGRAMJAVA-50656 in our issue tracking system. We will further look into details of the scenario and keep you posted with the status of ticket resolution. Please spare us little time.

We are sorry for the inconvenience.

Hello Aspose team,

Is there a possibility to accelerate the investigation? The library works great in the development environment. Only when it is deployed on the BMW server, it terminates with an exception. So we cannot really use it ;-(.
It would be great if you could fix the error soon or tell us what we can do to avoid the error.

Thank you for your help!
Alex

@aheffner

The issues logged under free support model are resolved on first come first serve basis and there are other issues which were logged prior to this. However, we have recorded your concerns and will definitely consider them during investigation of the logged ticket. We will surely let you know as soon as we have some definite updates in this regard. Please spare us little time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as DIAGRAMJAVA-50656) have been fixed in Aspose.Diagram for Java 19.5.

I confirm the IllegalStateException is gone with 19.5
Thank you @asad.ali and aspose team!