Java.io.FileNotFoundException:class path Resource. cannot be opened because it does not exist

Source: Internet
Author: User

Java.io.FileNotFoundException:class path Resource. Cannot is opened because it does not exist exceptions are as follows: Java.io.FileNotFoundException:class path resource [Com/jxust/zjh/model/ac Count.hbm.xml] cannot is opened because it does not exist in spring I configure <property name= "Mappingresources" ><list& Gt <value>com/jxust/zjh/model/Account.hbm.xml</value></list></property> reported the above error, The Account.hbm.xml is indeed in this directory. However, I changed it to run normally, <property name= "Mappingdirectorylocations" ><list><value>classpath:/com/jxust/ Zjh/model/</value></list></property> Solution: 1. Path problem,,,,,, directly to the configuration file under src ..... Because MyEclipse by default will go to SRC to find the simplest method or honestly put XML under the SRC convenient. Or create a config when the source folder,,,, is equivalent to Classpath 2. To see the Classes folder under Web-inf in Tomcat, see if the error above does not find beans file exists in Tomcat .... If there is no,,,, explanation why the project deployed in Tomcat needs to be deleted. Then the project in MyEclipse clean, then redeploy, and all the files are deployed to Tomcat, and the project works perfectly.

  

Java.io.FileNotFoundException:class path Resource. cannot be opened because it does not exist

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.