The Org.hibernate.MappingException:Unknown entity of the Laugh

Source: Internet
Author: User

The task today is to separate the easy-to-trust function code from a set of systems into another system. It would have been a very simple task, but after a separate transplant, a run-down was reported as a mistake:

Nested exception is Org.hibernate.MappingException:Unknown entity

A look at the error hint, it seems that hibernate mapped out the problem, looked at the Po class exists, and looked at the mapping. Hbm.xml configuration file is also in, look at the content also no problem, there is no problem is the existing system in the separation of the. A little confused, Baidu a bit, there is said @entity annotation guide the wrong package, but this project based on No annotated. and say. Hbm.xml class name is wrong, check a bit also no problem, separated out also can not have a problem.

This is a little silly. and tracking and grasping the bag to see the various strokes of the request have been tried again. No idea at all ...

Then can only be helpless of all kinds of Baidu, all kinds of turn, basically are similar to no difference. It suddenly occurred to me that I didn't see the main profile of hibernate. Suddenly a kind of want to cry and want to laugh feeling. Yes, no hibernate. The main configuration file, which is imported in the spring configuration file, the path of the newly added package is not added to the spring configuration.

class= "Org.springframework.orm.hibernate3.LocalSessionFactoryBean" >        <property name= " DataSource "><ref local=" Maindatasource "/></property>        <property name=" Mappingdirectorylocations ">            <list>                <value>classpath:/com/xxx/xxx/yixin/po</value >                <value>classpath:/com/xxx/xxx/wechat/po</value>            </list>        </property >

Finish adding, problem solving ... Really very helpless ... In the past has been using spring automatic scanning function, encountered this kind of manual configuration is really all kinds of can't remember ah ... Sure enough, people are inert ...

The Org.hibernate.MappingException:Unknown entity of the Laugh

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.