About Hibernate mapping File configuration exceptions: Invalidmappingexception:could not parse mapping document

Source: Internet
Author: User

For the first time hibernate is used, the following exception appears in the configuration file:

Org.hibernate.boot.InvalidMappingException:Could Not parse mapping document:com/myhibernatedemo/entity/ Product.hbm.xml (RESOURCE)

*********************
caused By:org.hibernate.boot.MappingException:Unable to perform unmarshalling on line number 6 and column 57. Message:cvc-pattern-valid: For patterns of type ' classnametype ' ([a-za-z_$][a-za-z\d_$]*\.) *[a-za-z_$][a-za-z\d_$]* ', value ' com/myhibernatedemo/entity ' does not have face validity. : Origin (Com/myhibernatedemo/entity/product.hbm.xml)

The reason for the error is: The mapping file cannot be parsed. As shown in the following figure, the package's path format is not supported, changing the image Identification format to the following image


Do not know why uploaded pictures have been unable to display, the text description: The Product.hbm.xml package= "com/myhibernatedemo/entity" changed to Package= " Com.myhibernatedemo.entity "can.


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.