警告: Exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘articleController’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: pri.rong.blog.service.TagService pri.rong.blog.controller.ArticleController.tagService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘tagService’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private pri.rong.blog.dao.TagMapper pri.rong.blog.service.TagService.tagMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [pri.rong.blog.dao.TagMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘articleMapper’ defined in file [D:\idea2020.3.1(reinstall)\myblog\target\classes\pri\rong\blog\dao\ArticleMapper.class]: Cannot resolve reference to bean ‘sqlSessionFactory’ while setting bean property ‘sqlSessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [spring-core.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [D:\idea2020.3.1(reinstall)\myblog\target\classes\mapper\ArticleMapper.xml]’; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalStateException: No typehandler found for property tagList Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘articleTagMapper’ defined in file [D:\idea2020.3.1(reinstall)\myblog\target\classes\pri\rong\blog\dao\ArticleTagMapper.class]: Cannot resolve reference to bean ‘sqlSessionFactory’ while setting bean property ‘sqlSessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [spring-core.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [D:\idea2020.3.1(reinstall)\myblog\target\classes\mapper\ArticleMapper.xml]’; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalStateException: No typehandler found for property tagList Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘categoryMapper’ defined in file
tagList的类型如下:
解决方案:
注释掉这一行就好了。
疑惑
为何这样写不行呢??????
|