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

XmlPullParserFactory class not found #14

Closed
mebibou opened this issue Jan 26, 2012 · 3 comments
Closed

XmlPullParserFactory class not found #14

mebibou opened this issue Jan 26, 2012 · 3 comments

Comments

@mebibou
Copy link

mebibou commented Jan 26, 2012

Hi Paul,
I tried to create my own ebook from an existing ebook, by modifying stlightly the content to change some text, etc. Now when I try to create it (by doing epubWriter.write(book, new FileOutputStream(file));) I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/xmlpull/v1/XmlPullParserFactory

So I tried to add manually a jar for this, com.springsource.org.xmlpull-1.1.4.jar that I found after 30mins of search for a library that would contain the missing classes, but now get this error:
[ERROR] nl.siegmann.epublib.epub.EpubProcessorSupport - When creating XmlSerializer: org.xmlpull.v1.XmlPullParserException: caused by: org.xmlpull.v1.XmlPullParserException: resource not found: /META-INF/services/org.xmlpull.v1.XmlPullParserFactory make sure that parser implementing XmlPull API is available

Where could I get this library? thanks

@garyhodgson
Copy link

mebibou, i'm not sure if this helps you but I ran into the same problem and I did the following to fix it. It's probably not the correct solution, but it worked for me.

Replaced the kxml2 dependency in epublib-core with xpp3

<dependency>
    <groupId>org.apache.servicemix.bundles</groupId>
    <artifactId>org.apache.servicemix.bundles.xpp3</artifactId>
    <version>1.1.4c_4</version>
</dependency>

I then replaced line 80 of EpubProcessorSupport.java from:
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
to:
XmlPullParserFactory factory = new org.xmlpull.mxp1.MXParserFactory();

I also commented out line 83:
//result.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true);

@mebibou
Copy link
Author

mebibou commented Feb 8, 2012

Hi, thanks for the reply.
I actually managed to resolve the issue by adding the -complete version of the library, i.e. by adding epublib-core-3.0-SNAPSHOT-complete.jar instead of the normal one, and it worked much better. Sorry for not closing the ticket before.

@tokra
Copy link

tokra commented Jan 21, 2016

you can build project with maven: ~/Github/epublib/epublib-core$ mvn compile dependency:copy-dependencies package

and it will get dependencies into ./target/dependency folder

you can copy those all in your project.

apsoyka pushed a commit to apsoyka/epublib that referenced this issue Jun 27, 2016
- See psiegman#14 for further details regarding these changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants