2016-11-08 10 views
1

私はSpringブートでneo4jデータベースを設定しています。私はSpring Bootをセットアップすることができ、正常に動作しています。しかし、neo4jを設定すると、例外org.apache.http.client.HttpResponseException: No authentication header suppliedが投げられます。org.apache.http.client.HttpResponseException:認証ヘッダーがありません

ログスタッシュは以下の通りです:

2016-11-08 15:20:54.962 INFO 4932 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet  : FrameworkServlet 'dispatcherServlet': initialization completed in 23 ms 
2016-11-08 15:24:29.062 INFO 4932 --- [nio-8080-exec-2] o.n.o.drivers.http.request.HttpRequest : Thread: 27, url: http://localhost:7474/db/data/transaction/commit, request: {"statements":[{"statement":"MATCH (user:User) WHERE user.id = {id} RETURN user","parameters":{"id":"10"},"resultDataContents":["graph"],"includeStats":false}]} 
2016-11-08 15:24:29.285 WARN 4932 --- [nio-8080-exec-2] o.n.o.drivers.http.request.HttpRequest : Thread: 27, response: No authentication header supplied. 
2016-11-08 15:24:29.288 INFO 4932 --- [nio-8080-exec-2] o.s.d.neo4j.config.Neo4jConfiguration : Intercepted exception 
2016-11-08 15:24:29.299 ERROR 4932 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.neo4j.ogm.drivers.http.request.HttpRequestException: http://localhost:7474/db/data/transaction/commit: No authentication header supplied.] with root cause 

org.apache.http.client.HttpResponseException: No authentication header supplied. 
    at org.neo4j.ogm.drivers.http.request.HttpRequest.execute(HttpRequest.java:203) ~[neo4j-ogm-http-driver-2.0.5.jar:na] 
    at org.neo4j.ogm.drivers.http.request.HttpRequest.executeRequest(HttpRequest.java:168) ~[neo4j-ogm-http-driver-2.0.5.jar:na] 
    at org.neo4j.ogm.drivers.http.request.HttpRequest.execute(HttpRequest.java:87) ~[neo4j-ogm-http-driver-2.0.5.jar:na] 
    at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.executeAndMap(ExecuteQueriesDelegate.java:114) ~[neo4j-ogm-core-2.0.5.jar:na] 
    at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.query(ExecuteQueriesDelegate.java:87) ~[neo4j-ogm-core-2.0.5.jar:na] 
    at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.queryForObject(ExecuteQueriesDelegate.java:61) ~[neo4j-ogm-core-2.0.5.jar:na] 
    at org.neo4j.ogm.session.Neo4jSession.queryForObject(Neo4jSession.java:363) ~[neo4j-ogm-core-2.0.5.jar:na] 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_31] 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_31] 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_31] 
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_31] 
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) ~[spring-aop-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) ~[spring-aop-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) ~[spring-aop-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) ~[spring-aop-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) ~[spring-aop-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at com.sun.proxy.$Proxy60.queryForObject(Unknown Source) ~[na:na] 

設定クラス:

public class ApplicationConfiguration extends Neo4jConfiguration{ 

    @Bean 
    public Configuration getConfiguration(){ 
     Configuration config = new Configuration(); 
     config.driverConfiguration() 
      .setDriverClassName("org.neo4j.ogm.drivers.http.driver.HttpDriver") 
      .setURI("http://neo4j:welcome*[email protected]:7474"); 
     return config; 
    } 

    @Bean 
    public SessionFactory getSessionFactory(){ 
     return new SessionFactory(getConfiguration(), "com.ent.entity"); 
    } 

    @Bean 
    @Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS) 
    public Session getSession() throws Exception{ 
     return super.getSession(); 
    } 
} 
+0

よあなたはogmを設定しましたか? http://neo4j.com/docs/ogm-manual/current/tutorial/#tutorial-configuration –

+0

質問を編集してこの情報を追加してください。本当にこのようにここで読めるわけではありません。 –

+0

資格情報をURIに入れるのではなく、 'config.driverConfiguration()。setCredentials(" neo4j "、" welcome * 123 ")'を使ってみましたか? –

答えて

0

春ブーツ「application.properties」ファイルで設定することができる構成プロパティのリストを持っています。これらの問題を解決する可能性があります設定

spring.data.neo4j.username=neo4j (default user)  
spring.data.neo4j.password=neo4j (default password) 
0

これは、ヘッダー内の認証を必要とするか、neo4j.confこのライン

DIRビン/ neo4j.conf とコメント解除をインストール編集する認証試行を無効にすることができますどうやっ
# Whether requests to Neo4j are authenticated. 
# To disable authentication, uncomment this line 
dbms.security.auth_enabled=false  

OR有効ネオDBMSコネクタ

# HTTP Connector. There must be exactly one HTTP connector. 
dbms.connector.http.enabled=true 
#dbms.connector.http.listen_address=:7474 
関連する問題