File lock with Aspose.diagram for vsdx file


#1

Hello,

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 = "java.util.zip.ZipException";
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);
}

@Override
public void check() throws EmptyFileException, AutoRefreshException, WrongFormatException, CorruptedFileException, Exception {
	//
	super.check();
	//
	try{
		// 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());
			document=null;
			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();		
			}
			records=null;
						
	}catch (Exception e) {
		switch (e.getClass().getName()) {
		case ASPOSE_ERR_WRONGFORMAT:
			throw new WrongFormatException();
		case ASPOSE_ERR_CORRUPTED_VSDX:
			throw new CorruptedFileException();
		case ASPOSE_ERR_CORRUPTED_VSD1:
			throw new CorruptedFileException();
		default: 
			throw e;
		}
		
	}
		
	}
}

#2

@vparent

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.


#3

Hello,

You can find the code here : src.zip (18.5 KB)

The Test.java is used to test it.

The sample VSD/VSDX files: temp.zip (26.0 KB)


#4

@vparent

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.


#5

Hello,

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.


#6

@vparent

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
at com.sanofi.aem.checktools.Test.main(Test.java:35)
Caused by: java.lang.ClassNotFoundException: org.omg.CORBA.Object
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) 

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.


#7

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


#8

@vparent

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.