Invocation of init method failed; Nested exception is org. hibernate. hibernateexception: Unable to in

Source: Internet
Author: User

15:47:28, 328 error [org. springframework. Web. Context. contextloader]-context initialization failed
Org. springframework. Beans. Factory. beancreationexception:
Error creating bean with name 'yonghushuxingaction' defined in servletcontext Resource
[/WEB-INF/Context/applicationContext-action.xml]: cannot resolve reference to bean 'yonghushuxingservice'
While setting bean property 'yonghushuxingservice ';
Nested exception is org. springframework. Beans. Factory. beancreationexception:
Error creating bean with name 'yonghushuxingservice' defined in servletcontext Resource
[/WEB-INF/Context/applicationContext-service.xml]:
Cannot resolve reference to bean 'yonghushuxingdao'
While setting bean property 'yonghushuxingdao ';
Nested exception is org. springframework. Beans. Factory. beancreationexception:
Error creating bean with name 'yonghushuxingdao 'defined in servletcontext Resource
[/WEB-INF/Context/applicationContext-dao.xml]:
Cannot resolve reference to bean 'sessionfactory 'while setting bean property 'sessionfactory ';
Nested exception is org. springframework. Beans. Factory. beancreationexception:
Error creating bean with name 'sessionfactory 'defined in servletcontext Resource
[/WEB-INF/Context/applicationContext-hibernate.xml]:
Invocation of init method failed; Nested exception is org. hibernate. hibernateexception:
Unable to instantiate default tuplizer [org. hibernate. tuple. entity. pojoentitytuplizer]

After I deployed the project, there were so many errors that Baidu and Google did not find a specific solution, so they had to solve it by themselves.

In the console, there are many errors behind the above errors. I found the last one.

 

Caused by: org. hibernate. propertynotfoundexception: cocould not find a getter for flag in class cn.com. hanker. fengdian. model. yonghushuxing
At org. hibernate. Property. basicpropertyaccessor. creategetter (basicpropertyaccessor. Java: 306)
At org. hibernate. Property. basicpropertyaccessor. getgetter (basicpropertyaccessor. Java: 299)
At org. hibernate. Mapping. Property. getgetter (property. Java: 294)
At org. hibernate. tuple. entity. pojoentitytuplizer. buildpropertygetter (pojoentitytuplizer. Java: 300)
At org. hibernate. tuple. entity. abstractentitytuplizer. <init> (abstractentitytuplizer. Java: 141)
At org. hibernate. tuple. entity. pojoentitytuplizer. <init> (pojoentitytuplizer. Java: 78)
... 87 more

 

Let's take a look at the font amplification section. I found the flag attribute in the configuration file,

Originally, In the hibernate ing configuration file, there was a space behind my flag. This property configuration does not match the attributes in the database, so I changed it.

Run again and finally succeeded.

Through the above errors, I think we should be more serious. The attribute name and the field name in the database should be pasted and copied to avoid errors.

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.