title: What causes err ' A SPI class of type lucene.codecs.Codec name 'Lucene42'
body: <p>Can't figure out what is causing ' 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'</p>
  
  <p>Any help would be appreciated</p>
  
  <pre><code>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: []
  org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:104)
  org.apache.lucene.codecs.Codec.forName(Codec.java:95)
  org.apache.lucene.codecs.Codec.&lt;clinit&gt;(Codec.java:122)
  org.apache.lucene.index.LiveIndexWriterConfig.&lt;init&gt;(LiveIndexWriterConfig.java:118)
  org.apache.lucene.index.IndexWriterConfig.&lt;init&gt;(IndexWriterConfig.java:145)
  com.damn.fr.rr.rent.getResukt(Man.java:404)
  com.damn.fr.rr.handler.pg.setResult(pg.java:103)
  com.damn.fr.rr.cmd.del.execute(del.java:19)
  com.damn.fr.rr.servlet.PublicController.doPost(controller.java:199)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
  </code></pre>
  
  <p>Jboss deployment folder path 'C:\JBAS\modules\org\apache\lucene\main' and directory contents
  <img src="https://i.stack.imgur.com/6DS0K.png" alt="enter image description here"></p>
  
  <p>jboss-deployment-structure.xml</p>
  
  <pre><code>    &lt;sub-deployment name="damn.jar"&gt;
      &lt;dependencies&gt;
          &lt;module name="org.apache.commons.fileupload" /&gt;
          &lt;module name="org.apache.commons.io" /&gt;
          &lt;module name="org.apache.commons.lang3" /&gt;
          &lt;module name="org.apache.commons.validator" /&gt;
          &lt;module name="org.apache.lucene" /&gt;
          &lt;module name="net.sf.jasperreports" /&gt;
          &lt;module name="com.google.gson" /&gt;
  
      &lt;/dependencies&gt;
  &lt;/sub-deployment&gt;
  </code></pre>
  
  <p>module.xml</p>
  
  <pre><code>&lt;module xmlns="urn:jboss:module:1.0" name="org.apache.lucene"&gt;
  &lt;resources&gt;
  &lt;resource-root path="lucene-analyzers-common-4.2.0.jar"/&gt;
  &lt;resource-root path="lucene-core-4.2.0.jar"/&gt;
  &lt;resource-root path="lucene-queryparser-4.2.0.jar"/&gt;
  &lt;resource-root path="lucene-codecs-4.2.0.jar"/&gt;
  &lt;/resources&gt;
  
  &lt;dependencies&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p></p>
  
  <p>ant build file segment</p>
  
  <pre><code>&lt;pathelement path="${thirdPartyDir}/lucene-analyzers-common-4.2.0.jar" /&gt;
  &lt;pathelement path="${thirdPartyDir}/lucene-codecs-4.2.0.jar" /&gt;
  &lt;pathelement path="${thirdPartyDir}/lucene-queryparser-  4.2.0.jar" /&gt;
  &lt;pathelement path="${thirdPartyDir}/lucene-core-4.2-SNAPSHOT.jar" /&gt;
  </code></pre>