Hi I'm trying to write a micro service, I have create a simple spring boot application that extends with Neo4JConfiguration. I could run success and server started with the targeted port but by hitting the api the internal error throws in browser
Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. 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"]}]}
And my mvn console the error says clearly the session has not been authorized. Error :
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"]}]}
Could anyone please tell me how to authorize the neo4j using springboot ?
Here is my bean connecting with Neo4J instance.
@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();
}
How can I set the username / password here ?
I appreciate If get the par solution of my issue. Thanks.
Aucun commentaire:
Enregistrer un commentaire