`
Ben.Sin
  • 浏览: 234192 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

iBatis异常There is no statement named update in this SqlMap.

    博客分类:
  • Java
阅读更多

最近使用iBatis搭建项目架构的时候遇到了一个异常,如下文所示

 

 

Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/end()'.  Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named update in this SqlMap.

 

但是搜索所有SqlMap的上下文,都没有发现There is no statement named update in this SqlMap

 

无论是<cacheModel/>还是<update/>都没有遗漏update的statement. 后来经google后发现,原来cacheModel中需要指定namespace, 加上之后就一切正常了。

 

(此文标记一下,以备不时之需)

 

 

产生异常的cacheModel

<cacheModel id="xxx-cache" type ="LRU" readOnly="true" serialize="false">
	<flushInterval hours="24"/>
	<flushOnExecute statement="insert"/>
	<flushOnExecute statement="update"/>
	<flushOnExecute statement="delete"/>
	<property name="cache-size" value="1000"/>
</cacheModel>

<update id="update" parameterClass="...">
	...
</update>

 

正常的cacheModel配置

<cacheModel id="xxx-cache" type ="LRU" readOnly="true" serialize="false">
	<flushInterval hours="24"/>
	<flushOnExecute statement="namespace.insert"/>
	<flushOnExecute statement="namespace.update"/>
	<flushOnExecute statement="namespace.delete"/>
	<property name="cache-size" value="1000"/>
</cacheModel>

<update id="update" parameterClass="...">
	...
</update>

 

[INFO ] [09:18:05] org.springframework.beans.factory.support.DefaultListableBeanFactory:421 - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1113622: defining beans [dataSource,dataSource2,transactionManager,sqlMapClient,baseDao,baseTransProxy,auserDao,auserLoginHisDao,auserViewHisDao,personDao,auserService,auserLoginHisService,auserViewHisService,personService,propertyConfigurer]; root of factory hierarchy
[ERROR] [09:18:05] org.springframework.web.context.ContextLoader:215 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in class path resource [dataAccessContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [net/inforcn/inforcnSqlMapConfig.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/end()'.  Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named update in this SqlMap.
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
	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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [net/inforcn/inforcnSqlMapConfig.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/end()'.  Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named update in this SqlMap.
	at org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(SqlMapClientFactoryBean.java:342)
	at org.springframework.orm.ibatis.SqlMapClientFactoryBean.afterPropertiesSet(SqlMapClientFactoryBean.java:292)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
	... 39 more
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/end()'.  Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named update in this SqlMap.
	at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:62)
	at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:106)
	at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:95)
	at org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(SqlMapClientFactoryBean.java:339)
	... 42 more
Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/end()'.  Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named update in this SqlMap.
	at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:123)
	at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:105)
	at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72)
	at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:60)
	... 45 more
Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named update in this SqlMap.
	at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.getMappedStatement(SqlMapExecutorDelegate.java:293)
	at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$1.process(SqlMapConfigParser.java:124)
	at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121)
	... 48 more
2009-10-26 9:18:05 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in class path resource [dataAccessContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [net/inforcn/inforcnSqlMapConfig.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/end()'.  Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named update in this SqlMap.
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
	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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [net/inforcn/inforcnSqlMapConfig.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/end()'.  Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named update in this SqlMap.
	at org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(SqlMapClientFactoryBean.java:342)
	at org.springframework.orm.ibatis.SqlMapClientFactoryBean.afterPropertiesSet(SqlMapClientFactoryBean.java:292)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
	... 39 more
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/end()'.  Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named update in this SqlMap.
	at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:62)
	at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:106)
	at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:95)
	at org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(SqlMapClientFactoryBean.java:339)
	... 42 more
Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/end()'.  Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named update in this SqlMap.
	at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:123)
	at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:105)
	at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72)
	at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:60)
	... 45 more
Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no statement named update in this SqlMap.
	at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.getMappedStatement(SqlMapExecutorDelegate.java:293)
	at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$1.process(SqlMapConfigParser.java:124)
	at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121)
	... 48 more
2009-10-26 9:18:05 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2009-10-26 9:18:05 org.apache.catalina.core.StandardContext start
严重: Context [/benweb] startup failed due to previous errors
2009-10-26 9:18:05 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2009-10-26 9:18:06 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
分享到:
评论

相关推荐

    基于net的超市管理系统源代码(完整前后端+sqlserver+说明文档+LW).zip

    功能说明: 环境说明: 开发软件:VS 2017 (版本2017以上即可,不能低于2017) 数据库:SqlServer2008r2(数据库版本无限制,都可以导入) 开发模式:mvc。。。

    LABVIEW程序实例-公式节点.zip

    labview程序代码参考学习使用,希望对你有所帮助。

    大米商城开源版damishop(适合外贸)

    大米外贸商城系统 简称damishop 完全开源版,只需做一种语言一键开启全球133中语言自动翻译功能,价格实现自动汇率转换,集成微信支付宝 paypal以及国外主流支付方式,自带文章博客系统。 软件架构 基于MVC+语言包模式,增加控制台,API导入产品方便对接其他系统(带json示例数据)。 使用要求 PHP7.4+ MYSQL5.6+ REDIS(可选) 安装方法 composer install 打开安装向导安装 http://您的域名/install 特色 1、缓存层增加时间与批量like删除 2、API产品导入方便对接其他系统 3、增加控制台命令行,命令行生成语言翻译包 4、后台一键开启自动翻译模式,支持全球133中语言,由于google代理翻译需要收费,这个功能需要付费。 5、可选购物车与ajax修改购物车产品 6、一键结算checkout 7、增加网站前台自定义路由 方便seo 更新日志 v3.9.7 集成鱼码支付接口,方便个人站长即使收款到账使用 v3.9.3 更新内容 1:增加ueditor与旧编辑器切换 2:增加可视化布局插

    LABVIEW程序实例-通过全局变量接收数据.zip

    labview程序代码参考学习使用,希望对你有所帮助。

    LABVIEW程序实例-日历控件.zip

    labview程序代码参考学习使用,希望对你有所帮助。

    毕设和企业适用springboot人工智能客服系统类及旅游规划平台源码+论文+视频.zip

    毕设和企业适用springboot人工智能客服系统类及旅游规划平台源码+论文+视频

Global site tag (gtag.js) - Google Analytics