嗨我正在尝试编写一个微服务,我创建了一个简单的使用Neo4JConfiguration进行扩展的Spring引导应用程序。我可以运行成功和服务器开始与目标端口,但通过点击api内部错误抛出浏览器使用Neo4J配置与Spring引导连接Neo4J时未经授权的异常
白色标签错误页面 此应用程序没有明确映射/错误,所以你看到这是一个后备。
There was an unexpected error (type=Internal Server Error, status=500).
org.springframework.web.util.NestedServletException: Request processing failed;
nested exception is org.neo4j.ogm.session.result.ResultProcessingException:
Failed to execute request:
{"statements":[{"statement":"MATCH p=(n)-[*0..1]-(m) WHERE id(n) = { id } RETURN collect(distinct p)",
"parameters":{"id":1},"resultDataContents":["graph"]}]}
而我的mvn控制台的错误说清楚该会话尚未被授权。错误:
12:12:19.114 [qtp212459676-16] INFO org.neo4j.ogm.session.Neo4jSession - There is no existing transaction, creating a transient one
12:12:19.272 [qtp212459676-16] INFO o.n.o.session.request.DefaultRequest - POST http://localhost:7474/db/data/transaction/commit, request: {"statements":[{"statement":"MATCH p=(n)-[*0..1]-(m) WHERE id(n) = { id } RETURN collect(distinct p)","parameters":{"id":1},"resultDataContents":["graph"]}]}
**caught response exception: Unauthorized**
12:12:19.606 [qtp212459676-16] INFO o.s.d.n.config.Neo4jConfiguration - Intercepted exception
12:12:19.642 [qtp212459676-16] WARN o.e.jetty.servlet.ServletHandler -
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.neo4j.ogm.session.result.ResultProcessingException: Failed to execute request: {"statements":[{"statement":"MATCH p=(n)-[*0..1]-(m) WHERE id(n) = { id } RETURN collect(distinct p)","parameters":{"id":1},"resultDataContents":["graph"]}]}
谁能告诉我如何授权使用springboot的Neo4j的?
这是我的bean与Neo4J实例连接。
@Override
@Bean
public Neo4jServer neo4jServer() {
// log.info("Initialising server connection");
return new RemoteServer("http://localhost:7474");
//return new InProcessServer();
}
@Override
@Bean
public SessionFactory getSessionFactory() {
log.info("Initialising Session Factory");
return new SessionFactory("nuclei.domain");
}
@Override
@Bean
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
public Session getSession() throws Exception {
log.info("Initialising session-scoped Session Bean");
return super.getSession();
}
如何在此处设置用户名/密码?
我很感激如果得到我问题的解决方案。谢谢。
我想知道我在哪里可以应用这些系统属性。 – Sathish 2015-04-07 08:53:23