springMvc错误:class path resource [config/spring/springmvc.xml] cannot be opened because it does

本文详细解析了在使用SpringMVC框架时遇到的配置文件加载错误,特别是当classpath资源路径设置不当时,导致springmvc.xml文件无法被正确加载的问题。文中提供了正确的classpath路径配置方法,即在classpath后添加“*”,确保从类路径及所有jar包中查找资源。
错误:class path resource [config/spring/springmvc.xml] cannot be opened because it does not exist

  错误原因:找不到我的springmvc.xml,在web.xml中是我引用路径,
    网上找到问题classpath指向路径不是resource路径,所以一直找不到我的xml文件,

  classpath:到你的class路径中查找文件,

 

  classpath*:不仅包含class的路径,还包括jar文件中(class路径)进行查找

 

  解决办法:在classpath后面在上“*” 可解决问题,“classpath*:springmvc.xml”

 

plication run failed org.springframework.beans.factory.BeanDefinitionStoreException: I/O failure while processing configuration class [org.dromara.DromaraApplication] at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:286) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:204) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:172) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:418) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:290) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:349) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:118) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:791) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:609) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439) at org.springframework.boot.SpringApplication.run(SpringApplication.java:318) at org.dromara.DromaraApplication.main(DromaraApplication.java:19) Caused by: java.io.FileNotFoundException: class path resource [org/dromara/screen/domain/bo/ComputerSalesInfoBoToComputerSalesInfoMapperImpl.class] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:215) at org.springframework.core.type.classreading.SimpleMetadataReader.getClassReader(SimpleMetadataReader.java:54) at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:48) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103) at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.createMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:98) at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.getMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:85) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:81) at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.getMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:75) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:216) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:354) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:281) ... 13 common frames omitted Disconnected from the target VM, address: '127.0.0.1:63103', transport: 'socket' Process finished with exit code 1
最新发布
12-05
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值