解决由过度引入依赖导致冲突产生的错误
使用vue编写前端echarts,结合后端springboot对neo4j数据库操作时,在pom.xml文件中引入了一个所谓的neo4j依赖如下:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-neo4j</artifactId>
</dependency>
结果在编写后台管理系统对用户信息进行操作时,发现出现了报错:
打开浏览器控制台查看具体报错:
来到后端,打开IDEA查看日志报错:
Resolved [org.springframework.transaction.TransactionSystemException: Could not open a new Neo4j session: Unsupported authentication token, scheme 'none' is only allowed when auth is disabled.; nested exception is org.neo4j.driver.exceptions.AuthenticationException: Unsupported authentication token, scheme 'none' is only allowed when auth is disabled.]
至此,基本可以确定是neo4j的依赖在作祟,将其删除,果然问题解决:
最后思考我应该如何才能引入正确的neo4j依赖包呢,几经搜索找到答案:
<!-- neo4j driver 服务器开发-->
<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
<version>4.1.1</version>
</dependency>
以上就是我解决这个问题的全部思路,希望可以帮助到大家少走弯路。