The sample code has,
- Code: Select all
invitation = new Invitation(templateProperties, InvitationTest.class
.getResource("/template.docx").getPath(), InvitationTest.class
.getResource("/").getPath());
with Invitation having
- Code: Select all
WordprocessingMLPackage template = WordprocessingMLPackage
.load(new File(templateFilePath));
resulting in the following docx4j stack trace
- Code: Select all
org.docx4j.openpackaging.exceptions.Docx4JException: Couldn't load file from C:\Users\Karsten%20Tinnefeld\Desktop\hello.world.docx4j\target\test-classes\template.docx
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:186)
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(WordprocessingMLPackage.java:169)
at com.myucel.docx4j.Invitation.invite(Invitation.java:44)
[...]
Caused by: java.io.FileNotFoundException: C:\Users\Karsten%20Tinnefeld\Desktop\hello.world.docx4j\target\test-classes\template.docx (Das System kann den angegebenen Pfad nicht finden)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:183)
... 31 more
Is this a problem which can be cured by fixing docx4j or just windows file system / java nio stupidity?