IllegalArgumentException: URI is not absolute

I have just downloaded your latest Aspose.Word 15.5.0 and am now receiving the following exception when running the following. It is failing on new Document.



System.out.println(“os.name=” + System.getProperty(“os.name”));

System.out.println(“os.version=” + System.getProperty(“os.version”));

System.out.println(“java.version=” + System.getProperty(“java.version”));



System.out.println(“filename=” + filename);



Document document = new Document(filename);







os.name=Windows 7

os.version=6.1

java.version=1.7.0_79

filename=/C:/Users/mike.oakley/IdeaProjects/aspose-examples/target/test-classes/test/image/Template.doc

java.lang.IllegalArgumentException: URI is not absolute

at asposewobfuscated.zz97.toURL(Unknown Source)

at asposewobfuscated.zz9E.zzz9(Unknown Source)

at asposewobfuscated.zzLE.zzQ(Unknown Source)

at asposewobfuscated.zzLE.zzZ2(Unknown Source)

at com.aspose.words.Document.(Unknown Source)

at com.aspose.words.Document.(Unknown Source)

at com.examples.aspose.WordToPdfConvert.convertWord(WordToPdfConvert.java:21)

at com.examples.aspose.WordToPdfConvert.main(WordToPdfConvert.java:51)



sample file attached.

Hi Mike,

Thanks for your inquiry. Perhaps, you are using an older version of Aspose.Words; as with Aspose.Words v15.5.0, I am unable to reproduce this problem on my side. I would suggest you please upgrade to the latest version of Aspose.Words i.e. v15.5.0 and let us know how it goes on your side. I hope, this will help.

Yes and I am not experiencing the problem when my file name is something like the following.

D:\Temp\Linux\Words\Template.doc

I am using the latest version of Aspose.Words v15.5. What the difference appears to be is the filename itself.

This causes the problem and the one above does not.
filename=/C:/Users/mike.oakley/IdeaProjects/aspose-examples/target/test-classes/test/image/Template.doc

Hi Mike,

Thanks for your feedback. Please remove ‘filename=/’ from the path of document. Please check the Document’s constructors from here:
http://www.aspose.com/docs/display/wordsjava/com.aspose.words.Document+class