Idea + SSH OA first day (hibernate:mapping (RESOURCE) not found)

Source: Internet
Author: User
cut into the topic and see how today's errors happen:

First of all, this is my project path, Java is Sources root, resources is the resources root, put the required configuration file, where Hibernate configuration, the display is green, indicating no problem in eclipse, this is OK, It's no problem running. But in idea it's going to be a mistake.

caused by:org.hibernate.boot.MappingNotFoundException:Mapping (RESOURCE) not Found:xml/user.hbm.xml:origin (xml/ User.hbm.xml)

The hint is that the XML file is not found, but it can be run in the test class and think about whether it is a Tomcat pot.

PS: After testing remember to switch back to Tomcat, position click Switch, before stuck in this suspect life

The idea's Tomcat deployment location found that its files did not seem to be deployed in Tomcat,

There is no class, so open the idea point Open target folder, you can see the structure after deployment

As you can see, there is no configuration file under the domain folder in this structure

The configuration file is then placed under the Resources folder, and the package that contains the hibernate-mapping packages mapping class successfully resolves the issue.

Idea + SSH OA first day (hibernate:mapping (RESOURCE) not found)

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.