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:
- Loading and modifying of visio diagrams works (EditConnectorGeometry is running well)
- 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