• 欢迎访问SimonHu的博客,推荐使用360浏览器和Chrome浏览器访问本网站

There is no setter for property named 可能产生的原因!

java SimonHu 4年前 (2017-06-29) 81次浏览 0个评论 扫描二维码

 There is no setter for property named 'operateIP ' in 'class com.chinaunicom.wsp.facade.entity.UserOperateLog',今天启动发现报这个错,经过旁边大哥的指导,后来才发现是配置文件实体有空格……记录一下吧。推荐还是选择“mybatis-generator-core-1.3.5”进行自动化生成,手写太容易出错了- -

完整报错:

2017-06-15 10:51:48,490 DEBUG [DispatcherServlet.java:861] : DispatcherServlet with name 'springmvc' processing GET request for [/wsp-web-admin/userOperateLog/list]
2017-06-15 10:51:48,491 DEBUG [AbstractHandlerMethodMapping.java:320] : Looking up handler method for path /userOperateLog/list
2017-06-15 10:51:48,491 DEBUG [AbstractHandlerMethodMapping.java:327] : Returning handler method [public java.lang.String com.chinaunicom.wsp.admin.controller.UserOperateLogController.list(javax.servlet.http.HttpServletRequest,com.chinaunicom.wsp.facade.entity.User,boolean)]
2017-06-15 10:51:48,491 DEBUG [AbstractBeanFactory.java:250] : Returning cached instance of singleton bean 'userOperateLogController'
2017-06-15 10:51:48,492 DEBUG [DispatcherServlet.java:947] : Last-Modified value for [/wsp-web-admin/userOperateLog/list] is: -1
2017-06-15 10:51:48,492 DEBUG [SqlSessionUtils.java:106] : Creating a new SqlSession
2017-06-15 10:51:48,492 DEBUG [SqlSessionUtils.java:142] : SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@54c1b64a] was not registered for synchronization because synchronization is not active
2017-06-15 10:51:48,493 DEBUG [DataSourceUtils.java:110] : Fetching JDBC Connection from DataSource
2017-06-15 10:51:48,494 DEBUG [SpringManagedTransaction.java:85] : JDBC Connection [com.mysql.jdbc.JDBC4Connection@55e9f8bd] will not be managed by Spring
2017-06-15 10:51:48,494 DEBUG [BaseJdbcLogger.java:132] : ooo Using Connection [com.mysql.jdbc.JDBC4Connection@55e9f8bd]
2017-06-15 10:51:48,494 DEBUG [BaseJdbcLogger.java:132] : ==>  Preparing: SELECT t3.* ,t4.phone_no ,t4.nick_name FROM (SELECT t1.id, t1.user_id, t1.operate_id,t1.operate_ip,t1.ctime, t2.operate_name,t2.operate_type,sum(t2.operate_value) as operate_value FROM wsp_user_operate_log t1 LEFT JOIN wsp_user_operate_defind t2 ON t1.operate_id = t2.id GROUP BY t1.operate_id,t1.user_id)t3 LEFT JOIN wsp_user t4 ON t3.user_id=t4.id WHERE t3.user_id IS NOT null ORDER BY operate_value DESC 
2017-06-15 10:51:48,495 DEBUG [BaseJdbcLogger.java:132] : ==> Parameters: 
2017-06-15 10:51:48,864 DEBUG [SqlSessionUtils.java:170] : Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@54c1b64a]
2017-06-15 10:51:48,865 DEBUG [DataSourceUtils.java:327] : Returning JDBC Connection to DataSource
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property 'operateIP ' of 'class com.chinaunicom.wsp.facade.entity.UserOperateLog' with value '127.0.0.11' Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'operateIP ' in 'class com.chinaunicom.wsp.facade.entity.UserOperateLog'
        at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
        at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:364)
        at com.sun.proxy.$Proxy23.selectList(Unknown Source)
        at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:201)
        at com.chinaunicom.wsp.core.dao.BaseDaoImpl.listPage(BaseDaoImpl.java:238)
        at com.chinaunicom.wsp.facade.service.impl.UserOperateLogServiceImpl.listPage(UserOperateLogServiceImpl.java:62)
        at com.chinaunicom.wsp.admin.controller.UserOperateLogController.list(UserOperateLogController.java:72)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:111)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:806)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:729)
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
        at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
        at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
        at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
        at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
        at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
        at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
        at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
        at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
        at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)

        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.ibatis.reflection.ReflectionException: Could not set property 'operateIP ' of 'class com.chinaunicom.wsp.facade.entity.UserOperateLog' with value '127.0.0.11' Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'operateIP ' in 'class com.chinaunicom.wsp.facade.entity.UserOperateLog'
        at org.apache.ibatis.reflection.wrapper.BeanWrapper.setBeanProperty(BeanWrapper.java:172)
        at org.apache.ibatis.reflection.wrapper.BeanWrapper.set(BeanWrapper.java:54)
        at org.apache.ibatis.reflection.MetaObject.setValue(MetaObject.java:130)
        at org.apache.ibatis.executor.resultset.FastResultSetHandler.applyPropertyMappings(FastResultSetHandler.java:304)
        at org.apache.ibatis.executor.resultset.NestedResultSetHandler.getRowValue(NestedResultSetHandler.java:135)
        at org.apache.ibatis.executor.resultset.NestedResultSetHandler.handleRowValues(NestedResultSetHandler.java:102)
        at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSet(FastResultSetHandler.java:188)
        at org.apache.ibatis.executor.resultset.NestedResultSetHandler.handleResultSet(NestedResultSetHandler.java:73)
        at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSets(FastResultSetHandler.java:154)
        at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:57)
        at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:70)
        at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:57)
        at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:259)
        at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:132)

        at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105)
        at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:354)
        ... 62 more
Caused by: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'operateIP ' in 'class com.chinaunicom.wsp.facade.entity.UserOperateLog'
        at org.apache.ibatis.reflection.Reflector.getSetInvoker(Reflector.java:369)
        at org.apache.ibatis.reflection.MetaClass.getSetInvoker(MetaClass.java:171)
        at org.apache.ibatis.reflection.wrapper.BeanWrapper.setBeanProperty(BeanWrapper.java:164)
        ... 83 more
2017-06-15 10:51:48,867 DEBUG [DispatcherServlet.java:1241] : Rendering view [org.springframework.web.servlet.view.JstlView: name '/mgr/userLog/queryAppUserRecord'; URL [//mgr/userLog/queryAppUserRecord.jsp]] in DispatcherServlet with name 'springmvc'
2017-06-15 10:51:48,867 DEBUG [AbstractView.java:432] : Added model object 'user' of type [com.chinaunicom.wsp.facade.entity.User] to request in view with name '/mgr/userLog/queryAppUserRecord'
2017-06-15 10:51:48,867 DEBUG [AbstractView.java:432] : Added model object 'org.springframework.validation.BindingResult.user' of type [org.springframework.validation.BeanPropertyBindingResult] to request in view with name '/mgr/userLog/queryAppUserRecord'
2017-06-15 10:51:48,867 DEBUG [InternalResourceView.java:166] : Forwarding to resource [//mgr/userLog/queryAppUserRecord.jsp] in InternalResourceView '/mgr/userLog/queryAppUserRecord'
2017-06-15 10:51:48,868 DEBUG [FrameworkServlet.java:1000] : Successfully completed request
2017-06-15 10:51:48,869 DEBUG [AbstractBeanFactory.java:250] : Returning cached instance of singleton bean 'sqlSessionFactory'

版权所有丨如未注明 , 均为原创丨
转载请注明原文链接:There is no setter for property named 可能产生的原因!
喜欢 (1)
[]
分享 (0)
关于作者:
Do you think that guy looks like a dog???
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址