There is no getter for property named ' UserId ' in ' Class java.lang.String '

Source: Internet
Author: User

[ERROR] 2017-01-18 04:37:06:231 cn.dataenergy.common.CenterHandlerExceptionResolver ( CENTERHANDLEREXCEPTIONRESOLVER.JAVA:44)-Uniform catch Exception: Org.mybatis.spring.MyBatisSystemException:nested exception is Org.apache.ibatis.reflection.ReflectionException:There is no getter for property named ' UserId ' in ' class Java.lang.Stri Ng

Before, encountered such a problem is a headache, found that your model object is not missing get method, in fact, I understand wrong, is really the root of the problem is not the model layer, but in the XML, that is, SQL write wrong, if you use MyBatis, I believe we will often encounter such problems, of course, there will be a similar problem, I do not have time to update, later asked to update. In short, with MyBatis, a large part of the problem is from the XML file, if we have this experience, then in the solution of the problem can be quickly and efficiently find the error and solve. This time, although I did not say the specific solution, because these problems are many, but also very simple, I think I teach you to solve the problem, it is better to ask you how to find the problem. The idea below is just one of them.

Cause 1, examine the bean that may be faulted, and if it does not have a GET method, add the Get method to resolve

Cause 2, cause 1 No problem, it is possible that the error is the corresponding XML file error, generally, when there is only one query condition, should write the Where condition, userid={value}, when the query condition has more than one time, generally we put him in a *reqbean, The fields in this bean should correspond to the Sql-where field one by one above the XML file.

There is no getter for property named ' UserId ' in ' Class java.lang.String '

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.