Hi, This generally happens if you don't deploy the original Lucene JAR files and instead create so-called super-jars (one large JAR file with all classes merged together). Unfortunately this approach misses to copy/merge relevant metadata in the META-INF folder of the original JARs. Without the metadata, Lucene cannot open the indexes.
If you place the original JAR files in your WEB-INF/lib folders, everything should work fine unless you have some very strange class path / class loader problems. You should also upgrade to a later Lucene 4 version, because the original one (4.0) was only searching in context class loader for metadata. Lucene 4.3 fixes this issue by also searching for metadata in the classloader that originally loaded the lucene jars: https://issues.apache.org/jira/browse/LUCENE-4713 Uwe ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: [email protected] > -----Original Message----- > From: Rajendra Rao [mailto:[email protected]] > Sent: Thursday, April 30, 2015 3:52 PM > To: [email protected] > Subject: getting exception in lucene 4.0 > > i am getting below exception while using apache lucene in web service with > tomcat ,axis 2 .This exception is not coming in standalone application. > > Java.lang.IllegalArgumentException: A SPI class of type > org.apache.lucene.codecs.Codec with name 'Lucene42' does not exist. You > need to add the corresponding JAR file supporting this SPI to your > classpath.The current classpath supports the following names: [] > at > org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:104) > > at org.apache.lucene.codecs.Codec.forName(Codec.java:95) > at org.apache.lucene.codecs.Codec.<clinit>(Codec.java:122) > ... 37 more > > -- > Launchship Technology respects your privacy. This email is intended only for > the use of the party to which it is addressed and may contain information > that is privileged, confidential, or protected by law. If you have received > this > message in error, or do not want to receive any further emails from us, > please notify us immediately by replying to the message and deleting it from > your computer. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
