OutputStream os = new java.io.FileOutputStream(outputfilepath);
Docx4J.toFO(foSettings, os, Docx4J.FLAG_EXPORT_PREFER_XSL);
This finally reported an error.
phpcn_u15822017-05-17 10:04:34
I have solved it with the help of a friend. It was an error caused by the lack of jar package and the wrong jar version.