When I run the org.apache.pdfbox.examples.pdmodel.ExtractMetadata example,
it works. However when I put the same code into my class, it throws an
exception when I call "DomXmpParser xmpParser = new DomXmpParser();" The
trace is:
java.lang.AbstractMethodError:
javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V
at org.apache.xmpbox.xml.DomXmpParser.<init>(DomXmpParser.java:81)
at
com.jthad.util.image.MetadataExtractor.getPdfMetadata(MetadataExtractor.java:170)
at
com.
jthad.util.image.TestMetadataExtractor.testPdf0(TestMetadataExtractor.java:41)
...
Line 81 in DomXmpParser.java is
dbFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl",
true);
I am at a loss to understand how "new DomXmpParser()" works from the
command line but fails when called by a JUnit test in Eclipse.
--
"Hell hath no limits, nor is circumscrib'd In one self-place; but where we
are is hell, And where hell is, there must we ever be" --Christopher
Marlowe, *Doctor Faustus* (v. 121-24)