- Code: Select all
Caused by: java.lang.NullPointerException
at org.docx4j.org.xhtmlrenderer.layout.BoxBuilder.createChildren(BoxBuilder.java:205)
at org.docx4j.org.xhtmlrenderer.layout.BoxBuilder.createChildren(BoxBuilder.java:312)
at org.docx4j.org.xhtmlrenderer.render.BlockBox.ensureChildren(BlockBox.java:919)
at org.docx4j.org.xhtmlrenderer.layout.BoxBuilder.createChildren(BoxBuilder.java:173)
at org.docx4j.org.xhtmlrenderer.layout.BoxBuilder.createChildren(BoxBuilder.java:312)
at org.docx4j.org.xhtmlrenderer.render.BlockBox.ensureChildren(BlockBox.java:919)
at org.docx4j.org.xhtmlrenderer.render.BlockBox.isVerticalMarginsAdjoin(BlockBox.java:1260)
at org.docx4j.org.xhtmlrenderer.render.BlockBox.collapseMargins(BlockBox.java:1087)
at org.docx4j.org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:780)
at org.docx4j.org.xhtmlrenderer.render.BlockBox.layout(BlockBox.java:735)
at org.docx4j.org.xhtmlrenderer.docx.DocxRenderer.layout(DocxRenderer.java:187)
at org.docx4j.convert.in.xhtml.XHTMLImporter.convert(XHTMLImporter.java:413)
....
The problem is the statement
- Code: Select all
parent.getLocalName().equals("script")
is not null-safe, it should be the opposite:
- Code: Select all
"script".equals(parent.getLocalName())
By the way i guess this is hiding a more insidious library issue.
At runtime
- Code: Select all
parent.getLocalName()
This is why I think docx4j is relying on the wrong library, moreover xercesImpl is not among its dependencies, so my question is: how did it happen to use such library?
Since none on the googlable web has encountered such problem, I guess there's something really trivial I'm missing maybe has not even anything to do with the library (best programmer award drifting away from me too)
Any hint?