我是靠谱客的博主 忐忑冷风,最近开发中收集的这篇文章主要介绍Caused by: org.springframework.beans.factory.BeanCreationException,觉得挺不错的,现在分享给大家,希望可以做个参考。
概述
- 报错信息:
- Caused
by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource [/WEB-INF/conf/spring-common.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [C:Program FilesApache Software FoundationTomcat 7.0webappsXXWEB-INFclassesXXMapper.xml]'; nested exception is java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'BaseResultMap'. Cause: java.lang.ClassNotFoundException: Cannot find class: BaseResultMap -
at org.springframework.beans.factory.support.AbstractAutowireCapableB eanFactory.initializeBean(AbstractAutowireCapableB eanFactory.java:1455) -
at org.springframework.beans.factory.support.AbstractAutowireCapableB eanFactory.doCreateBean(AbstractAutowireCapableB eanFactory.java:519) -
at org.springframework.beans.factory.support.AbstractAutowireCapableB eanFactory.createBean(AbstractAutowireCapableB eanFactory.java:456) -
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) -
at org.springframework.beans.factory.support.DefaultSingletonBeanRegi stry.getSingleton(DefaultSingletonBeanRegi stry.java:225) -
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) -
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) -
at org.springframework.beans.factory.support.BeanDefinitionValueResol ver.resolveReference(BeanDefinitionValueResol ver.java:322) -
... 29 more - Caused
by: org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [C:Program FilesApache Software FoundationTomcat 7.0webappsXX.xml]'; nested exception is java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'BaseResultMap'. Cause: java.lang.ClassNotFoundException: Cannot find class: BaseResultMap -
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:412) -
at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:295) -
at org.springframework.beans.factory.support.AbstractAutowireCapableB eanFactory.invokeInitMethods(AbstractAutowireCapableB eanFactory.java:1514) -
at org.springframework.beans.factory.support.AbstractAutowireCapableB eanFactory.initializeBean(AbstractAutowireCapableB eanFactory.java:1452) -
... 36 more - Caused
by: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'BaseResultMap'. Cause: java.lang.ClassNotFoundException: Cannot find class: BaseResultMap -
at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:113) -
at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:88) -
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:410) -
... 39 more - Caused
by: org.apache.ibatis.builder.BuilderException: Error resolving class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'BaseResultMap'. Cause: java.lang.ClassNotFoundException: Cannot find class: BaseResultMap -
at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:94) -
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseS - 2014-01-16
16:27:19,921 INFO [utils.init.CommonContextListener] - - tatementNode(XMLStatementBuilder.java:83)
-
at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContex t(XMLMapperBuilder.java:128) -
at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContex t(XMLMapperBuilder.java:121) -
at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:111) -
... 41 more - Caused
by: org.apache.ibatis.type.TypeException: Could not resolve type alias 'BaseResultMap'. Cause: java.lang.ClassNotFoundException: Cannot find class: BaseResultMap -
at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:109) -
at org.apache.ibatis.builder.BaseBuilder.resolveAlias(BaseBuilder.java:115) -
at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:92) -
... 45 more - Caused
by: java.lang.ClassNotFoundException: Cannot find class: BaseResultMap -
at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:188) -
at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:87) -
at org.apache.ibatis.io.Resources.classForName(Resources.java:250) -
at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:105) -
... 47 more -
解决方法:
xml配置如下:
错误点:
看到那个resultType了么,就是它惹的祸,这里把resultType改为resultMap就OK啦,重启tomcat,木有异常啦
最后
以上就是忐忑冷风为你收集整理的Caused by: org.springframework.beans.factory.BeanCreationException的全部内容,希望文章能够帮你解决Caused by: org.springframework.beans.factory.BeanCreationException所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复