One, the specific error as shown
According to the text hints can be seen that this file is not found, but I went to the project directory to find, this file does exist, then what is the problem?
Second, solve the problem
Cause analysis (from online)
The process of compiling a code is a process that automatically generates the corresponding compiled file. In a project where the original file directory is called source folders, the compiled file directory is called output folders, which is what we typically call classpath, which can be passed by right-clicking the project->pripertites-> Java Build Path->source see.
The source folders of my project is Test/src,output folders is test/webroot/web-inf/classes
The fault of the report is that Classpath did not find Bean.xml, that is, the compiled file does not have XML, so first look at the code is how to call Bean.xml, I was through the following way:
new ClassPathXmlApplicationContext("bean.xml");
This way will default from the file stored in the code to find the root directory test/src, and I put bean.xml directly under the Test folder, so of course the error. Just place the bean.xml in the Code root directory test/src. As can be seen, should be my spring-servlet-context.xml configuration file is not in the source folders, so compile the time can not find, I went to see, my profile is in Main/resource below, I added Main/java under build path, so I get an error.
Through the above processing, start the service again, error resolution, intentions to solve the problem, all can be solved.
Eclipse Maven Project error 3 no configuration file found Spring-servlet-context.xml