代码之家  ›  专栏  ›  技术社区  ›  Mayur

maven项目中找不到文件异常找不到xml文件

  •  -1
  • Mayur  · 技术社区  · 3 年前

    找不到文本。xml文件表示文件未找到异常,开始消息正在打印,但之后不会打印

    package com.mayur.demo;
    
    import org.springframework.context.ApplicationContext;
    import org.springframework.context.support.ClassPathXmlApplicationContext;
    
    
        public class App 
        {
            public static void main( String[] args )
            {
                System.out.println("here start");
                ApplicationContext context=new ClassPathXmlApplicationContext("test.xml");
                System.out.println("here ending");
                
                Car c=(Car)context.getBean("car");
                c.drive();
                
            }
        }
    
    0 回复  |  直到 3 年前