Ibatis错误 Error parsing XPath '/sqlMapConfig/sqlMap'.
今天遇到了一个异常,困扰的时间比较长,觉得挺郁闷的,开始以为是哪里的配置文件被修改错了。后来才发现,原来是我的sql-map中的某个语句写的有问题。将sql语句改正确后就ok了。标记一下。
?
异常信息如下:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in class path resource [config/spring/spring-application.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [config/ibatis/sqlmap-config.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no parameter map named java.util.HashMap 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:3830)at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)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:566)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 [config/ibatis/sqlmap-config.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no parameter map named java.util.HashMap 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)... 30 moreCaused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no parameter map named java.util.HashMap in this SqlMap.at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:62)at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:62)at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:55)at org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(SqlMapClientFactoryBean.java:339)... 33 moreCaused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no parameter map named java.util.HashMap in this SqlMap.at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:123)at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:84)at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:102)at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72)at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:60)... 36 moreCaused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no parameter map named java.util.HashMap in this SqlMap.at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:62)at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:44)at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$10.process(SqlMapConfigParser.java:257)at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121)... 40 moreCaused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no parameter map named java.util.HashMap in this SqlMap.at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:123)at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:84)at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:102)at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72)at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:60)... 43 moreCaused by: com.ibatis.sqlmap.client.SqlMapException: There is no parameter map named java.util.HashMap in this SqlMap.at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.getParameterMap(SqlMapExecutorDelegate.java:327)at com.ibatis.sqlmap.engine.config.MappedStatementConfig.<init>(MappedStatementConfig.java:52)at com.ibatis.sqlmap.engine.config.SqlMapConfiguration.newMappedStatementConfig(SqlMapConfiguration.java:159)at com.ibatis.sqlmap.engine.builder.xml.SqlStatementParser.parseGeneralStatement(SqlStatementParser.java:73)at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser$21.process(SqlMapParser.java:362)at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121)... 47 more2010-10-21 14:54:02 org.apache.catalina.core.StandardContext listenerStart严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in class path resource [config/spring/spring-application.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [config/ibatis/sqlmap-config.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no parameter map named java.util.HashMap 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:3830)at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)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:566)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 [config/ibatis/sqlmap-config.xml]; nested exception is com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no parameter map named java.util.HashMap 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)... 30 moreCaused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no parameter map named java.util.HashMap in this SqlMap.at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:62)at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:62)at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:55)at org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(SqlMapClientFactoryBean.java:339)... 33 moreCaused by: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is no parameter map named java.util.HashMap in this SqlMap.at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:123)at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:84)at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:102)at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72)at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:60)... 36 more
?
1 楼 jiangjingxiaoxuan 2011-10-19 能说明一下写错的语句是什么吗?今天下午出现的问题,很烦啊~~~ 2 楼 远去的渡口 2011-10-19 jiangjingxiaoxuan 写道能说明一下写错的语句是什么吗?今天下午出现的问题,很烦啊~~~