You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tika.apache.org by Stefan Burger <sb...@emich.edu> on 2010/02/10 03:31:18 UTC

NoClassDefFoundError PDFParser OSGi

Hi,

I'm new at TIKA and also on this mailing list.

I use the TIKA 0.6 bundle under eclipse to extract metadata from files and it works with all kind of files except PDFs. 
I get the error message below. 
The code was tested with several PDF's. Also, I tested the PDF's with an older program, which is working under TIKA 0.5. And there the PDFs can be read. 

Can anybody help me?

All regards
Stefan

org.osgi.framework.BundleException: Exception in edu.emich.compsci.virtus.metadata.Activator.start() of bundle edu.emich.compsci.virtus.Metadata.
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
        at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:352)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:280)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:272)
        at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:253)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:303)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:288)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:224)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.pdfbox.pdfparser.PDFParser
        at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:840)
        at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:808)
        at org.apache.tika.parser.pdf.PDFParser.parse(PDFParser.java:53)
        at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:120)
        at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:101)
        at edu.emich.compsci.virtus.metadata.extractor.MetaDataExtractor.getMetaData(MetaDataExtractor.java:62)
        at edu.emich.compsci.virtus.metadata.Activator.start(Activator.java:21)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
        ... 14 more
Nested Exception:
java.lang.NoClassDefFoundError: Could not initialize class org.apache.pdfbox.pdfparser.PDFParser
        at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:840)
        at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:808)
        at org.apache.tika.parser.pdf.PDFParser.parse(PDFParser.java:53)
        at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:120)
        at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:101)
        at edu.emich.compsci.virtus.metadata.extractor.MetaDataExtractor.getMetaData(MetaDataExtractor.java:62)
        at edu.emich.compsci.virtus.metadata.Activator.start(Activator.java:21)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
        at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:352)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:280)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:272)
        at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:253)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:303)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:288)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:224)
        at java.lang.Thread.run(Unknown Source)
Nested Exception:
java.lang.NoClassDefFoundError: Could not initialize class org.apache.pdfbox.pdfparser.PDFParser
        at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:840)
        at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:808)
        at org.apache.tika.parser.pdf.PDFParser.parse(PDFParser.java:53)
        at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:120)
        at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:101)
        at edu.emich.compsci.virtus.metadata.extractor.MetaDataExtractor.getMetaData(MetaDataExtractor.java:62)
        at edu.emich.compsci.virtus.metadata.Activator.start(Activator.java:21)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
        at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:352)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:280)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:272)
        at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:253)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:303)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:288)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:224)
        at java.lang.Thread.run(Unknown Source)

osgi> 

Re: NoClassDefFoundError PDFParser OSGi

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Wed, Feb 10, 2010 at 3:31 AM, Stefan Burger <sb...@emich.edu> wrote:
> I use the TIKA 0.6 bundle under eclipse to extract metadata from files and it
> works with all kind of files except PDFs. I get the error message below. The
> code was tested with several PDF's. Also, I tested the PDF's with an older
> program, which is working under TIKA 0.5. And there the PDFs can be read.

PDFBox 0.8.0 uses commons-logging. It's declared as an optional
dependency in the Tika 0.6 bundle, but you'll need to have it in your
classpath (or OSGi environment) for the PDF parser to work.

BR,

Jukka Zitting