An annotationconfiguration instance is required to use

Source: Internet
Author: User

The annotation... error of using hibernate for SSH :"

 

Caused by: org. hibernate. mappingexception: An annotationconfiguration instance is required to use <mapping class = "com. feikecom. developer. Po. Module"/>
At org. hibernate. cfg. configuration. parsemappingelement (configuration. Java: 1648)
At org. hibernate. cfg. configuration. parsesessionfactory (configuration. Java: 1603)
At org. hibernate. cfg. configuration. doconfigure (configuration. Java: 1582)
At org. hibernate. cfg. configuration. doconfigure (configuration. Java: 1556)
At org. hibernate. cfg. configuration. Configure (configuration. Java: 1491)
At org. springframework. Orm. hibernate3.localsessionfactorybean. buildsessionfactory (localsessionfactorybean. Java: 601)
At org. springframework. Orm. hibernate3.abstractsessionfactorybean. afterpropertiesset (abstractsessionfactorybean. Java: 211)
At org. springframework. Beans. Factory. Support. abstractautowirecapablebeanfactory. invokeinitmethods (abstractautowirecapablebeanfactory. Java: 1369)
At org. springframework. Beans. Factory. Support. abstractautowirecapablebeanfactory. initializebean (abstractautowirecapablebeanfactory. Java: 1335)
... 39 more

Solution:

Assemble the spring configuration file into the class of sessionfactory.

Org. springframework. Orm. hibernate3.localsessionfactorybean

Change

Org. springframework. Orm. hibernate3.annotation. annotationsessionfactorybean

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.