[
https://issues.apache.org/jira/browse/SMX4-1637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13925103#comment-13925103
]
Aritra Chatterjee commented on SMX4-1637:
-----------------------------------------
Is this fix verified? I'm using the 1.0.0 SNAPSHOT and I'm getting the
following error when trying to create an index:
Command: curl -XPUT localhost:9200/twitter/tweet/1 -d '{a:b,c:d}'
Got following error:
{"error":"IndexCreationException[[twitter] failed to create index]; nested:
ServiceConfigurationError[A SPI class of type
org.apache.lucene.codecs.PostingsFormat with classname
org.elasticsearch.index.codec.postingsformat.ElasticSearch090PostingsFormat
does not exist, please fix the file
'META-INF/services/org.apache.lucene.codecs.PostingsFormat' in your
classpath.]; ","status":500}
> ElasticSearch bundle 0.90.5 does not work as SPI is not supported
> -----------------------------------------------------------------
>
> Key: SMX4-1637
> URL: https://issues.apache.org/jira/browse/SMX4-1637
> Project: ServiceMix 4
> Issue Type: Bug
> Components: Bundles
> Reporter: Charles Moulliard
> Assignee: Jean-Baptiste Onofré
> Fix For: bundles-2013.12
>
>
> Existing bundle of SMX - ElasticSearch bundle 0.90.5 does not support SPI
> (Service Locator) and in consequence classes cannot be retrieved :
> {code}
> Caused by: java.lang.IllegalArgumentException: A SPI class of type
> org.apache.lucene.codecs.PostingsFormat with name 'Memory' does not exist.
> You need to add the corresponding JAR file supporting this SPI to your
> classpath.The current classpath supports the following names: [XBloomFilter,
> es090, completion090, Direct]
> at
> org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:109)[75:org.apache.servicemix.bundles.elasticsearch:0.90.5.2-SNAPSHOT]
> at
> org.apache.lucene.codecs.PostingsFormat.forName(PostingsFormat.java:100)[75:org.apache.servicemix.bundles.elasticsearch:0.90.5.2-SNAPSHOT]
> at
> org.elasticsearch.index.codec.postingsformat.PostingFormats.<clinit>(PostingFormats.java:70)[75:org.apache.servicemix.bundles.elasticsearch:0.90.5.2-SNAPSHOT]
> ... 15 more
> {code}
> That means that Require and Provide-Capibility must be added to the MANIFEST
> file generated
> {code}
> <Provide-Capability>
> osgi.serviceloader;
> osgi.serviceloader=org.apache.lucene.codecs.Codec,
> osgi.serviceloader;
> osgi.serviceloader=org.apache.lucene.codecs.PostingsFormat,
> osgi.serviceloader;
> osgi.serviceloader=org.apache.lucene.codecs.DocValuesFormat
> </Provide-Capability>
> <Require-Capability>
> osgi.extender;
> filter:="(osgi.extender=osgi.serviceloader.registrar)"
> </Require-Capability>
> {code}
> and that the files located under META-INF/Services must be merged.
> Remark : As split-package does not work in this situation, the workaround has
> been to add as resources files, the files resulting from the merge between
> classes of lucene-core and elasticsearch
> {code}
> org.apache.lucene.codecs.Codec
> org.apache.lucene.codecs.DocValuesFormat
> org.apache.lucene.codecs.PostingsFormat
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)