我正在尝试按照本教程http://docs.neo4j.org/chunked/milestone/server-plugins.html创建服务器插件
我在eclipse中创建了一个maven项目(按照本教程http://blog.neo4j.org/2012/03/how-to-set-up-maven-project-with-neo4j.html)并添加了必要的依赖项从我在 pom.xml 和 maven 依赖项列表中实际看到的 maven 存储库中,然后我使用目标“干净安装”创建了我的 jar,并将其添加到 neo4j 插件中。
后一个插件已正确添加,我可以通过以下方式进行检查:
curl -v http://localhost:7474/db/data/
但奇怪的是,当我尝试从 shell 运行它时出现以下错误:
我确信在创建 jar 时确实添加了依赖项(我使用:mvn dependency:tree -Dverbose进行了检查,并且还添加了包含此类的包“org.lucene.lucene-spellchecker”)
任何帮助将非常感激。
谢谢
依赖树:
[INFO] org.neo4j.server.plugin.custom:neo4j-didYouMean-plugin:jar:1.9.M05
[INFO] +- junit:junit:jar:3.8.1:test
[INFO] +- org.neo4j:neo4j:jar:1.9.M05:compile
[INFO] | +- org.neo4j:neo4j-kernel:jar:1.9.M05:compile
[INFO] | | \- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
[INFO] | +- org.neo4j:neo4j-lucene-index:jar:1.9.M05:compile
[INFO] | | +- (org.neo4j:neo4j-kernel:jar:1.9.M05:compile - omitted for duplicate)
[INFO] | | \- (org.apache.lucene:lucene-core:jar:3.5.0:compile - omitted for duplicate)
[INFO] | +- org.neo4j:neo4j-graph-algo:jar:1.9.M05:compile
[INFO] | | \- (org.neo4j:neo4j-kernel:jar:1.9.M05:compile - omitted for duplicate)
[INFO] | +- org.neo4j:neo4j-udc:jar:1.9.M05:compile
[INFO] | | \- (org.neo4j:neo4j-kernel:jar:1.9.M05:compile - omitted for duplicate)
[INFO] | +- org.neo4j:neo4j-graph-matching:jar:1.9.M05:compile
[INFO] | | \- (org.neo4j:neo4j-kernel:jar:1.9.M05:compile - omitted for duplicate)
[INFO] | +- org.neo4j:neo4j-cypher:jar:1.9.M05:compile
[INFO] | | +- org.scala-lang:scala-library:jar:2.10.0:compile
[INFO] | | +- (org.neo4j:neo4j-lucene-index:jar:1.9.M05:compile - omitted for duplicate)
[INFO] | | +- (org.neo4j:neo4j-graph-matching:jar:1.9.M05:compile - omitted for duplicate)
[INFO] | | +- (org.neo4j:neo4j-kernel:jar:1.9.M05:compile - omitted for duplicate)
[INFO] | | +- (org.neo4j:neo4j-graph-algo:jar:1.9.M05:compile - omitted for duplicate)
[INFO] | | \- com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap- lru:jar:1.3.1:compile
[INFO] | \- org.neo4j:neo4j-jmx:jar:1.9.M05:compile
[INFO] +- org.neo4j:server-api:jar:1.9.M05:compile
[INFO] | +- (org.neo4j:neo4j-kernel:jar:1.9.M05:compile - omitted for duplicate)
[INFO] | +- org.neo4j.3rdparty.javax.ws.rs:jsr311-api:jar:1.1.2.r612:compile
[INFO] | +- commons-configuration:commons-configuration:jar:1.6:compile
[INFO] | | +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] | | +- commons-lang:commons-lang:jar:2.4:compile
[INFO] | | +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] | | \- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile
[INFO] | | \- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for duplicate)
[INFO] | \- commons-digester:commons-digester:jar:1.8.1:compile
[INFO] | +- commons-beanutils:commons-beanutils:jar:1.8.0:compile
[INFO] | | \- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for duplicate)
[INFO] | \- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for duplicate)
[INFO] \- org.apache.lucene:lucene-spellchecker:jar:3.5.0:compile
[INFO] +- org.apache.lucene:lucene-core:jar:3.5.0:compile
[INFO] \- org.apache.lucene:lucene-analyzers:jar:3.5.0:compile
[INFO] \- (org.apache.lucene:lucene-core:jar:3.5.0:compile - omitted for duplicate)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
错误:
curl -X POST http://localhost:7474/db/data/ext/DidYouMeanPlugin/graphdb/didYouMean -H "Content-Type:application/json" -d '{"query":"san francisco", "searchType":"airports" , "max":10}'
{
"message" : "org/apache/lucene/search/spell/LevensteinDistance",
"exception" : "NoClassDefFoundError",
"fullname" : "java.lang.NoClassDefFoundError",
"stacktrace" : [
"org.neo4j.server.plugin.didYouMean.DidYouMeanPlugin.didYouMean(DidYouMeanPlugin.java:39)", "java.lang.reflect.Method.invoke(Method.java:601)", "org.neo4j.server.plugins.PluginMethod.invoke(PluginMethod.java:57)", "org.neo4j.server.plugins.PluginManager.invoke(PluginManager.java:168)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:300)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:122)", "java.lang.reflect.Method.invoke(Method.java:601)" ]