首页 > 解决方案 > Spring boot 2.0.6 石英缺少 org/springframework/scheduling/quartz/SpringBeanJobFactory in war

问题描述

在tomcat中启动应用程序时使用spring boot war build

Caused by: java.io.FileNotFoundException: class path resource [org/springframework/scheduling/quartz/SpringBeanJobFactory.class] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:180)

即使它作为依赖项存在

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-quartz</artifactId>
</dependency>

并且spring-context-support

spring boot jar 构建和运行没有问题

如何解决战争部署的问题?

这是我在调试 jar 文件时得到的 - 也许这可能会有所帮助:(使用战争文件 ClassNotFoundException)

在此处输入图像描述

标签: javaspring-bootwarquartz

解决方案


想通了这个问题。当我从 IntelliJ Idea 运行 Tomcat 时,并没有反映引入到项目中的新依赖项。需要删除和重新导入战争/战争爆炸成 Tomcat 配置 - 没有问题。


推荐阅读