当前位置: 首页 > 知识库问答 >
问题:

无法打开类路径资源[org/apache/ibatis/plugin/Interceptor.class],因为它不存在

郑宜民
2023-03-14
  1. Spring护套2.0.3。释放

当我运行项目时,指出这个错误,但拦截器。可以找到类。

html prettyprint-override"><div style='background-color:#ccc'>
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.sankuai.xy.safelog.SafelogApplication]; nested exception is java.io.FileNotFoundException: class path resource [org/apache/ibatis/plugin/Interceptor.class] cannot be opened because it does not exist
	at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:184) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:316) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:233) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:694) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at com.sankuai.xy.safelog.SafelogApplication.main(SafelogApplication.java:16) [classes/:na]
Caused by: java.io.FileNotFoundException: class path resource [org/apache/ibatis/plugin/Interceptor.class] cannot be opened because it does not exist
	at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:180) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:51) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.createMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:88) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.getMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:75) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:81) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:734) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getInterfaces(ConfigurationClassParser.java:963) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser.processInterfaces(ConfigurationClassParser.java:376) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:324) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:194) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:296) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:202) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:170) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
	... 13 common frames omitted
</div>

项目无法启动,但我nterceptor.class可以找到。

在此处输入图像描述

共有1个答案

太叔富
2023-03-14

springboot mybatis错误的pom:

    <dependency>
        <groupId>org.mybatis</groupId>
        <artifactId>mybatis</artifactId>
        <scope>provided</scope>
        <version>3.4.5</version>
    </dependency>

右pom:

    <dependency>
        <groupId>org.mybatis.spring.boot</groupId>
        <artifactId>mybatis-spring-boot-starter</artifactId>
        <version>1.3.0</version>
    </dependency>
 类似资料:
  • 我试图为我的项目设置配置位置,但我一直得到以下错误: java.io。FileNotFoundException:无法打开类路径资源[main/resources/app context.xml],因为它不存在 我的项目设置如下: 我将我的代码设置为: 我该怎么解决这个问题?

  • 我的项目结构是下面的屏幕截图。实际上,我得到了一个文件找不到的错误,尽管文件是存在的,我将添加错误在下面。我是Intellej的新手,这是我的第一个项目,我试图通过使用MySQL连接到数据库来制作一个音乐商店。下面是我的applicaiton-context.xml,dispatcher和web.xml是正确的。 我的日志文件是 由:java.io.fileNotFoundException引起:

  • 我正在开发一个添加了依赖项的Spring Boot应用程序。这个依赖项有一个spring。xml文件。我正在扫描这个xml文件并创建bean。其中一颗豆子正在寻找冬眠。类路径中的属性。我已将此属性文件添加到应用程序的“资源”文件夹下。但是,我仍然看到下面列出的例外情况。你能告诉我我错过了什么吗? JAVA木卫一。FileNotFoundException:无法打开类路径资源[hibernate.p

  • 我正在使用我的第一个spring helloworld程序,使用STS和maven,这是一个简单的IOC示例 和实现类 还有例外 L 它显示无法找到xml文件的位置,但我指定了我使用Spring工具套件mvc maven项目的位置

  • 我正试图通过遵循Pro Spring3这本书来学习Spring3。在第4章中,作者解释了IoC和DI。他使用GenericXmlApplication ationContext指定配置文件。他的工作如下: 我的结构是 src/main/resources/app上下文注释。xml IOException解析来自类路径资源[app context annotation.XML]的XML文档;嵌套的例

  • 我试图在tomcat上部署我的war(Spring boot),但我是如何得到这个异常的。在问我自己的问题之前,我尝试了stackoverflow上的另一个问题,不幸的是,它们没有太大帮助。 它在寻找application-config.xml,在Spring boot中,我们根本没有xml配置文件。 localhost.2015-09-04.log<==04-SEP-2015 11:50:40.