File lock with Aspose.diagram for vsdx file


I have a question related to Aspose.Diagram lib.

I started a project that was using aspose Diagram lib version 18.6.

This project aims to check Office file types before to send them to a rendition solution (based on AEM Forms).

We built a jar file to manage each Office file type based - for each - on aspose’s corresponding lib (aspose.Word for Word, …).

That works fine!

Because I worked on version 18.6 I detected that Visio file with extension VSDX was not so well managed by the version. The autorefresh of data connection was not detected.
I took the oportunity to updated them to 19.5 and aspose.Diagram with 19.6 (latest version).

After several tests, I remarked a strange behavior:

  • the .vsd file can be processed by my check activity, then AEM Forms can process it.
  • the .vsdx file can be processed by my check activity (better with 19.6 than 18.6 :)), then AEM can process it… BUT, AEM cannot clean up the stage (temporary folder) because of a file lock.

I made a test on my local machine with Eclipse debug mode.
I have the same behavior (see attached pictures).
VSDX file processed:file_lock_active.PNG (154.7 KB)
VSD file processed: file_lock_not_active.PNG (148.6 KB)

How can I prevent my environment of this lock? Is it a bug? Do we have a method to clear that at all?

Thank you for your help!

My CheckVisio class :

public class CheckVisio extends Check {

private final String ASPOSE_ERR_WRONGFORMAT = "java.lang.IllegalStateException";
private final String ASPOSE_ERR_CORRUPTED_VSDX = "";
private final String ASPOSE_ERR_CORRUPTED_VSD1 = "Error in element VisioDocument in \\VisioDocument. Error in element DocumentSettings in \\VisioDocument\\DocumentSettings";

public CheckVisio(String filepath, StringBuffer logs) {
	super(filepath, logs);

public void check() throws EmptyFileException, AutoRefreshException, WrongFormatException, CorruptedFileException, Exception {
		// create diagram object for visio document
		Diagram document = new Diagram(filepath);
		String extension = Utils.getExtension(filepath);
		if (document.getDocumentSheet().getName().equals("") && document.getPages().getCount()==0) throw new CorruptedFileException(); 

			DataRecordSetCollection records = document.getDataRecordSets();
			addLog("Document Sheet Name : " + document.getDocumentProps().getTitle());
			//Number of pages 
			addLog("Number of pages: "+ document.getPages().getCount());
			addLog("Number of data connection: "+ document.getDataConnections().getCount());
			addLog("Number of record: "+ records.getCount());
			// test if the data recordset is higher than 1 (then, if this is active) to avoid a popup during opening phase from AEM server	
			for (int i=0;i<records.getCount();i++) {	
				addLog("Record found with Name : "+ records.get(i).getName() + 
						" and interval set to: "+ +records.get(i).getRefreshInterval()						
				if (records.get(i).getRefreshInterval()>=1) throw new AutoRefreshException();		
	}catch (Exception e) {
		switch (e.getClass().getName()) {
			throw new WrongFormatException();
			throw new CorruptedFileException();
			throw new CorruptedFileException();
			throw e;
1 Like


Thanks for contacting support.

Would you please share your sample VSD/VSDX files with us along with sample console application so that we can observe the behavior in our environment and address it accordingly.


You can find the code here : (18.5 KB)

The is used to test it.

The sample VSD/VSDX files: (26.0 KB)


Thanks for sharing sample files.

We have logged an investigation ticket as DIAGRAMJAVA-50660 in our issue tracking system. We will further check this issue in details and keep you posted with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.


Thank you for your reply.
I have several questions related to:

  • How can I follow the case?
  • Do you know the time line for release of bug fix?

Thank you for your help.


We have tried to investigate the scenario using sample project you share but received following error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/omg/CORBA/Object
Caused by: java.lang.ClassNotFoundException: org.omg.CORBA.Object
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(
at java.base/java.lang.ClassLoader.loadClass( 

Can you please share a project which can be run without any exception and reproduce the issue which you are facing.

The issue has been logged in our internal issue management system and you may not have access to it. However, we will keep you informed with the status of its resolution. The issue has been logged under free support model where issues have low priority and are resolved on first come first serve basis. As soon as we make significant progress towards rectification of your issue, we will share with you in this forum thread.

Do you have any mail adress to use to share with secure way all the project files?


You may please share the sample project in a private message in case you need to keep it private. You may send a private message by clicking over username and press blue Message Button. If your project is of larger size, you may upload it to Google Drive or Dropbox and share the link in private message.

I’m experiencing the same problem with Aspose.Diagram for Java v20.5.

Opening a VSDX file (does not happen with VSD file) locks the file and does not release it until the process terminates. In fact, when the file is opened, via public Diagram (String filename, LoadOptions options), ProcessExplorer shows the file opened twice. Also, dispose() has no effect.

It it related to DIAGRAMJAVA-50660? When can we have a fix for this?


We would like to share with you that issue has been fixed and its fix will be available in upcoming version of the API i.e. 20.6 which will be available in next week.

1 Like

@vparent, @cdokolasiac

We would like to share with you that the issue DIAGRAMJAVA-50660 has been fixed in Aspose.Diagram for Java 20.5.1.

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