mxp1988 / epubcheck

Automatically exported from code.google.com/p/epubcheck
MIT License
0 stars 0 forks source link

NPE in epubcheck when the rootfile/@full-path is missing #236

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
PROBLEM:

Validating testdoc "Issue95.epub" ( 
http://code.google.com/p/epubcheck/source/browse/branches/epub3/com.adobe.epubch
eck.test/testdocs/20/epub/Issue95.epub ) breaks epubcheck 3.0

Same testdoc works fine with epubcheck 3.0b5.

Please fix this issue or reopen issue #95

METHOD:

1. Start epubcheck 3.0 from commandline:
   java -jar epubcheck-3.0.jar Issue95.epub

RESULT:

$ java -jar epubcheck-3.0.jar Issue95.epub
Epubcheck Version 3.0

java.lang.NullPointerException: name
    at java.util.zip.ZipFile.getEntry(ZipFile.java:156)
    at com.adobe.epubcheck.ocf.OCFZipPackage.getInputStream(OCFZipPackage.java:42)
    at com.adobe.epubcheck.ocf.OCFPackage.getOpfData(OCFPackage.java:121)
    at com.adobe.epubcheck.ocf.OCFChecker.runChecks(OCFChecker.java:137)
    at com.adobe.epubcheck.api.EpubCheck.validate(EpubCheck.java:206)
    at com.adobe.epubcheck.tool.Checker.validateFile(Checker.java:171)
    at com.adobe.epubcheck.tool.Checker.run(Checker.java:227)
    at com.adobe.epubcheck.tool.Checker.main(Checker.java:181)

EXPECTED OUTPUT:

$ java -jar epubcheck-3.0b5.jar Issue95.epub
Epubcheck Version 3.0b5

ERROR: Issue95.epub/META-INF/container.xml: No rootfiles with media type 
'application/oebps-package+xml'

Check finished with warnings or errors

PLATFORM:

* Mac OS X 10.8.2
*java version "1.6.0_37"

Original issue reported on code.google.com by tobias.c...@gmail.com on 29 Dec 2012 at 1:13

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r443.

Original comment by tobias.c...@gmail.com on 24 Mar 2013 at 12:29

GoogleCodeExporter commented 8 years ago
+ additional check for empty full-path attribute.

container.xml of Issue236.epub looks like:
{{{
<?xml version="1.0"?>
<container version="1.0" 
xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
  <rootfiles>
    <rootfile full-path="" media-type="application/oebps-package+xml"/>
    <rootfile media-type="application/oebps-package+xml"/>
  </rootfiles>
</container>
}}}

epubcheck output is:
{{{
Epubcheck Version 3.0.1-SNAPSHOT

ERROR: 
/Users/tobiasfischer/Entwicklung/epubcheck-svn/trunk/src/test/resources/20/epub/
invalid/Issue236.epub/META-INF/container.xml: attribute "full-path" on element 
"rootfile" must not be empty
ERROR: 
/Users/tobiasfischer/Entwicklung/epubcheck-svn/trunk/src/test/resources/20/epub/
invalid/Issue236.epub/META-INF/container.xml: element "rootfile" missing 
required attribute "full-path"

Check finished with warnings or errors
}}}

Original comment by tobias.c...@gmail.com on 24 Mar 2013 at 12:32

GoogleCodeExporter commented 8 years ago

Original comment by tobias.c...@gmail.com on 24 Mar 2013 at 4:10

GoogleCodeExporter commented 8 years ago

Original comment by markus.g...@gmail.com on 26 Mar 2013 at 10:40