我有一个 servlet,想连接到 Neo4j 数据库。这样我就可以通过 Internet 从我的应用程序访问数据库。但是 servlet 给出了错误?难道我做错了什么?
这是我的 servlet 代码。
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
out.println("Hello World");
GraphDatabaseService graphDB = new GraphDatabaseFactory().newEmbeddedDatabase("C:\\Users\\Sourav\\Desktop\\db1");
}
这是网页中返回的错误。
HTTP Status 500 - Servlet execution threw an exception
type Exception report
message Servlet execution threw an exception
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.NoClassDefFoundError: org/neo4j/graphdb/factory/GraphDatabaseFactory
hello.hello.doGet(hello.java:45)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)