问题描述
我正在获得这个NoSuchMethodError,因为我已经在weblogic 10.3.6
中使用了ibatis 2.3.4的spring 3.2.0以下:
用户定义的监听器org.springframework.web.context.ContextLoaderListener失败:org.springframework.beans.factory.BeanCreationException:在ServletContext资源[/WEB-INF/applicationContext-granite-webservice.xml]中定义的名称为gatewayService的bean创建错误:在设置bean属性'dao'时无法解析对'daoIPInventory'的引用;嵌套异常是org.springframework.beans.factory.BeanCreationException:在ServletContext资源[/WEB-INF/applicationContext-ip-ibatis-db.xml]中定义的名称为'daoIPInventory'的bean创建错误:无法解析对'sqlMapClient'的引用同时设置bean属性'sqlMapClient';嵌套异常是org.springframework.beans.factory.BeanCreationException:在ServletContext资源[/WEB-INF/applicationContext-ip-ibatis-db.xml]中定义的名称为'sqlMapClient'的bean创建时出错):init方法的调用失败;嵌套异常是java.lang.NoSuchMethodError:com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava / io / InputStream; Ljava / util / Properties;)Lcom / ibatis / sqlmap / client / SqlMapClient ;.在$ servletContext-设置bean属性'dao';嵌套异常是org.springframework.beans.factory.BeanCreationException:在ServletContext资源[/WEB-INF/applicationContext-ip-ibatis-db.xml]中定义的名称为'daoIPInventory'的bean创建错误:无法解析对'sqlMapClient'的引用同时设置bean属性'sqlMapClient';嵌套异常是org.springframework.beans.factory.BeanCreationException:在ServletContext资源[/WEB-INF/applicationContext-ip-ibatis-db.xml]中定义的名称为'sqlMapClient'的bean创建时出错):init方法的调用失败;嵌套异常是java.lang.NoSuchMethodError:com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava / io / InputStream; Ljava / util / Properties;)Lcom / ibatis / sqlmap / client / SqlMapClient;
在org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
在org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
截断。查看日志文件以获取完整的stacktrace
引发者:org.springframework.beans.factory.BeanCreationException:在ServletContext资源中定义名称为'daoIPInventory'的bean创建错误[/WEB-INF/applicationContext-ip-ibatis-db.xml ]:在设置bean属性'sqlMapClient'时无法解析引用bean'sqlMapClient';嵌套异常是org.springframework.beans.factory.BeanCreationException:在ServletContext资源[/WEB-INF/applicationContext-ip-ibatis-db.xml]中定义的名称为'sqlMapClient'的bean创建时出错):init方法的调用失败;嵌套异常是java.lang.NoSuchMethodError:com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava / io / InputStream; Ljava / util / Properties;)Lcom / ibatis / sqlmap / client / SqlMapClient;
在org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
在org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
截断。查看日志文件以获取完整的stacktrace
导致:org.springframework.beans.factory.BeanCreationException:在ServletContext资源中定义的名称为'sqlMapClient'的bean创建时出错[/WEB-INF/applicationContext-ip-ibatis-db.xml ]:调用init方法失败;嵌套异常是java.lang.NoSuchMethodError:com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava / io / InputStream; Ljava / util / Properties;)Lcom / ibatis / sqlmap / client / SqlMapClient;
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory $ 1.run(AbstractAutowireCapableBeanFactory.java:409)
在java.security.AccessController.doPrivileged(本机方法)
在org.springframework .beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
截断。查看日志文件以获取完整的stacktrace
导致:java.lang.NoSuchMethodError:com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava / io / InputStream; Ljava / util / Properties;)Lcom / ibatis的/的SqlMap /客户机/的SqlMapClient;
在org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(SqlMapClientFactoryBean.java:339)
在org.springframework.orm.ibatis.SqlMapClientFactoryBean.afterPropertiesSet(SqlMapClientFactoryBean.java:292)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
截断。查看日志文件以获取完整的stacktrace
不兼容iBatis 2.3.4。
在没有方法#parse(InputStream,Properties),但在较新版本它是存在的。
在库版本。
然而,您应该更新myBatis的版本或找到适合的版本的Spring或Spring-iBatis整合。
i am using spring 3.2.0 with ibatis 2.3.4 in weblogic 10.3.6while deploying in weblogic.
I am getting this NoSuchMethodError as below:
User defined listener org.springframework.web.context.ContextLoaderListener failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gatewayService' defined in ServletContext resource [/WEB-INF/applicationContext-granite-webservice.xml]: Cannot resolve reference to bean 'daoIPInventory' while setting bean property 'dao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoIPInventory' defined in ServletContext resource [/WEB-INF/applicationContext-ip-ibatis-db.xml]: Cannot resolve reference to bean 'sqlMapClient' while setting bean property 'sqlMapClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in ServletContext resource [/WEB-INF/applicationContext-ip-ibatis-db.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava/io/InputStream;Ljava/util/Properties;)Lcom/ibatis/sqlmap/client/SqlMapClient;.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gatewayService' defined in ServletContext resource [/WEB-INF/applicationContext-granite-webservice.xml]: Cannot resolve reference to bean 'daoIPInventory' while setting bean property 'dao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoIPInventory' defined in ServletContext resource [/WEB-INF/applicationContext-ip-ibatis-db.xml]: Cannot resolve reference to bean 'sqlMapClient' while setting bean property 'sqlMapClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in ServletContext resource [/WEB-INF/applicationContext-ip-ibatis-db.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava/io/InputStream;Ljava/util/Properties;)Lcom/ibatis/sqlmap/client/SqlMapClient;
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
Truncated. see log file for complete stacktrace
Caused By: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoIPInventory' defined in ServletContext resource [/WEB-INF/applicationContext-ip-ibatis-db.xml]: Cannot resolve reference to bean 'sqlMapClient' while setting bean property 'sqlMapClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in ServletContext resource [/WEB-INF/applicationContext-ip-ibatis-db.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava/io/InputStream;Ljava/util/Properties;)Lcom/ibatis/sqlmap/client/SqlMapClient;
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
Truncated. see log file for complete stacktrace
Caused By: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in ServletContext resource [/WEB-INF/applicationContext-ip-ibatis-db.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava/io/InputStream;Ljava/util/Properties;)Lcom/ibatis/sqlmap/client/SqlMapClient;
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)
Truncated. see log file for complete stacktrace
Caused By: java.lang.NoSuchMethodError: com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava/io/InputStream;Ljava/util/Properties;)Lcom/ibatis/sqlmap/client/SqlMapClient;
at org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(SqlMapClientFactoryBean.java:339)
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)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
Truncated. see log file for complete stacktrace
Looks like Spring 3.2 is not compatible with iBatis 2.3.4.
In iBatis 2.3.4 SqlMapConfigParser has no method #parse(InputStream, Properties), but in newer version myBatis 2.3.5 it is exist.
Probably problem also in MyBatis-Spring library version.
Nevertheless you should update version of myBatis or find appropriate version of Spring or Spring-iBatis integration.
这篇关于ibatis spring java.lang.NoSuchMethodError com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!