Error creating bean with name 'itemController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.taotao.service.ItemService com.taotao.controller.ItemController.itemService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemService': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.taotao.service.ItemService. No provider available for the service com.taotao.service.ItemService from the url zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=taotao-manager-web&dubbo=2.5.3&interface=com.taotao.service.ItemService&methods=getItemById&pid=928&revision=1.0-SNAPSHOT&side=consumer×tamp=1527688447224 to the consumer 169.254.10.106 use dubbo version 2.5.3
看到上面错误提示,发现已经去连接zookeeper了,但没有发现服务提供者.这是表现层先于服务端启动造成的,解决方法就是按顺序先启动service服务端,再启动web表现层.
Invalid bound statement (not found): com.taotao.mapper.ItemMapper.selectByPrimaryKey
ibatis绑定异常,无效的绑定,找不到对应的实现
具体表现,target-classes里面只有mapper没有xml,所以会报这个错.
解决方法:
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*.properties</include>
- <include>**/*.xml</include>
- </includes>
- <filtering>false</filtering>
- </resource>
- <resource>
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.xml</include>
- </includes>
- <filtering>false</filtering>
- </resource>
- </resources>
问题描述
今天在做项目时,遇到一个错误:“Result Maps collection already contains value for com.xxx.dao.tb_userMapper.BaseResultMap”
二、原因分析
Mybatis-Generator在生成Mapper.xml文件时,会在原来基础上再生成,导致内容重复。
解决方法:删除多余的,或者重新生成