Re: [dkpro-user] LuceneNgram causes NoClassDefFoundError after upgrading to dkpro 1.8.0

2 views
Skip to first unread message

Richard Eckart de Castilho

unread,
Jul 7, 2016, 4:28:36 AM7/7/16
to dkpro-tc-users, dkpro-c...@googlegroups.com
Hi,

this looks more like a DKPro TC issue. Seems like a version mismatch in the Lucene dependency.
Looks like Maven choses the wrong version. You should be able to fix that by adding an explicit
dependency to Lucene to your project's pom. But I don't know what version TC requires.

@TC people: what version of Lucene does TC need?

Cheers,

-- Richard

> On 07.07.2016, at 10:22, 'Mi Woja' via dkpro-core-user <dkpro-c...@googlegroups.com> wrote:
>
> Dear DKPro-Community,
>
> I am working on dkpro-tc project and upgraded recently to dekpro-core 1.8.0
> However, now I get a ClassNotFoundException when using the LuceneNgram (feature extractors - see stack). Everything else is still working properly. Any advice on that?
>
> thanks in advance,
> Michael
>
> Caused by: java.lang.NoClassDefFoundError: org/apache/lucene/codecs/CompoundFormat
> at java.lang.Class.getDeclaredConstructors0(Native Method)
> at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
> at java.lang.Class.getConstructor0(Class.java:3075)
> at java.lang.Class.newInstance(Class.java:412)
> at org.apache.lucene.util.NamedSPILoader.reload(NamedSPILoader.java:67)
> at org.apache.lucene.util.NamedSPILoader.<init>(NamedSPILoader.java:47)
> at org.apache.lucene.util.NamedSPILoader.<init>(NamedSPILoader.java:37)
> at org.apache.lucene.codecs.Codec.<clinit>(Codec.java:41)
> at org.apache.lucene.index.LiveIndexWriterConfig.<init>(LiveIndexWriterConfig.java:122)
> at org.apache.lucene.index.IndexWriterConfig.<init>(IndexWriterConfig.java:148)
> at org.dkpro.tc.features.ngram.meta.LuceneBasedMetaCollector.initialize(LuceneBasedMetaCollector.java:73)
> at org.dkpro.tc.features.ngram.meta.LuceneNGramMetaCollector.initialize(LuceneNGramMetaCollector.java:61)
> at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:262)
> at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:169)
> at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94)
> at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62)
> at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279)
> at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:407)
> at org.apache.uima.analysis_engine.asb.impl.ASB_impl.setup(ASB_impl.java:256)
> at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initASB(AggregateAnalysisEngine_impl.java:429)
> at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initializeAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:373)
> at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initialize(AggregateAnalysisEngine_impl.java:186)
> at org.dkpro.lab.uima.engine.simple.SimpleExecutionEngine.run(SimpleExecutionEngine.java:121)
> ... 10 more
> Caused by: java.lang.ClassNotFoundException: org.apache.lucene.codecs.CompoundFormat
> at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> ... 33 more

Tobias

unread,
Jul 7, 2016, 4:48:56 AM7/7/16
to dkpro-core-user, dkpro-t...@googlegroups.com
We use lucene-core 4.4.0

Mi Woja

unread,
Jul 7, 2016, 5:47:46 AM7/7/16
to dkpro-core-user, dkpro-t...@googlegroups.com
we solved the issue by explicitly adding the lucene dependency and the dependency of dkpro languagetools (which also introduces some lucenen dependency). We are not sure on why it is working now... but it does :)

thanks everybody for the support
-Michael
Reply all
Reply to author
Forward
0 new messages