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)