Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 436D610E3F for ; Fri, 16 Aug 2013 15:53:16 +0000 (UTC) Received: (qmail 2933 invoked by uid 500); 16 Aug 2013 15:53:14 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 2724 invoked by uid 500); 16 Aug 2013 15:53:13 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 2716 invoked by uid 99); 16 Aug 2013 15:53:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Aug 2013 15:53:13 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of uwe@thetaphi.de designates 188.138.97.18 as permitted sender) Received: from [188.138.97.18] (HELO mail.sd-datasolutions.de) (188.138.97.18) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Aug 2013 15:53:07 +0000 Received: from VEGA (unknown [IPv6:2001:1a80:2b00:b001:8e70:5aff:fed1:75a4]) by mail.sd-datasolutions.de (Postfix) with ESMTPSA id 893D214AA043 for ; Fri, 16 Aug 2013 15:52:46 +0000 (UTC) From: "Uwe Schindler" To: References: In-Reply-To: Subject: RE: SPI class of type org.apache.lucene.codecs.Codec error Date: Fri, 16 Aug 2013 17:52:45 +0200 Message-ID: <011f01ce9a98$a6eadf40$f4c09dc0$@thetaphi.de> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHusRf2pe663cj8Da6OmaBbj/py35lXzi3g Content-Language: de X-Virus-Checked: Checked by ClamAV on apache.org Hi, Maven makes it even simplier to handle this! The problem may be (I am = not sure not sure, because I don=E2=80=99t know your setup): It seems that you are using the Maven Shade Plugin to merge all JAR = files into one BIG JAR file. During this step, you may be missing to = merge all the data correctly in your JAR files. Lucene JARs also contain = metadata and other resources (in addition to class files) in the = META-INF folders and those are generally not always merged by all those = tools, so those must be copied and merged if multiple META-INF/services = with same name exist. The Maven-Shade-Plugin can do this for you, see: http://maven.apache.org/plugins/maven-shade-plugin/examples/resource-tran= sformers.html Especially: = http://maven.apache.org/plugins/maven-shade-plugin/examples/resource-tran= sformers.html#ServicesResourceTransformer It is recommended to use the ServicesResourceTransformer option. Ideally, you should not change or transform JAR files of Lucene at all = and not merge them, just ship them with your project as is. Please keep = them separate, only for special use cases like autostarting double-click = JAR files, merge them otherwise management gets crazy. In any case, please check your classpath: - Are the *unmodified* lucene-core.jar files in it? - Don't use crazy classloader hierarchies. Keep all Lucene code together = in one classloader (so don't place Lucene JAR files outside your webapp, = but the code using lucene inside a webapp). - If you create uber-JARS (which is a bad idea in general), use = Maven-Shade plugin and configure it correctly. The Uber-JAR file must = contain a "META-INF/services" folder with some org.apache.lucene.index.* = files. ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: uwe@thetaphi.de > -----Original Message----- > From: Amal Kammoun [mailto:kammoun.amal25@gmail.com] > Sent: Friday, August 16, 2013 5:39 PM > To: java-user@lucene.apache.org > Subject: SPI class of type org.apache.lucene.codecs.Codec error >=20 > Hi, >=20 > We are working on a project which uses Lucene 4.2.1. Actually we are = facing > an error message "java.lang. > ExceptionInInitializerError". We are using Maven for assembling the = project > and we have a dependency between two projects. When we do the test > with eclipse it works fine. However, when we incorporate our jar in a = client > that is tested outside Eclipse we got the = java.lang.ExceptionInInitializerError. > We are doing workaround to overcome the issue since yesterday, we got = the > same issue with both versions of Lucene 4.2.0 and 4.2.1. >=20 > Have you ever experienced such an issue with maven? Are the newer > Lucene versions safer from such an issue? >=20 > Here is the rest of the message error > Caused by: 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. >=20 > Thank you a lot in advance for your support. > Best regards, --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org