kamranzafar / JCL

Jar Class Loader, a configurable and dynamic custom classloader designed to create, manage and manipulate isolated Java classloaders in IoC frameworks and web applications.
http://kamranzafar.github.com/
579 stars 161 forks source link

New SPI issues in 1.7 #47

Open Alex-Ikanow opened 8 years ago

Alex-Ikanow commented 8 years ago

I originally posted this under the closed #32 but it should live in its own issue since it's a different but related bug.

I just jumped from 2.4 to 2.7 (to fix the intermittent Java8 concurrent modification exception), and now I can no longer create an Elasticsearch (1.7 aka Lucene 2.10.4) Client object, eg

Thread.currentThread().setContextClassLoader(jcl_classloader);

                final ImmutableSettings.Builder test_settings = 
                        ImmutableSettings.settingsBuilder()
                            .put("cluster.name", "aleph2")
                            .put("node.gateway.type", "none")
                            .put("index.store.type", "memory")
                            .put("index.number_of_replicas", 0)
                            .put("index.number_of_shards", 1)
                            .put("node.http.enabled", false);                                       
                NodeBuilder.nodeBuilder().settings(test_settings).loadConfigSettings(false).node();             

will exception out with

An SPI class of type org.apache.lucene.codecs.Codec with name 'Lucene410' does not exist.  You need to add the corresponding JAR file supporting this SPI to your classpath.  The current classpath supports the following names: []: IllegalArgumentException]:[NamedSPILoader.java:109:org.apache.lucene.util.NamedSPILoader:lookup]

Identical code works with 2.4, 2.5, 2.6

(EDIT: obviously I can provide more details, just wanted to give an overview of the issue to start with)