java.lang.NoSuchMethodError: 'void org.docx4j.finders.RangeFinder.<init>(java.lang.String, java.lang.String)'
at org.docx4j.convert.in.xhtml.BookmarkHelper.initBookmarkIdStart(BookmarkHelper.java:91)
at org.docx4j.convert.in.xhtml.BookmarkHelper.getBookmarkId(BookmarkHelper.java:82)
at org.docx4j.convert.in.xhtml.BookmarkHelper.anchorToBookmark(BookmarkHelper.java:187)
at org.docx4j.convert.in.xhtml.XHTMLImporterImpl.traverseBlockBox(XHTMLImporterImpl.java:1034)
at org.docx4j.convert.in.xhtml.XHTMLImporterImpl.traverse(XHTMLImporterImpl.java:995)
at org.docx4j.convert.in.xhtml.XHTMLImporterImpl.traverse(XHTMLImporterImpl.java:986)
at org.docx4j.convert.in.xhtml.XHTMLImporterImpl.convert(XHTMLImporterImpl.java:788)
at.....WordToPdfUtil.convertHtmlToWordListObject(WordToPdfUtil.java:946)
org.docx4j.finders.RangeFinder class seems to have changed in 8.3.10 where the constructor that takes the bookmark start and end was removed. Seems to be an issue where the latest lib for the converter references code in the core package that was changed.
This is not in any versions starting 8.3.10 8.2.9 has it
- Code: Select all
public RangeFinder(String startElement, String endElement) {
this.startElement = "org.docx4j.wml." + startElement;
this.endElement = "org.docx4j.wml." + endElement;
}
The old constructor is being called from BookmarkHelper.java which is in the 11.4.8 lib for docx4j-ImportXHTML-11.4.8.jar
- Code: Select all
private int initBookmarkIdStart() {
int highestId = 0;
RangeFinder rt = new RangeFinder("CTBookmark", "CTMarkupRange");
new TraversalUtil(wordMLPackage.getMainDocumentPart().getContent(), rt);
for (CTBookmark bm : rt.getStarts()) {
BigInteger id = bm.getId();
if (id!=null && id.intValue()>highestId) {
highestId = id.intValue();
}
}
return highestId;
}
How can we get this resolved.