zoukankan      html  css  js  c++  java
  • 配置Spring报错:class path resource [applicationContext.xml] cannot be opened because it does not exist

    无法打开xml文件

    问题:class path resource [applicationContext.xml] cannot be opened because it does not exist

    Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:224)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:195)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:257)
    	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:128)
    	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:94)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
    	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:676)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:558)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)
    	at Spring5Test.main(Spring5Test.java:16)
    Caused by: java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist
    	at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:180)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:333)
    	... 13 more
    
    

    outout path 路径指定到放xml的文件夹resources

    image-20210514111703911

    image-20210514113021982

  • 相关阅读:
    面向对象 课堂记录
    面向对象10个案例 (来源网络)
    面向对象举例
    面向对象
    36选7
    Android ImageView的scaleType属性与adjustViewBounds属性
    安卓计算器 简单代码
    安卓单选、复选按钮简单练习
    安卓发送邮箱界面 线形、表格、相对布局方式
    UI和View 三种控制方式
  • 原文地址:https://www.cnblogs.com/youngleesin/p/14767906.html
Copyright © 2011-2022 走看看