You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Thodoris Tsompanidis <th...@gmail.com> on 2016/04/27 12:55:25 UTC

Exception in thread "main" java.util.ServiceConfigurationError: Cannot instantiate SPI class: org.apache.lucene.codecs.lucene53.Lucene53Codec

Hello all,

I get a weird exception when i try to run my application from the jar file.
In IDE (IntelliJ IDEA 2016.1.1) it runs properly.
Any help?

Exception in thread "main" java.util.ServiceConfigurationError: Cannot
> instantiate SPI class: org.apache.lucene.codecs.lucene53.Lucene53Codec
>         at
> org.apache.lucene.util.NamedSPILoader.reload(NamedSPILoader.java:77)
>         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$Holder.<clinit>(Codec.java:47)
>         at org.apache.lucene.codecs.Codec.getDefault(Codec.java:140)
>         at
> org.apache.lucene.index.LiveIndexWriterConfig.<init>(LiveIndexWriterConfig.java:120)
>         at
> org.apache.lucene.index.IndexWriterConfig.<init>(IndexWriterConfig.java:140)
>         ......
> Caused by: java.lang.IllegalArgumentException: An SPI class of type
> org.apache.lucene.codecs.PostingsFormat with name 'Lucene50' does not
> exist.  You need to add the corresponding JAR file supporting this SPI to
> your classpath.  The current classpath supports the following names:
> [IDVersion]
>         at
> org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:109)
>         at
> org.apache.lucene.codecs.PostingsFormat.forName(PostingsFormat.java:112)
>         at
> org.apache.lucene.codecs.lucene53.Lucene53Codec.<init>(Lucene53Codec.java:160)
>         at
> org.apache.lucene.codecs.lucene53.Lucene53Codec.<init>(Lucene53Codec.java:80)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
> Source)
>         at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
>         at java.lang.reflect.Constructor.newInstance(Unknown Source)
>         at java.lang.Class.newInstance(Unknown Source)
>         at
> org.apache.lucene.util.NamedSPILoader.reload(NamedSPILoader.java:67)
>         ... 13 more

Re: Exception in thread "main" java.util.ServiceConfigurationError: Cannot instantiate SPI class: org.apache.lucene.codecs.lucene53.Lucene53Codec

Posted by Thodoris Tsompanidis <th...@gmail.com>.
Thank you Denis for the quick reply.


On Wed, Apr 27, 2016 at 2:45 PM, Denis Mone <mo...@gmail.com> wrote:

> You will need to include the lucene codecs artifact in your pom.xml file.
> On Apr 27, 2016 1:55 PM, "Thodoris Tsompanidis" <th...@gmail.com>
> wrote:
>
> > Hello all,
> >
> > I get a weird exception when i try to run my application from the jar
> file.
> > In IDE (IntelliJ IDEA 2016.1.1) it runs properly.
> > Any help?
> >
> > Exception in thread "main" java.util.ServiceConfigurationError: Cannot
> > > instantiate SPI class: org.apache.lucene.codecs.lucene53.Lucene53Codec
> > >         at
> > > org.apache.lucene.util.NamedSPILoader.reload(NamedSPILoader.java:77)
> > >         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$Holder.<clinit>(Codec.java:47)
> > >         at org.apache.lucene.codecs.Codec.getDefault(Codec.java:140)
> > >         at
> > >
> >
> org.apache.lucene.index.LiveIndexWriterConfig.<init>(LiveIndexWriterConfig.java:120)
> > >         at
> > >
> >
> org.apache.lucene.index.IndexWriterConfig.<init>(IndexWriterConfig.java:140)
> > >         ......
> > > Caused by: java.lang.IllegalArgumentException: An SPI class of type
> > > org.apache.lucene.codecs.PostingsFormat with name 'Lucene50' does not
> > > exist.  You need to add the corresponding JAR file supporting this SPI
> to
> > > your classpath.  The current classpath supports the following names:
> > > [IDVersion]
> > >         at
> > > org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:109)
> > >         at
> > >
> org.apache.lucene.codecs.PostingsFormat.forName(PostingsFormat.java:112)
> > >         at
> > >
> >
> org.apache.lucene.codecs.lucene53.Lucene53Codec.<init>(Lucene53Codec.java:160)
> > >         at
> > >
> >
> org.apache.lucene.codecs.lucene53.Lucene53Codec.<init>(Lucene53Codec.java:80)
> > >         at
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > > Method)
> > >         at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
> > > Source)
> > >         at
> > > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
> Source)
> > >         at java.lang.reflect.Constructor.newInstance(Unknown Source)
> > >         at java.lang.Class.newInstance(Unknown Source)
> > >         at
> > > org.apache.lucene.util.NamedSPILoader.reload(NamedSPILoader.java:67)
> > >         ... 13 more
> >
>

Re: Exception in thread "main" java.util.ServiceConfigurationError: Cannot instantiate SPI class: org.apache.lucene.codecs.lucene53.Lucene53Codec

Posted by Denis Mone <mo...@gmail.com>.
You will need to include the lucene codecs artifact in your pom.xml file.
On Apr 27, 2016 1:55 PM, "Thodoris Tsompanidis" <th...@gmail.com>
wrote:

> Hello all,
>
> I get a weird exception when i try to run my application from the jar file.
> In IDE (IntelliJ IDEA 2016.1.1) it runs properly.
> Any help?
>
> Exception in thread "main" java.util.ServiceConfigurationError: Cannot
> > instantiate SPI class: org.apache.lucene.codecs.lucene53.Lucene53Codec
> >         at
> > org.apache.lucene.util.NamedSPILoader.reload(NamedSPILoader.java:77)
> >         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$Holder.<clinit>(Codec.java:47)
> >         at org.apache.lucene.codecs.Codec.getDefault(Codec.java:140)
> >         at
> >
> org.apache.lucene.index.LiveIndexWriterConfig.<init>(LiveIndexWriterConfig.java:120)
> >         at
> >
> org.apache.lucene.index.IndexWriterConfig.<init>(IndexWriterConfig.java:140)
> >         ......
> > Caused by: java.lang.IllegalArgumentException: An SPI class of type
> > org.apache.lucene.codecs.PostingsFormat with name 'Lucene50' does not
> > exist.  You need to add the corresponding JAR file supporting this SPI to
> > your classpath.  The current classpath supports the following names:
> > [IDVersion]
> >         at
> > org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:109)
> >         at
> > org.apache.lucene.codecs.PostingsFormat.forName(PostingsFormat.java:112)
> >         at
> >
> org.apache.lucene.codecs.lucene53.Lucene53Codec.<init>(Lucene53Codec.java:160)
> >         at
> >
> org.apache.lucene.codecs.lucene53.Lucene53Codec.<init>(Lucene53Codec.java:80)
> >         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > Method)
> >         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
> > Source)
> >         at
> > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
> >         at java.lang.reflect.Constructor.newInstance(Unknown Source)
> >         at java.lang.Class.newInstance(Unknown Source)
> >         at
> > org.apache.lucene.util.NamedSPILoader.reload(NamedSPILoader.java:67)
> >         ... 13 more
>