jprante / elasticsearch-analysis-skos

SKOS analysis for Elasticsearch
Apache License 2.0
54 stars 24 forks source link

ClassNotFoundException[skos]; ","status":500 #1

Closed jdspersonal closed 12 years ago

jdspersonal commented 12 years ago

Hi, I am really interested to see a SKOS plugin for ES.

When I test with:

curl -XPOST 'http://localhost:9200/test' -d '{ "settings" : { "index" : { "analysis" : { "filter": { "skosfilter" : { "type": "skos", "skosFile": "ukat_examples.n3", "expansionType": "URI" } }, "analyzer" : { "skos" : { "type" : "custom", "tokenizer" : "keyword", "filter" : "skosfilter" } } } } }, "mappings" : { "default" : { "properties" : { "subject" : { "type" : "string", "index_analyzer" : "skos", "search_analyzer" : "standard" } } } }
}'

I get:

{"error":"IndexCreationException[[test] failed to create index]; nested: ElasticSearchIllegalArgumentException[failed to find token filter type [skos] for [skosfilter]]; nested: NoClassSettingsException[Failed to load class setting [type] with value [skos]]; nested: ClassNotFoundException[skos]; ","status":500}

Am I missing something?

Thanks

jprante commented 12 years ago

Seems like the plugin installation failed, can you check it in the logs?

jdspersonal commented 12 years ago

When installing I get a a positive response.

-> Installing jprante/elasticsearch-analysis-skos/1.0.0... Trying https://github.com/downloads/jprante/elasticsearch-analysis-skos/elasticsearch-analysis-skos-1.0.0.zip... Downloading ...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................DONE Installed analysis-skos

I checked the logs, there is no error from the plugin install.

I then try the post as before and get:

[2012-08-15 09:41:17,822][WARN ][cluster.metadata ] [Zaladane] [test] failed to create org.elasticsearch.indices.IndexCreationException: [test] failed to create index at org.elasticsearch.indices.InternalIndicesService.createIndex(InternalIndicesService.java:288) at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$1.execute(MetaDataCreateIndexService.java:223) at org.elasticsearch.cluster.service.InternalClusterService$2.run(InternalClusterService.java:211) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: org.elasticsearch.ElasticSearchIllegalArgumentException: failed to find token filter type [skos] for [skosfilter] at org.elasticsearch.index.analysis.AnalysisModule.configure(AnalysisModule.java:221) at org.elasticsearch.common.inject.AbstractModule.configure(AbstractModule.java:60) at org.elasticsearch.common.inject.spi.Elements$RecordingBinder.install(Elements.java:201) at org.elasticsearch.common.inject.spi.Elements.getElements(Elements.java:82) at org.elasticsearch.common.inject.InjectorShell$Builder.build(InjectorShell.java:130) at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:99) at org.elasticsearch.common.inject.InjectorImpl.createChildInjector(InjectorImpl.java:129) at org.elasticsearch.common.inject.ModulesBuilder.createChildInjector(ModulesBuilder.java:66) at org.elasticsearch.indices.InternalIndicesService.createIndex(InternalIndicesService.java:286) ... 5 more Caused by: org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class setting [type] with value [skos] at org.elasticsearch.common.settings.ImmutableSettings.getAsClass(ImmutableSettings.java:243) at org.elasticsearch.index.analysis.AnalysisModule.configure(AnalysisModule.java:211) ... 13 more Caused by: java.lang.ClassNotFoundException: skos at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at org.elasticsearch.common.settings.ImmutableSettings.getAsClass(ImmutableSettings.java:227) ... 14 more

jprante commented 12 years ago

Can you please try

./bin/plugin -install  jprante/elasticsearch-analysis-skos/1.0.1

and see if it works?

jdspersonal commented 12 years ago

Hi, thanks for looking at this.

I installed 1.0.1 and it tells me it is installed ok with no reported errors. No problems reported in the log. I try the POST again and:

{"error":"IndexCreationException[[test] failed to create index]; nested: ElasticSearchIllegalArgumentException[failed to find token filter type [skos] for [skosfilter]]; nested: NoClassSettingsException[Failed to load class setting [type] with value [skos]]; nested: ClassNotFoundException[skos]; ","status":500}

jprante commented 12 years ago

I double checked, with the example you gave above, and it works here (you need to copy the n3 file with the given name before starting ES and you need to use 'default' instead of '_default' in the mapping but that is obviously due to github markdown formatting).

The error means the plugin is not installed at all. It's unable to lookup the new filter tokenizer type name 'skos'.

Can you grep your log for a 'plugins' line such as

[2012-08-15 12:28:48,076][INFO ][plugins                  ] [Copycat] loaded [analysis-combo, analysis-skos, analysis-icu], sites [head]

'analysis-skos' must be displayed. In most cases, it is the second line when starting ES with

./bin/elasticsearch -f
jdspersonal commented 12 years ago

OK. We are getting something different now.

Could it be an issue with another elastic search plugin?

[2012-08-15 10:46:18,055][INFO ][plugins ] [Mantra] loaded [river-rss, tools-carrot2, analysis-skos], sites [] SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/root/elasticsearch-0.19.2/plugins/analysis-skos/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/root/elasticsearch-0.19.2/plugins/carrot2/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]

Many thanks...

jprante commented 12 years ago

No, this is just a warning of SLF4j which is clever enough to continue. In case you are worried, remove one slf4j-log4j12.jar from the plugin folder.

But I think it's a version issue. I have built against 0.19.8. Can you upgrade to 0.19.8, are you really on 0.19.2?

jdspersonal commented 12 years ago

Hey!

I tried a fresh installation with 0.19.8. It works beautifully. Thank you for your time, and thanks for the help, and of course the plugin.

jprante commented 12 years ago

Thanks for your feedback, you're welcome!

jprante commented 10 years ago

Please open a separate issue for that. Do not capture old issues. Thanks.

I'm working on a 0.90 release.