美文网首页
Message Request processing faile

Message Request processing faile

作者: 小牛长成记 | 来源:发表于2018-12-21 11:56 被阅读0次

太坑了,一个地方被绊了两次,主要是mybatis简单类型数据模糊查询时{(这里固定写法用value)},而我用了字段名pname,("%{pname}%")

where product.pname like "%${pname}%"

改成这样就好了,如下:

where product.pname like "%${value}%"

HTTP Status 500 – Internal Server Error
Type Exception Report

Message 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 'pname' in 'class java.lang.String'

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

org.springframework.web.util.NestedServletException: 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 'pname' in 'class java.lang.String'
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:963)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:842)
javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:827)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
Root Cause

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'pname' in 'class java.lang.String'
org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)
org.mybatis.spring.SqlSessionTemplateSqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) com.sun.proxy.Proxy11.selectList(Unknown Source)
org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230)
org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:139)
org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:76)
org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
com.sun.proxy.Proxy16.proVagueQuery(Unknown Source) com.shop.service.ProductService.proVagueQuery(ProductService.java:88) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) org.springframework.transaction.interceptor.TransactionInterceptor1.proceedWithInvocation(TransactionInterceptor.java:96)
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
com.sun.proxy.$Proxy17.proVagueQuery(Unknown Source)
com.shop.controller.ProductController.proVagueQuery(ProductController.java:53)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:743)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:672)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:82)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:933)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:867)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:951)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:842)
javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:827)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
Root Cause

org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'pname' in 'class java.lang.String'
org.apache.ibatis.reflection.Reflector.getGetInvoker(Reflector.java:419)
org.apache.ibatis.reflection.MetaClass.getGetInvoker(MetaClass.java:164)
org.apache.ibatis.reflection.wrapper.BeanWrapper.getBeanProperty(BeanWrapper.java:162)
org.apache.ibatis.reflection.wrapper.BeanWrapper.get(BeanWrapper.java:49)
org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:122)
org.apache.ibatis.scripting.xmltags.DynamicContextContextMap.get(DynamicContext.java:94) org.apache.ibatis.scripting.xmltags.DynamicContextContextAccessor.getProperty(DynamicContext.java:108)
org.apache.ibatis.ognl.OgnlRuntime.getProperty(OgnlRuntime.java:2685)
org.apache.ibatis.ognl.ASTProperty.getValueBody(ASTProperty.java:114)
org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:258)
org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:470)
org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:434)
org.apache.ibatis.scripting.xmltags.OgnlCache.getValue(OgnlCache.java:44)
org.apache.ibatis.scripting.xmltags.TextSqlNodeBindingTokenParser.handleToken(TextSqlNode.java:77) org.apache.ibatis.parsing.GenericTokenParser.parse(GenericTokenParser.java:78) org.apache.ibatis.scripting.xmltags.TextSqlNode.apply(TextSqlNode.java:51) org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:33) org.apache.ibatis.scripting.xmltags.DynamicSqlSource.getBoundSql(DynamicSqlSource.java:41) org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:292) org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81) org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.mybatis.spring.SqlSessionTemplateSqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
com.sun.proxy.Proxy11.selectList(Unknown Source) org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230) org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:139) org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:76) org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) com.sun.proxy.Proxy16.proVagueQuery(Unknown Source)
com.shop.service.ProductService.proVagueQuery(ProductService.java:88)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
org.springframework.transaction.interceptor.TransactionInterceptor1.proceedWithInvocation(TransactionInterceptor.java:96) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) com.sun.proxy.Proxy17.proVagueQuery(Unknown Source)
com.shop.controller.ProductController.proVagueQuery(ProductController.java:53)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:743)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:672)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:82)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:933)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:867)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:951)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:842)
javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:827)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
Note The full stack trace of the root cause is available in the server logs.

相关文章

网友评论

      本文标题:Message Request processing faile

      本文链接:https://www.haomeiwen.com/subject/kidmkqtx.html