英文:
Getting connection errors to in-memory neo4j instance during testing using the new spring-data-neo4j 6.0.0-SNAPSHOT
问题
使用发布版本,此应用程序代码正常工作。然而,切换到更新的快照版本后,我现在遇到异常。
异常消息让我认为需要更改配置以使我的测试用例再次工作,但是我无论如何都无法弄清楚它们需要什么。
任何帮助将不胜感激。
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.4.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>6.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
我的测试用例使用了注解:
- @SpringBootTest
- @EnableAutoConfiguration
- @AutoConfigureDataNeo4j
Caused by: org.springframework.dao.PermissionDeniedDataAccessException: 不支持的身份验证令牌,仅当禁用身份验证时才允许使用方案 'none'; 错误代码 'Neo.ClientError.Security.Unauthorized'
at org.springframework.data.neo4j.repository.support.Neo4jPersistenceExceptionTranslator.translateImpl(Neo4jPersistenceExceptionTranslator.java:105) ~[spring-data-neo4j-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
...
在一些测试变体中,我得到:
“请注意,Neo4j 4.0 中默认的加密设置已更改”。
英文:
Using the release versions, this application code works. However, switching to the newer snapshots, I am now getting exceptions.
The exception messages lead me to think a config change is needed to get my test cases working again, but for the life of me I cannot figure out what they would need to be.
Any help would be appreciated.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.4.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>6.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
My test case is using annotations:
- @SpringBootTest
- @EnableAutoConfiguration
- @AutoConfigureDataNeo4j
Caused by: org.springframework.dao.PermissionDeniedDataAccessException: Unsupported authentication token, scheme 'none' is only allowed when auth is disabled.; Error code 'Neo.ClientError.Security.Unauthorized'
at org.springframework.data.neo4j.repository.support.Neo4jPersistenceExceptionTranslator.translateImpl(Neo4jPersistenceExceptionTranslator.java:105) ~[spring-data-neo4j-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
at org.springframework.data.neo4j.repository.support.Neo4jPersistenceExceptionTranslator.translateExceptionIfPossible(Neo4jPersistenceExceptionTranslator.java:83) ~[spring-data-neo4j-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
at org.springframework.data.neo4j.core.DefaultNeo4jClient.potentiallyConvertRuntimeException(DefaultNeo4jClient.java:187) ~[spring-data-neo4j-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
at org.springframework.data.neo4j.core.DefaultNeo4jClient.access$400(DefaultNeo4jClient.java:59) ~[spring-data-neo4j-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
at org.springframework.data.neo4j.core.DefaultNeo4jClient$DefaultRecordFetchSpec.one(DefaultNeo4jClient.java:298) ~[spring-data-neo4j-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
at org.springframework.data.neo4j.core.Neo4jTemplate$DefaultExecutableQuery.getSingleResult(Neo4jTemplate.java:525) ~[spring-data-neo4j-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
at org.springframework.data.neo4j.repository.query.Neo4jQueryExecution$DefaultQueryExecution.execute(Neo4jQueryExecution.java:53) ~[spring-data-neo4j-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
at org.springframework.data.neo4j.repository.query.AbstractNeo4jQuery.execute(AbstractNeo4jQuery.java:68) ~[spring-data-neo4j-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:135) ~[spring-data-commons-2.4.0-M2.jar:2.4.0-M2]
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:119) ~[spring-data-commons-2.4.0-M2.jar:2.4.0-M2]
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:151) ~[spring-data-commons-2.4.0-M2.jar:2.4.0-M2]
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:130) ~[spring-data-commons-2.4.0-M2.jar:2.4.0-M2]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.0-M2.jar:5.3.0-M2]
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:80) ~[spring-data-commons-2.4.0-M2.jar:2.4.0-M2]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.0-M2.jar:5.3.0-M2]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:367) ~[spring-tx-5.3.0-M2.jar:5.3.0-M2]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118) ~[spring-tx-5.3.0-M2.jar:5.3.0-M2]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.0-M2.jar:5.3.0-M2]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137) ~[spring-tx-5.3.0-M2.jar:5.3.0-M2]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.0-M2.jar:5.3.0-M2]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.0-M2.jar:5.3.0-M2]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.0-M2.jar:5.3.0-M2]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.3.0-M2.jar:5.3.0-M2]
at com.sun.proxy.$Proxy133.findByName(Unknown Source) ~[na:na]
at ...
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1847) ~[spring-beans-5.3.0-M2.jar:5.3.0-M2]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1784) ~[spring-beans-5.3.0-M2.jar:5.3.0-M2]
... 81 common frames omitted
In some variations of my testing, I get:
"Note that the default encryption setting has changed in Neo4j 4.0"
答案1
得分: 1
以下是翻译好的内容:
你的应用程序属性是什么?
SDN6的语法已更改,但可能尚未更新到文档中。
参见:
嗯,实际上在自述文件中有(但尚未在文档中更新):
https://github.com/spring-projects/spring-data-neo4j
还有在引导文档中:
英文:
What are your application properties?
The syntax changed for SDN6, but might not have made it into the docs
See:
ah it actually has it in the readme (but not yet in the docs):
https://github.com/spring-projects/spring-data-neo4j
Also in the boot docs:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论