java.lang.NoClassDefFoundError

org/apache/lucene/codecs/lucene41/Lucene41PostingsFormat

Samebug tips4

Needs to add netty-transport-native-epoll with a OS classifier to the classpath, it's not included in netty-all

I had to build one fat jar that will include all dependencies from the other jars that i wanted to use.


ThZoisThZois

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web5102

  • via Unknown by Nigel Vivian,
  • via Unknown by andrea patricelli,
  • Stack trace

    • java.lang.NoClassDefFoundError: org/apache/lucene/codecs/lucene41/Lucene41PostingsFormat 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:62) at org.apache.lucene.util.NamedSPILoader.<init>(NamedSPILoader.java:42) at org.apache.lucene.util.NamedSPILoader.<init>(NamedSPILoader.java:37) at org.apache.lucene.codecs.PostingsFormat.<clinit>(PostingsFormat.java:44) at org.apache.lucene.codecs.lucene40.Lucene40Codec.<init>(Lucene40Codec.java:53) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.Class.newInstance(Class.java:442) at org.apache.lucene.util.NamedSPILoader.reload(NamedSPILoader.java:62) at org.apache.lucene.util.NamedSPILoader.<init>(NamedSPILoader.java:42) 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:118) at org.apache.lucene.index.IndexWriterConfig.<init>(IndexWriterConfig.java:145) at no.priv.garshol.duke.databases.LuceneDatabase.openIndexes(LuceneDatabase.java:340) at no.priv.garshol.duke.databases.LuceneDatabase.init(LuceneDatabase.java:314) at no.priv.garshol.duke.databases.LuceneDatabase.index(LuceneDatabase.java:146) at no.priv.garshol.duke.Processor.index(Processor.java:477) at no.priv.garshol.duke.Processor.link(Processor.java:336) at no.priv.garshol.duke.Duke.main_(Duke.java:175) at no.priv.garshol.duke.Duke.main(Duke.java:35) Caused by: java.lang.ClassNotFoundException: org.apache.lucene.codecs.lucene41.Lucene41PostingsFormat 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) ... 27 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    1519 more bugmates