【BUG日记】【SpringBoot】启动SpringBoot项目的时候,报错 “The following method did not exist: org.quartz...” (一)

【日期】: 2020/11/17

【问题】: 启动SpringBoot项目的时候,报错

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springframework.scheduling.quartz.SchedulerAccessor.registerListeners(SchedulerAccessor.java:351)

The following method did not exist:

    org.quartz.Scheduler.getListenerManager()Lorg/quartz/ListenerManager;

The method's class, org.quartz.Scheduler, is available from the following locations:

    jar:file:/D:/Maven-Repository/org/opensymphony/quartz/quartz/1.6.1/quartz-1.6.1.jar!/org/quartz/Scheduler.class

It was loaded from the following location:

    file:/D:/Maven-Repository/org/opensymphony/quartz/quartz/1.6.1/quartz-1.6.1.jar

Action:

Correct the classpath of your application so that it contains a single, compatible version of org.quartz.Scheduler

在这里插入图片描述

【原因】: 因为引入了JPA依赖就出现这个错误。

		<!--↓↓↓JPA依赖↓↓↓ -->
		// 使用的是JpaTransactionManager
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa</artifactId>
		</dependency>

【如何发现】: 由于是引入依赖才导致运行出问题的,然后一个个排查依赖,结果发现了这个依赖有冲突。

【如何修复】: 在这个依赖注释掉,或者找到对应Maven库里把org/opensymphony/删掉,但是并没有解决根源问题,还是有点疑惑,为什么引入这个依赖就会报错。

【总结】: 知识不够巩固,还是非常欠缺。

后来,又遇到了相同的情况,但是引入的是另外一个依赖…

借一步说话:https://blog.csdn.net/qq_43263647/article/details/110664746

猜你喜欢

转载自blog.csdn.net/qq_43263647/article/details/109749060