spring3.0整合mybatis报错,不知道哪里配置错误
严重:Servlet.service()forservletSpringMVCthrewexceptionorg.apache.ibatis.binding.Bindin...
严重: Servlet.service() for servlet SpringMVC threw exception
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): dao.EmpeeDAO.selectAllEmpees
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:189)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:43)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51)
at $Proxy10.selectAllEmpees(Unknown Source)
at service.EmpeeService.selectAllEmpees(EmpeeService.java:21)
at controller.EmpeeController.EmpeeController(EmpeeController.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
at
spring-mybatis.xml 文件部分内容:<!-- spring和MyBatis完美整合,不需要mybatis的配置映射文件 --><bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"><property name="dataSource" ref="dataSource" /><!-- 自动扫描mapping.xml文件 --><property name="mapperLocations" value="classpath:*/mapping/*.xml"></property>
启动没有报错,访问@Controller里面的路径方法才报错
报错请看截图 展开
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): dao.EmpeeDAO.selectAllEmpees
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:189)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:43)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51)
at $Proxy10.selectAllEmpees(Unknown Source)
at service.EmpeeService.selectAllEmpees(EmpeeService.java:21)
at controller.EmpeeController.EmpeeController(EmpeeController.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
at
spring-mybatis.xml 文件部分内容:<!-- spring和MyBatis完美整合,不需要mybatis的配置映射文件 --><bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"><property name="dataSource" ref="dataSource" /><!-- 自动扫描mapping.xml文件 --><property name="mapperLocations" value="classpath:*/mapping/*.xml"></property>
启动没有报错,访问@Controller里面的路径方法才报错
报错请看截图 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询