Unable to use the temporary license - get InvalidURI

My code is raising an exception when comparing 2 word documents. I am using temporary license which I received today. Please help!!

Code:
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.nio.file.Path;

import com.groupdocs.comparison.Comparer;
import com.groupdocs.comparison.license.License;

public class TesterGroupDocsWordCompare {

public static void main(String[] args) {
	// Remove the watermark in output Word document by adding license
    License lic = new License();
    lic.setLicense("GroupDocs.Comparison.Java.lic");
    
	try (Comparer comparer = new Comparer(new FileInputStream("E:\\source.docx"))) {
		comparer.add(new FileInputStream("E:\\target.docx"));
	    final Path resultPath = comparer.compare(new FileOutputStream("E:\\result.docx"));
	    System.out.println("Comparison completed successfully. Please check the result file");
	} catch (Exception e){
		System.out.println(e);
	}
}

}

Error:
Exception in thread “main” class com.groupdocs.comparison.internal.c.a.ms.System.UriFormatException: Invalid URI: The format of the URI could not be determined: MS
com.groupdocs.comparison.internal.c.a.ms.System.Uri.(Unknown Source)
com.groupdocs.comparison.internal.c.a.ms.System.Uri.(Unknown Source)
com.groupdocs.comparison.license.License.a(Unknown Source)
com.groupdocs.comparison.license.License.a(Unknown Source)
com.groupdocs.comparison.license.License.setLicense(Unknown Source)
org.demo.TesterGroupDocsWordCompare.main(TesterGroupDocsWordCompare.java:15)
at com.groupdocs.comparison.internal.c.a.ms.System.Uri.(Unknown Source)
at com.groupdocs.comparison.internal.c.a.ms.System.Uri.(Unknown Source)
at com.groupdocs.comparison.license.License.a(Unknown Source)
at com.groupdocs.comparison.license.License.a(Unknown Source)
at com.groupdocs.comparison.license.License.setLicense(Unknown Source)
at org.demo.TesterGroupDocsWordCompare.main(TesterGroupDocsWordCompare.java:15)

1 Like

@Megha_Rao

Could you please share the source Word files? Do you face this issue for a set of specific files? Also specify the GroupDocs.Comparison for Java API version that you integrated in the application.

source.docx (11.7 KB)
target.docx (11.9 KB)

I have attached the 2 files to be compared.

Version:

com.groupdocs
groupdocs-comparison
22.3

Also, the code works and result is produced if we do not used the license.

It worked fine with 23.3 version. Thank you @atir.tahir for your inputs.

1 Like

@Megha_Rao

Good to know that the issue is resolved.