Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException on EPUB containing SVG image with DublinCore metadata(?) #1514

Closed
kingjon3377 opened this issue May 4, 2023 · 2 comments · Fixed by #1523
Closed

NullPointerException on EPUB containing SVG image with DublinCore metadata(?) #1514

kingjon3377 opened this issue May 4, 2023 · 2 comments · Fixed by #1523
Assignees
Labels
status: accepted Ready to be further processed type: bug The issue describes a bug
Milestone

Comments

@kingjon3377
Copy link

I'm getting a NullPointerException when I try to run EpubCheck 5.0.1 on my EPUBs. I've managed to prepare a reasonably minimal example (attached, renamed to .ZIP: minimal.zip; constructed from this minimal EPUB project (with its errors fixed up) and then this public-domain SVG image embedded). The command-line output, including the stacktrace, is as follows:

Validating using EPUB version 3.3 rules.
java.lang.NullPointerException: Cannot invoke "java.util.Map.put(Object, Object)" because "this.mediaSources" is null
	at com.adobe.epubcheck.ops.OPSHandler30.startMediaSource(OPSHandler30.java:614)
	at com.adobe.epubcheck.ops.OPSHandler30.startElement(OPSHandler30.java:421)
	at com.adobe.epubcheck.xml.handlers.XMLHandler.startElement(XMLHandler.java:115)
	at com.adobe.epubcheck.xml.handlers.DelegateDefaultHandler.startElement(DelegateDefaultHandler.java:170)
	at com.adobe.epubcheck.xml.handlers.WrappingDefaultHandler.startElement(WrappingDefaultHandler.java:95)
	at com.adobe.epubcheck.xml.handlers.PreprocessingDefaultHandler.startElement(PreprocessingDefaultHandler.java:59)
	at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
	at com.adobe.epubcheck.xml.XMLParser.process(XMLParser.java:176)
	at com.adobe.epubcheck.ops.OPSChecker.validate(OPSChecker.java:127)
	at com.adobe.epubcheck.ops.OPSChecker.checkContent(OPSChecker.java:97)
	at com.adobe.epubcheck.opf.PublicationResourceChecker.check(PublicationResourceChecker.java:45)
	at com.adobe.epubcheck.opf.OPFChecker.checkItemContent(OPFChecker.java:398)
	at com.adobe.epubcheck.opf.OPFChecker.checkPackage(OPFChecker.java:136)
	at com.adobe.epubcheck.opf.OPFChecker30.checkPackage(OPFChecker30.java:67)
	at com.adobe.epubcheck.opf.OPFChecker.check(OPFChecker.java:94)
	at com.adobe.epubcheck.ocf.OCFChecker.check(OCFChecker.java:173)
	at com.adobe.epubcheck.api.EpubCheck.doValidate(EpubCheck.java:218)
	at com.adobe.epubcheck.tool.EpubChecker.validateFile(EpubChecker.java:245)
	at com.adobe.epubcheck.tool.EpubChecker.processFile(EpubChecker.java:320)
	at com.adobe.epubcheck.tool.EpubChecker.run(EpubChecker.java:145)
	at com.adobe.epubcheck.tool.Checker.main(Checker.java:31)
Messages: 0 fatals / 0 errors / 0 warnings / 0 infos

EPUBCheck completed
@shiestyle
Copy link

We found a similar case when navigation document has an incorrect link.

<nav epub:type="toc" id="toc">
<h1>Navigation</h1>
<ol>
<li><a href="xhtml/p-cover.xhtml">cover</a></li>
<li><a href="xhtml/p-001.xhtml#xxx">p-001</a></li>
</ol>
</nav>

If p-001.xhtml doesn't have an anchor #xxx, NullPointerException will be occurred.

@rdeltour
Copy link
Member

rdeltour commented May 4, 2023

Definitely looks like a bug. Thanks for the report @kingjon3377!

@shiestyle yours seem to be a different case, would you mind opening a separate issue?

@rdeltour rdeltour self-assigned this May 4, 2023
@rdeltour rdeltour added type: bug The issue describes a bug status: accepted Ready to be further processed labels May 4, 2023
@rdeltour rdeltour added this to the Next maintenance release milestone May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepted Ready to be further processed type: bug The issue describes a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants