Parsing XML document from class path resource [Applicationcontext.xml]; nested exception is java.io. Filenotfoundexception:class path Resource [ApplicationContext. XML] cannot is opened because it does not exist
Translation: parsing an XML document from a CLASSPATH resource [applicationcontext.xml]; nested exception IO. FileNotFoundException: classpath resource [ApplicationContext]. The XML cannot be opened because it does not exist
This is my problem, because too careless to put ApplicationContext. The XML file is placed in the package under SRC, so the error is not found, and placed under SRC, there will be no error, execution through
--------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
The following is I see other people on the Internet error solutions, may be small partners will be used to reprint, use to refer to
IOException parsing XML document from class path resource [Webroot/web-inf/applicationcontext.xml];
Translation: Parsing XML document resources from Classpath IOException (Webroot/web-inf/Medium);
Spring of Java
Problem: When testing with JUnit, unable to get to the Applicationcontext.xml configuration file "Here the configuration file is placed under the Web-inf, if it is placed under the SRC, will not report this error"
notation: Classpathxmlapplicationcontext ac=new classpathxmlapplicationcontext ("/webroot/web-inf/applicationcontext.xml ");
Modify the method: In this way you can get
Filesystemxmlapplicationcontext ac=new filesystemxmlapplicationcontext ("/webroot/web-inf/applicationcontext.xml" );
Ext.: http://blog.csdn.net/wxl1990721/article/details/9196101
IOException parsing XML document from class path resource [Webroot/web-inf/applicationcontext.xml];