请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

实现搜索功能出现异常

ShareService

ShareMapper
ShareService

ShareMapper.xml

浏览器异常

2021-01-07 16:00:31.052 ERROR [content-center,] 30439 — [nio-8010-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘title’ in ‘class java.lang.String’] with root cause

org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘title’ in 'class java.lang.String’
at org.apache.ibatis.reflection.Reflector.getGetInvoker(Reflector.java:419) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.reflection.MetaClass.getGetInvoker(MetaClass.java:164) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.reflection.wrapper.BeanWrapper.getBeanProperty(BeanWrapper.java:162) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.reflection.wrapper.BeanWrapper.get(BeanWrapper.java:49) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:122) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.scripting.xmltags.DynamicContextContextMap.get(DynamicContext.java:94) [mybatis−3.4.6.jar:3.4.6]atorg.apache.ibatis.scripting.xmltags.DynamicContextContextMap.get(DynamicContext.java:94) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.scripting.xmltags.DynamicContextContextMap.get(DynamicContext.java:94) [mybatis3.4.6.jar:3.4.6]atorg.apache.ibatis.scripting.xmltags.DynamicContextContextAccessor.getProperty(DynamicContext.java:108) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.ognl.OgnlRuntime.getProperty(OgnlRuntime.java:2685) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.ognl.ASTProperty.getValueBody(ASTProperty.java:114) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:258) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.ognl.ASTNotEq.getValueBody(ASTNotEq.java:50) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:258) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.ognl.ASTAnd.getValueBody(ASTAnd.java:61) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:258) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:470) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:434) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.scripting.xmltags.OgnlCache.getValue(OgnlCache.java:44) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.scripting.xmltags.ExpressionEvaluator.evaluateBoolean(ExpressionEvaluator.java:32) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.scripting.xmltags.IfSqlNode.apply(IfSqlNode.java:34) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:33) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.scripting.xmltags.TrimSqlNode.apply(TrimSqlNode.java:55) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:33) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.scripting.xmltags.DynamicSqlSource.getBoundSql(DynamicSqlSource.java:41) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:292) ~[mybatis-3.4.6.jar:3.4.6]
at com.github.pagehelper.PageInterceptor.intercept(PageInterceptor.java:82) ~[pagehelper-5.1.8.jar:na]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.4.6.jar:3.4.6]
at com.sun.proxy.Proxy208.query(UnknownSource) [na:na]atorg.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) [mybatis−3.4.6.jar:3.4.6]atorg.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) [mybatis−3.4.6.jar:3.4.6]atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod) [na:1.8.0271]atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [na:1.8.0271]atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.8.0271]atjava.lang.reflect.Method.invoke(Method.java:498) [na:1.8.0271]atorg.mybatis.spring.SqlSessionTemplateProxy208.query(Unknown Source) ~[na:na] at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) ~[mybatis-3.4.6.jar:3.4.6] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_271] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_271] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_271] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_271] at org.mybatis.spring.SqlSessionTemplateProxy208.query(UnknownSource) [na:na]atorg.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) [mybatis3.4.6.jar:3.4.6]atorg.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) [mybatis3.4.6.jar:3.4.6]atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod) [na:1.8.0271]atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [na:1.8.0271]atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.8.0271]atjava.lang.reflect.Method.invoke(Method.java:498) [na:1.8.0271]atorg.mybatis.spring.SqlSessionTemplateSqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) ~[mybatis-spring-1.3.2.jar:1.3.2]
at com.sun.proxy.Proxy152.selectList(UnknownSource) [na:na]atorg.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230) [mybatis−spring−1.3.2.jar:1.3.2]atorg.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:139) [mybatis−3.4.6.jar:3.4.6]atorg.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:76) [mybatis−3.4.6.jar:3.4.6]atorg.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) [mybatis−3.4.6.jar:3.4.6]atcom.sun.proxy.Proxy152.selectList(Unknown Source) ~[na:na] at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230) ~[mybatis-spring-1.3.2.jar:1.3.2] at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:139) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:76) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) ~[mybatis-3.4.6.jar:3.4.6] at com.sun.proxy.Proxy152.selectList(UnknownSource) [na:na]atorg.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230) [mybatisspring1.3.2.jar:1.3.2]atorg.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:139) [mybatis3.4.6.jar:3.4.6]atorg.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:76) [mybatis3.4.6.jar:3.4.6]atorg.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) [mybatis3.4.6.jar:3.4.6]atcom.sun.proxy.Proxy161.selectByParam(Unknown Source) ~[na:na]
at com.szj.contentcenter.service.content.ShareService.q(ShareService.java:161) ~[classes/:na]
at com.szj.contentcenter.service.content.ShareServiceFastClassBySpringCGLIBFastClassBySpringCGLIBFastClassBySpringCGLIB4dcfbebc.invoke() ~[classes/:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
at org.springframework.aop.framework.CglibAopProxyDynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684) [spring−aop−5.1.7.RELEASE.jar:5.1.7.RELEASE]atcom.szj.contentcenter.service.content.ShareServiceDynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684) ~[spring-aop-5.1.7.RELEASE.jar:5.1.7.RELEASE] at com.szj.contentcenter.service.content.ShareServiceDynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684) [springaop5.1.7.RELEASE.jar:5.1.7.RELEASE]atcom.szj.contentcenter.service.content.ShareServiceEnhancerBySpringCGLIBEnhancerBySpringCGLIBEnhancerBySpringCGLIB$6bb67b87.q() ~[classes/:na]
at com.szj.contentcenter.controller.content.ShareController.q(ShareController.java:32) ~[classes/:na]

正在回答

2回答

给力哦!

0 回复 有任何疑惑可以回复我~
提问者 机智的平田君 2021-01-07 16:24:44

改成这样就可以了。。
<select id="selectByParam" resultType="com.szj.contentcenter.domain.entity.content.Share">
 select * from share
 <where>
   <if test="_parameter!= null and _parameter != ''">
     title like CONCAT('%', #{title}, '%')
   </if>
   and audit_status = 'PASS'
 </where>
</select>

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信