Failed to load ApplicationContext from Unit Test: FileNotFound

前端 未结 9 1216
夕颜
夕颜 2021-02-01 14:44

I am creating a Maven Spring project, which includes MVC, Data and Security. My Spring applicationContext-*.xml files are located at \\src\\main\\resources\\spring\\

My

9条回答
  •  误落风尘
    2021-02-01 15:12

    Try with the relative path using *

      @ContextConfiguration(locations = {
    "classpath*:spring/applicationContext.xml",
    "classpath*:spring/applicationContext-jpa.xml",
    "classpath*:spring/applicationContext-security.xml" })
    

    If not look if your xml are really on resources/spring/.

    Finally try just on without location

     @ContextConfiguration({"classpath*:spring/applicationContext.xml"})
    

    The other error that you´re showing is because you have this tag duplicated on applicationContext.xml and applicationContext-security.xml

     Duplicate 
    

提交回复
热议问题