After building the code in Jenkins yesterday, the following error was executed MVN test:
The hint of BEAN.XM does not exist,
Look again at the source ApplicationContext statement
ApplicationContext ctx=new classpathxmlapplicationcontext ("Bean.xml");
This must be bean.xml in Src/main/java.
That should be the problem here.
Because spring just learned is not very familiar, find a long time finally found a solution
The solution is as follows:
Placing Bean.xml under Src/main/resources (my Maven project) Other paths can also be
The code is modified as follows:
Ctx=new classpathxmlapplicationcontext ("Classpath:/bean.xml");//That is: Find the XML file in the subdirectory of the current directory
In the execution of MVN test, and no error is allowed.
Reference Link: http://www.cnblogs.com/yanqin/p/5282929.html
Troubleshooting server code After executing MVN test cannot find spring Bean.xml profile issues under classes and test-classes