ApplicationContext error report of Spring Project

when using IDEA to develop spring, loading applicationContext failed, saying that the file could not be found? I looked at it for a long time and didn"t see anything wrong.

Jul.03,2021

this is the startup mode of the main method. The root of the loading path is the compiled classes,. You can try .. / WEB-INF/applicationContext.xml or load the configuration file at the same level as the class and then load applicationContext.xml


it is not a web project when starting from the main method. The things under WEB-INF directly ignore the


main method startup. You can't find this file under classpath. Add the resources directory and place the file in the resources directory

Menu