I found the problem with the code.
Is a test configuration issue.
The pluginsService class loads plugin from plugin.types information, but it
calls another method,
tupleBuilder.addAll(loadPluginsFromClasspath(settings));
The loadPluginsFromClasspath, in my case it find my plugin another time.
It's for this reason that we have encountered the specified error.
Regards,
Le mardi 9 septembre 2014 07:46:45 UTC+2, Jean-Bernard Damiano a écrit :
>
> Hello,
>
> I'm encountered an issue when Elasticsearch 1.3.2 and the test.
>
> The test suite is configure like this:
> @ClusterScope(scope = ElasticsearchIntegrationTest.Scope.SUITE,
> numDataNodes = 2)
> public abstract class AbstractRestActionTest extends
> ElasticsearchIntegrationTest {
>
>
> @Override
> protected Settings nodeSettings(int nodeOrdinal) {
> Settings settings = ImmutableSettings.settingsBuilder()
> .put(super.nodeSettings(nodeOrdinal))
> .put("plugins." + PluginsService.
> LOAD_PLUGIN_FROM_CLASSPATH, true)
> .put("plugin.types", InOutPlugin.class.getName())
> .put("index.number_of_shards", defaultShardCount())
> .put("index.number_of_replicas", 0)
> .put("http.enabled", false)
> .build();
> return settings;
> }
>
>
> @Override
> public Settings indexSettings() {
> return settingsBuilder().put("index.number_of_shards",
> defaultShardCount()).put("index.number_of_replicas", 0).build();
> }
>
>
> public void setupTestIndexLikeUsers(String indexName, int shards,
> boolean loadTestData) throws IOException {
> System.out.println("CreateIndex "+ indexName);
> assertAcked(prepareCreate(indexName).setSettings(settingsBuilder
> ().put("index.number_of_shards", shards).put("index.number_of_replicas", 0
> ))
> .addMapping("d", jsonBuilder().startObject()
> .startObject("d")
> .startObject("properties")
> .startObject("name")
> .field("type", "string")
> .field("index", "not_analyzed")
> .field("store", "yes")
> .endObject()
> .endObject()
> .endObject()));
> ensureGreen(indexName);
>
>
> if (loadTestData) {
> index(indexName, "d", "1", "name", "car");
> index(indexName, "d", "2", "name", "bike");
> index(indexName, "d", "3", "name", "train");
> index(indexName, "d", "4", "name", "bus");
> }
> refresh();
> waitForRelocation();
> }
>
>
> The plugins register RestModule and ActionModule like this:
>
> public void onModule(RestModule restModule) {
> restModule.addRestAction(RestExportAction.class);
> restModule.addRestAction(RestImportAction.class);
> restModule.addRestAction(RestSearchIntoAction.class);
> restModule.addRestAction(RestDumpAction.class);
> restModule.addRestAction(RestRestoreAction.class);
> restModule.addRestAction(RestReindexAction.class);
> }
> public void onModule(ActionModule module) {
> if (!settings.getAsBoolean("node.client", false)) {
> module.registerAction(ExportAction.INSTANCE,
> TransportExportAction.class);
> module.registerAction(ImportAction.INSTANCE,
> TransportImportAction.class);
> module.registerAction(SearchIntoAction.INSTANCE,
> TransportSearchIntoAction.class);
> module.registerAction(DumpAction.INSTANCE,
> TransportDumpAction.class);
> module.registerAction(RestoreAction.INSTANCE,
> TransportRestoreAction.class);
> module.registerAction(ReindexAction.INSTANCE,
> TransportReindexAction.class);
> }
> }
>
>
>
> Another module is registered for map binding like this in the code of
> plugin:
>
>
> @Override
> public Collection<Class<? extends Module<span style="color: #660;"
> class="sty
> ...
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/0f093ce6-cfe2-48f1-a5ba-f6a0aad63bf8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.