Correct the classpath of your application so that it contains a single, compatible version of xxx报错

项目启动时报错:

Description
An attempt was made to call a method that does not exist. The attempt was made from the following location:  
.
.
.
.省略
.
.
The method's class, javax.persistence.PersistenceContext, is available from the following locations:
    file:/E:/maven/sprboot-mysql/lib/javax.persistence.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of javax.persistence.PersistenceContext

原因:
file:/E:/maven/sprboot-mysql/lib/javax.persistence.jar
这个文件夹中的jar包冲突

解决方法:
从file:/E:/maven/sprboot-mysql/lib文件夹中找到冲突的jar包,然后删除。


版权声明:本文为weixin_40991408原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。