我有一个新建立的neo4j-rest-graphdb-1.8-SNAPSHOT.jar。但是,我出了问题。Neo4j爪哇休息绑定:NoClassDefFoundError
我有基本的/默认安装的Neo4j的运行,使用有效的图形存储配置:
Neo4j的版本
图形数据库内核1.8.M05
OS
Ubuntu 12.04 LTS
Java版本
“1.6.0_24” OpenJDK的运行时环境(1.11.1 IcedTea6)(6b24-1.11.1-4ubuntu3) OpenJDK的64位服务器VM(构建20.0-B12,混合模式)
的卷曲请求提出一切工作的很好:
$ curl http://localhost:7474/db/data/ -i
HTTP/1.1 200 OK
Content-Length: 809
Content-Encoding: UTF-8
Content-Type: application/json
Access-Control-Allow-Origin: *
Server: Jetty(6.1.25)
{
"extensions" : {
"CypherPlugin" : {
"execute_query" : "http://localhost:7474/db/data/ext/CypherPlugin/graphdb/execute_query"
},
"GremlinPlugin" : {
"execute_script" : "http://localhost:7474/db/data/ext/GremlinPlugin/graphdb/execute_script"
}
},
"node" : "http://localhost:7474/db/data/node",
"reference_node" : "http://localhost:7474/db/data/node/0",
"node_index" : "http://localhost:7474/db/data/index/node",
"relationship_index" : "http://localhost:7474/db/data/index/relationship",
"extensions_info" : "http://localhost:7474/db/data/ext",
"relationship_types" : "http://localhost:7474/db/data/relationship/types",
"batch" : "http://localhost:7474/db/data/batch",
"cypher" : "http://localhost:7474/db/data/cypher",
"neo4j_version" : "1.8.M05-1-ge9cdca9"
但是,尝试下面一行:
GraphDatabaseService graph = new RestGraphDatabase(“http:// localhost:7474/db/data /”);
......产生一个例外:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/ws/rs/core/Response$StatusType
at org.neo4j.rest.graphdb.RestAPIFacade.<init>(RestAPIFacade.java:265)
at org.neo4j.rest.graphdb.RestGraphDatabase.<init>(RestGraphDatabase.java:44)
at com.tester.api.Neo4j.importer(Neo4j.java:185)
at com.tester.api.Neo4j.main(Neo4j.java:97)
Caused by: java.lang.ClassNotFoundException: javax.ws.rs.core.Response$StatusType
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)
... 4 more
从Neo4j Group(来自Peter)引用:这很有用,但你很幸运。将所有jar打包成一个jar文件可能会覆盖不同内容下不同内容下存在的文件,如java服务加载器文件。您没有这些,但请注意是否包含e。 G。注册更多缓存类型的内核和企业罐。 – Rob 2012-07-26 15:14:20