本文主要是介绍Springboot: Servlet.service() for servlet [dispatcherServlet] in context with path []的可能解法,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
说明:这个可能只是个人犯蠢的错误,不具有代表性
背景:Springboot使用Mybatis,接收post在Mapper层调用数据库的时候报的错
部分错误日志
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 'studentInfo' in 'class com.manager.pojo.StudentInfo'] with root causeorg.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'studentInfo' in 'class com.manager.pojo.StudentInfo'at org.apache.ibatis.reflection.Reflector.getGetInvoker(Reflector.java:373) ~[mybatis-3.5.4.jar:3.5.4]at org.apache.ibatis.reflection.MetaClass.getGetInvoker(MetaClass.java:163) ~[mybatis-3.5.4.jar:3.5.4]at org.apache.ibatis.reflection.wrapper.BeanWrapper.getBeanProperty(BeanWrapper.java:162) ~[mybatis-3.5.4.jar:3.5.4]at org.apache.ibatis.reflection.wrapper.BeanWrapper.get(BeanWrapper.java:49) ~[mybatis-3.5.4.jar:3.5.4]
-
重点:
There is no getter for property named 'studentInfo' in 'class
- studentInfo是那个类名,于是发现了一个非常蠢的错误:Mybatis中参数的调用机制:如果只有一个参数,记为param,则${name}就等价于调用param.getName()
- 于是修改XML即可消除错误。
这篇关于Springboot: Servlet.service() for servlet [dispatcherServlet] in context with path []的可能解法的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!