Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'blogServiceImpl': Unsatisfied dependency expressed through field 'blogDAO'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'blogDAO' defined in file [E:\1715\ssm-blog-admin\target\ssm-blog-admin\WEB-INF\classes\com\ssm\blog\dao\BlogDAO.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-config.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\1715\ssm-blog-admin\target\ssm-blog-admin\WEB-INF\classes\com\ssm\blog\dao\mapper\BlogMappper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'blogMap'.  Cause: java.lang.ClassNotFoundException: Cannot find class: blogMap
2018-01-06 11:38:20,931 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@6dbb8301: defining beans [org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,dataSource,blogServiceImpl,categoryServiceImpl,keywordsServiceImpl,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,sqlSessionFactory,org.mybatis.spring.mapper.MapperScannerConfigurer#0,transactionManager,txAdvice,org.springframework.aop.config.internalAutoProxyCreator,serviceMethod,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0,blogDAO,categoryDAO,keywordsDAO]; root of factory hierarchy
2018-01-06 11:38:20,931 ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'blogServiceImpl': Unsatisfied dependency expressed through field 'blogDAO'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'blogDAO' defined in file [E:\1715\ssm-blog-admin\target\ssm-blog-admin\WEB-INF\classes\com\ssm\blog\dao\BlogDAO.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-config.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\1715\ssm-blog-admin\target\ssm-blog-admin\WEB-INF\classes\com\ssm\blog\dao\mapper\BlogMappper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'blogMap'.  Cause: java.lang.ClassNotFoundException: Cannot find class: blogMap

ssm整合,tomcat启动的时候报错。出现 Could not resolve type alias 'blogMap'异常。出现这个异常的原因有可能有两个

1. 没有配置实体类的别名Alias,如果在mybatis的mapper中映射实体类不写包名,需要配置别名


    
        
        
        
        
       
    

2. resultMap和resultType写混了。通常这种情况会出现在select语句中。