MyBatis: Invalid bound statement (not found) 错误的可能原因

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://icode.blog.csdn.net/article/details/96844701

MyBatis: Invalid bound statement (not found)错误的可能原因

其他原因导致此问题解决参考:

1.检查 xml 文件所在 package 名称是否和 Mapper interface 所在的包名一致

<mapper namespace="com.xiaopengwei.mapper.UserInfoMapper">

mapper 的 namespace 写的不对!!!注意系修改。

2.UserDao 的方法在 UserDao.xml 中没有,然后执行 UserDa o的方法会报错误

3.UserDao 的方法返回值是 List<User>,而 select 元素没有正确配置 ResultMap,或者只配置ResultType!

4.如果你确认没有以上问题,请任意修改下对应的xml文件,比如删除一个空行,保存.问题解决

5.看下 mapper 的 XML 配置路径是否正确

mybatis.mapper-locations=classpath*:mybatis/oracle/*.xml

6.多数是 xml 文件中内容的问题,注意对应!

展开阅读全文

关于mybatis Invalid bound statement (not found) 问题

06-26

初学mybatis 现在系统是spring + mybatis rnapplicationContext.xml里面配置了Mapper 自动扫描rnrnrn rnrnrn然后定义了一个userMapper,里面就只有一个方法rnrn@Repository(value="userMapper")rnpublic interface UserMapper rn public List getAll();rnrnrn下面是userMapper.xmlrnrn rn select * from userrn rnrnrn下面是mybatis 配置文件rnrnrn rn rn rn rn rn rn rn rn rnrnrn我业务层定义了一个接口 UserService 然后 下面是实现类rnrn@Component(value="userServiceImpl")rn@Transactionalrnpublic class UserServiceImpl implements UserServicern rn private UserMapper userMapper;rn @Autowiredrn public void setUserMapper(UserMapper userMapper) rn this.userMapper = userMapper;rn rnrn public List getAll() rn return userMapper.getAll();rn rnrnrnrn我spring 配置文件加载完成后运行下面的代码可以获取结果rnUserServiceImpl userServiceImpl = (UserServiceImpl)PlatformContext.getApplicationContext().getBean("userServiceImpl");rnList lista = userServiceImpl.getAll();rnrn但是我现在又写了一个类 叫UserComponent 如下:rn@Component(value="userComponent")rnpublic class UserComponent rn private UserService userService;rn @Autowiredrn public void setUserService(UserService userService) rn this.userService = userService;rn rn public List getAll(Head head)rn return userService.getAll();rn rnrnrn我这个UserService直接注入了rnUserComponent userComponent = (UserComponent)PlatformContext.getApplicationContext().getBean("userComponent");rnList list = userComponent.getAll();rnrn我像这样调用的时候就不行了,只是多加了一层啊,这是为啥,求解!rnrn[b]下面是异常信息:[/b]rn[b]org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.yolly.platform.user.service.UserService.getAll[/b]rn at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:178)rn at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:38)rn at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:49)rn at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:42)rn at $Proxy12.getAll(Unknown Source)rn at com.yolly.platform.user.component.UserComponent.getAll(UserComponent.java:25)rn at com.yolly.core.main.Server$ServerHandler.messageReceived(Server.java:101)rn at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:690)rn at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)rn at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)rn at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)rn at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74)rn at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)rn at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:769)rn at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:761)rn at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:703)rn at java.lang.Thread.run(Thread.java:662)rn[b]Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.yolly.platform.user.service.UserService.getAll[/b]rn at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:775)rn at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:615)rn at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:608)rn at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:176)rn ... 16 morernrnrnrnrnrnrn 论坛

weblogic下mybatis : Invalid bound statement (not found)【求助】

12-18

Mapper接口在依赖的jar包里,tomcat下运行没有问题,weblogic下会抛出rn[code=text]org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): net.transino.lms.modules.comp.mapper.DicMapper.findAllCascadern at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:225)rn at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:48)rn at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:65)rn at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)rn at com.sun.proxy.$Proxy278.findAllCascade(Unknown Source)rn at net.transino.lms.modules.comp.service.impl.OptionServiceImpl.findDicCascade(OptionServiceImpl.java:177)rn at net.transino.lms.modules.comp.service.impl.OptionServiceImpl$$FastClassBySpringCGLIB$$c9c3fe2c.invoke()rn at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)rn at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)rn at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)rn at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)rn at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)rn at net.transino.lms.modules.comp.service.impl.OptionServiceImpl$$EnhancerBySpringCGLIB$$23e88890.findDicCascade()rn at net.transino.core.LmsApplicationListener.startup(LmsApplicationListener.java:78)rn at net.transino.core.LmsApplicationListener.onApplicationEvent(LmsApplicationListener.java:30)rn at net.transino.core.LmsApplicationListener.onApplicationEvent(LmsApplicationListener.java:23)rn at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:166)rn at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138)rn at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:381)rn at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:335)rn at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:855)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)rn at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:705)rn at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)rn at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)rn at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)rn at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)rn at weblogic.servlet.internal.EventsManager.executeContextListener(EventsManager.java:251)rn at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:204)rn at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:189)rn at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1921)rn at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3101)rn at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1843)rn at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:884)rn at weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:360)rn at weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:356)rn at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)rn at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:138)rn at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)rn at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:233)rn at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:228)rn at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)rn at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:78)rn at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:52)rn at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:752)rn at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)rn at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:262)rn at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:52)rn at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165)rn at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:90)rn at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:631)rn at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:171)rn at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:121)rn at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:348)rn at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:907)rn at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1468)rn at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:459)rn at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:181)rn at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:217)rn at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:14)rn at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:69)rn at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:670)rn at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)rn at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)rn at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)rn at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)rn at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)rn at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)rn at weblogic.work.ExecuteThread.run(ExecuteThread.java:355)rn[/code]rn 论坛

Mybatis 绑定异常,Invalid bound statement (not found)

03-15

dao和Mapper文件都是自动生成的确定没有错误,老是执行不成功。项目是Maven项目,编译后的目录也查看过,确定没问题。贴上图片。不知道为什么图片上传不成功,贴上配置信息。rnrnrn rn rn rn rn rnrn rnrn rn rn rn rn rnrnrn出错信息,提示是service层出错,顺便贴上service层代码rnrnorg.apache.ibatis.binding.BindingException: Invalid bound statement (not found): test.service.UserTableService.selectByPrimaryKeyrn org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:189)rn org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:43)rn org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58)rn org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51)rn com.sun.proxy.$Proxy23.selectByPrimaryKey(Unknown Source)rn test.controller.SelectProject.selectProject(SelectProject.java:26)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn java.lang.reflect.Method.invoke(Method.java:498)rn org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)rn org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)rn org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)rn org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:777)rn org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:706)rn org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)rn org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)rn org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)rn org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)rn org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:648)rn org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:729)rn org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rnrnrnrnrn代码rnrnrn/**rn * 用户信息表操作rn * @authorrn *rn */rn@Servicern@Transactionalrnpublic class UserTableServiceImpl implements UserTableService rnrn @Autowiredrn private UserTableMapper userTableDao;rnrn public UserTable selectByPrimaryKey(Integer userId) rn return userTableDao.selectByPrimaryKey(userId);rn rnrn @Overridern public int insert(UserTable record) rn return userTableDao.insert(record);rn rnrnrnrn 论坛

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

01-07

问题如下:rn[org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver] - Resolving exception from handler [public java.lang.String com.cn.hnust.controller.UserController.toIndex(java.lang.String,java.lang.String,org.springframework.ui.Model)]: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.cn.hnust.dao.UserMapper.insertSelectivern[org.springframework.web.servlet.DispatcherServlet] - Could not complete requestrnorg.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.cn.hnust.dao.UserMapper.insertSelectivern at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:189)rn at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:43)rn at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58)rn at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51)rn at com.sun.proxy.$Proxy16.insertSelective(Unknown Source)rn at com.cn.hnust.service.impl.UserServiceImpl.insertUser(UserServiceImpl.java:25)rn at com.cn.hnust.controller.UserController.toIndex(UserController.java:34)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:497)rn at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)rn at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)rn at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:690)rn at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)rn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)rn at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)rn at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)rn at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)rn at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)rn at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)rn at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)rn at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn at java.lang.Thread.run(Thread.java:745)rn__________________________________________________________________________________________________rnrn利用mybatis-generator-core-1.3.2自动生成UserMapper,UserMapper.xml,User文件rnrn源码这里粘贴长度不允许,传至github,maven下的工程结构很简单,希望各位大大能够帮忙看一下,弄了很久一直没弄好spring-mybatis的一个问题。rnhttps://github.com/Bonsen/Spring-SpringMVC-mybatis 论坛

mybatis错误Invalid bound statement (not found)万分感谢!

12-15

0.问题说明:n我是一名菜鸟,最近使用spring-mvc ,spring,mybatis框架n这两天出现一个错误一直搞不定,心好累,恳请前辈帮帮忙n1. 异常n```n org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.misscandy.inter.UserMapper.findAllUsersn org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)n org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)n javax.servlet.http.HttpServlet.service(HttpServlet.java:647)n org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)n javax.servlet.http.HttpServlet.service(HttpServlet.java:728)n org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)n org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)n org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)n```nnn n n2.我的配置文件n n```n n n n n nn n n n n n n```n3.接口nUserMapper.javannn```n package com.misscandy.inter;nnimport java.util.Vector;nnimport com.misscandy.entity.User;nimport com.misscandy.mapper.Mapper;nnn@Mappernpublic interface UserMapper n void addUser(User user);n //void deleteUser(User user);n //void updateDept(User user);n User findUserByName(String userName);n Vector findAllUsers();n //List> findValue();n //List findValues();nnn```nn4.UserMapper.xmlnnn```n nn nnn n n n n n n n n n n nn n n select user_id,user_name,image_src,age,sex,type from users where user_name = #userNamen n nn n n select user_id,user_name,age,sex,type from usersn n nn n n insert into users n (user_name,password,sex,age,type)n valuesn (#userName,#password,#sex,#age,1)n n nnnnn```nnn 问答

mybatis错误Invalid bound statement (not found) 万分感谢!

12-15

0.问题说明:rn我是一名菜鸟,最近使用spring-mvc ,spring,mybatis框架rn这两天出现一个错误一直搞不定,心好累,恳请前辈帮帮忙rn1. 异常rn```rn org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.misscandy.inter.UserMapper.findAllUsersrn org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)rn org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:647)rn org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:728)rn org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rn org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)rn org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn```rnrnrn rn rn2.我的配置文件rn rn```rn rn rn rn rn rnrn rn rn rn rn rn rn```rn3.接口rnUserMapper.javarnrnrn```rn package com.misscandy.inter;rnrnimport java.util.Vector;rnrnimport com.misscandy.entity.User;rnimport com.misscandy.mapper.Mapper;rnrnrn@Mapperrnpublic interface UserMapper rn void addUser(User user);rn //void deleteUser(User user);rn //void updateDept(User user);rn User findUserByName(String userName);rn Vector findAllUsers();rn //List> findValue();rn //List findValues();rnrnrn```rnrn4.UserMapper.xmlrnrnrn```rn rnrn rnrnrn rn rn rn rn rn rn rn rn rn rn rnrn rn rn select user_id,user_name,image_src,age,sex,type from users where user_name = #userNamern rn rnrn rn rn select user_id,user_name,age,sex,type from usersrn rn rnrn rn rn insert into users rn (user_name,password,sex,age,type)rn valuesrn (#userName,#password,#sex,#age,1)rn rn rnrnrnrnrn```rnrnrnrn 问答

mybatis+spring-boot出现Invalid bound statement (not found):问题

04-29

初学mybatis+spring-boot整合,报错如下:rn[code=java]org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.nx.zhjf.mapper.UserMapper.findUserByUsernamern [/code]rn我的代码结构如下:rn[img=https://img-bbs.csdn.net/upload/201704/29/1493469852_659574.png][/img][img=https://img-bbs.csdn.net/upload/201704/29/1493469861_915777.png][/img]rnapplication.ym配置文件如下:[code=java]rnspring:rn datasource:rn driver-class-name:org.postgresql.Driverrn url:jdbc:postgresql://localhost:5432/nxrn username:postgresrn password:postgresrn# schema:classpath:import.sqlrn tomcat:rn max-active:30rn max-wait:1000rn max-idle:20rn remove-abandoned-timeout:180rnmybatis:rn config-location:classpath:mybatis-config.xmlrnrn[/code]rnrnUserMapper.xml如下:rn[code=html]rnrnrnrn rn insert into t_user(username,age) values(#userName,jdbcType=VARCHAR,#age,jdbcType=NUMERIC)rn rnrn rn select * from t_user where id = #id,jdbcType=NUMERICrn rnrn rn update t_user setrn username = #userName,jdbcType=VARCHAR ,rn age = #age,jdbcType=NUMERICrn where id = #id,jdbcType=NUMERICrn rnrn rn delete from t_user where id = #id,jdbcType=NUMERICrn rnrn rn rn select * from t_user where username LIKE #patternrn rnrn rn SELECT COUNT(*) FROM t_userrn rnrn rn select * from t_userrn rnrnrnrn[/code]rnUserMapper.java如下:rn[code=java]rn@Mapperrnpublic interface UserMapper rn int save(User user);rnrn User selectById(Integer id);rnrn int updateById(User user);rnrn int deleteById(Integer id);rnrn List findUserByUsername(String username);rnrn int count();rnrn List queryAll();rnrn[/code]rnrn请大神帮我看下,哪里出问题了。rnrnrnrn 论坛

springboot发生Invalid bound statement (not found):问题

02-19

各路大仙帮帮忙,之前按网上的各招试过,包括:rn1.把mapper接口和mapper的xml文件所在包名写一致:rn2.pom.xml中build标签下添加依赖,强制将xml文件打到war包中rn3.mapper.xml文件中namespace也写正确了rn结局都是:rn[img=https://img-bbs.csdn.net/upload/201902/18/1550505148_669417.png][/img]rnrn菜鸟哪里写错了吗?部分图片无法上传,只好直接粘代码rnrn1)包结构:rn[img=https://img-bbs.csdn.net/upload/201902/18/1550504298_392276.png][/img]rnrn2)我的pom.xml如下:rn[img=https://img-bbs.csdn.net/upload/201902/18/1550504923_838569.png][/img]rnrn[img=https://img-bbs.csdn.net/upload/201902/18/1550504934_995363.png][/img]rnrn[img=https://img-bbs.csdn.net/upload/201902/18/1550504945_609507.png][/img]rnrn3)配置文件.properties:rnspring.datasource.url=jdbc:oracle:thin:@localhost:1521:orclrnspring.datasource.username=FLWrnspring.datasource.password=FLWrnspring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriverrnspring.datasource.max-idle=10rnspring.datasource.max-wait=10000rnspring.datasource.min-idle=5rnspring.datasource.initial-size=5rnrnserver.port=8085rnserver.session.timeout=10rnserver.tomcat.uri-encoding=UTF-8rnrnmybatis.mapperLocations=classpath*:com.dadiao.cock.mapper/*.xmlrnmybatis.typeAliasesPackage=com.dadiao.cock.mapperrnrnrn4)Mapper接口和xml文件:rn[img=https://img-bbs.csdn.net/upload/201902/19/1550506541_399016.png][/img]rnrnrnrn rn insert into t_member(user_id,theName,age,sex,tel)rn values (seq_mem.nextval,#theName,jdbcType=VARCHAR,#age,jdbcType=INTEGER,#sex,jdbcType=INTEGER,#tel,jdbcType=INTEGER)rn rnrnrnrnrn5)SpringBootApplication类:rn @SpringBootApplicationrn @MapperScan("com.dadiao.cock.mapper")rn public class BootApplication rn public static void main (String[] args)rn SpringApplication.run(BootApplication.class, args);rn rn rnrn6)测试类:rn @RunWith(SpringRunner.class)rn @SpringBootTestrn public class DataTest rnrn @Autowiredrn private MassageMapper mapper;rn @Testrn public void contextLoads()rnrn User user = new User();rn user.setAge(18);rn user.setSex(2);rn user.setTel(110);rn user.setTheName("luzhaoli");rn int result = mapper.registerMember(user);rn System.out.println("结果为:"+result);rn rn 论坛

SpringMVC +Mybatis 一个问题 Invalid bound statement (not found):

04-24

SpringMVC 和Mybatis 集成 出现了一个问题,搜索了半天也没有解决;rnrnrnConsole 输出的错误:rn严重: Servlet.service() for servlet spring threw exceptionrnorg.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.test.www.dao.MainEntityMapper.selectByPrimaryKeyrn at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:184)rn at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:38)rn at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:49)rn at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:42)rn at $Proxy12.selectByPrimaryKey(Unknown Source)rn at com.test.www.service.impl.MainEntityServiceImpl.selectByPrimaryKey(MainEntityServiceImpl.java:24)rn at com.test.www.controller.MyTestController.sayHello(MyTestController.java:24)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)rn at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)rn at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)rn at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)rn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)rn at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)rn at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)rn at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)rn at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)rn at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864)rn at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)rn at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665)rn at java.lang.Thread.run(Thread.java:619)rnrn只跑SpringMVC是没有问题的,和 Mybatis 数据库结合就出问题了:rnrnSpring的 配置文件:ApplicationContext.xml 的内容:rnrn rn rn rn rn classpath:database.properties rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrnrn rnrn目录结构:rn[img=https://img-bbs.csdn.net/upload/201704/24/1493001264_147346.png][/img]rnrn不知道问题出在哪了,困扰了好几天了。 论坛

Spring+mybatis整合报异常Invalid bound statement (not found)

07-03

## 直接上图了,例子很简单,图虽多但每张图代码都很少,希望大神解救:rn![图片说明](https://img-ask.csdn.net/upload/201607/03/1467546343_985846.jpg)rn## 代码图---》rn![图片说明](https://img-ask.csdn.net/upload/201607/03/1467546370_366042.jpg)rn![图片说明](https://img-ask.csdn.net/upload/201607/03/1467546378_236264.jpg)rn![图片说明](https://img-ask.csdn.net/upload/201607/03/1467546386_793432.jpg)rn![图片说明](https://img-ask.csdn.net/upload/201607/03/1467546394_5749.jpg)rn![图片说明](https://img-ask.csdn.net/upload/201607/03/1467546406_874546.jpg)rn## 配置文件---》rn![图片说明](https://img-ask.csdn.net/upload/201607/03/1467546425_74927.jpg)rn## 测试报错---》rn![图片说明](https://img-ask.csdn.net/upload/201607/03/1467546443_193123.jpg)rn## 完整的异常信息如下:rnorg.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.cailikun.dao.IUserDao.queryonern at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:178)rn at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:38)rn at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:49)rn at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:42)rn at $Proxy11.queryone(Unknown Source)rn at com.cailikun.service.impl.UserServiceImpl.queryone(UserServiceImpl.java:21)rn at com.cailikun.test.TestMyBatis.test1(TestMyBatis.java:23)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:601)rn at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)rn at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)rn at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)rn at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)rn at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)rn at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:236)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)rnCaused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.cailikun.dao.IUserDao.queryonern at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:768)rn at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:603)rn at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:596)rn at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:176)rn ... 34 morernrnrnrn 问答

ssm整合,报错:org.apache.ibatis.binding.BindingException: Invalid bound statement

07-28

想要自己搭建一下ssm框架,运行就给报错,无从下手,求帮助:rn报错信息:[code=java]严重: Servlet.service() for servlet [SpringMVC] in context with path [] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): web.dao.WebkUserDao.selectByPrimaryKey] with root causernorg.apache.ibatis.binding.BindingException: Invalid bound statement (not found): web.dao.WebkUserDao.selectByPrimaryKeyrn at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:189)rn at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:43)rn at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58)rn at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51)rn at com.sun.proxy.$Proxy13.selectByPrimaryKey(Unknown Source)rn at web.service.WebkUserService.find(WebkUserService.java:18)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:498)rn at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)rn at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)rn at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)rn at com.sun.proxy.$Proxy16.find(Unknown Source)rn at web.controller.IndexController.test(IndexController.java:58)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:498)rn at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)rn at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)rn at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:690)rn at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)rn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)rn at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)rn at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)rn at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)rn at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:442)rn at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1082)rn at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:623)rn at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn at java.lang.Thread.run(Thread.java:745)rnrn七月 28, 2016 11:09:00 上午 org.apache.catalina.core.ApplicationContext logrn信息: Destroying Spring FrameworkServlet 'SpringMVC'rn七月 28, 2016 11:09:00 上午 org.apache.catalina.core.ApplicationContext logrn信息: Closing Spring root WebApplicationContext[/code]rnrn配置文件如下:rnapplicationContext-dao.xmlrn[code=java]rn rnrn rn rn rn rn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn [/code]rnapplicationContext-service.xmlrn[code=java][/code]rnapplicationContext-transaction.xmlrn[code=java]rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn [/code]rnspringmvc.xmlrn[code=java]rn rnrn rn rn rn rnrn rn rn rn rn rn [/code]rn 论坛

这个错误可能原因是什么?

09-03

代码中加入这两行就抱错:rnrnrn不加就没问题.rnrnrnHTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnjavax.servlet.ServletException: ch/ess/excel/ExcelFilern org.apache.jasper.servlet.JspServlet.service(JspServlet.java:244)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:810)rnrnrnroot cause rnrnjava.lang.NoClassDefFoundError: ch/ess/excel/ExcelFilern java.lang.Class.getDeclaredConstructors0(Native Method)rn java.lang.Class.privateGetDeclaredConstructors(Class.java:1610)rn java.lang.Class.getConstructor0(Class.java:1922)rn java.lang.Class.newInstance0(Class.java:278)rn java.lang.Class.newInstance(Class.java:261)rn org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1212)rn org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)rn org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)rn org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)rn org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)rn org.apache.jasper.compiler.Node$Root.accept(Node.java:456)rn org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)rn org.apache.jasper.compiler.Generator.generate(Generator.java:3261)rn org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:461)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:442)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:430)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:274)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:810)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.0.25 logs.rnrnrn--------------------------------------------------------------------------------rnrnApache Tomcat/5.0.25rnrnrn 论坛

没有更多推荐了,返回首页