我有一個新建立的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