淘淘商城几个错误

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&timestamp=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,所以会报这个错.

淘淘商城几个错误

解决方法:

淘淘商城几个错误 

  1. <resources>  
  2.             <resource>  
  3.                 <directory>src/main/resources</directory>  
  4.                 <includes>  
  5.                     <include>**/*.properties</include>  
  6.                     <include>**/*.xml</include>  
  7.                 </includes>  
  8.                 <filtering>false</filtering>  
  9.             </resource>  
  10.             <resource>  
  11.                 <directory>src/main/java</directory>  
  12.                 <includes>  
  13.                     <include>**/*.xml</include>  
  14.                 </includes>  
  15.                 <filtering>false</filtering>  
  16.             </resource>  
  17.         </resources>  


问题描述
今天在做项目时,遇到一个错误:“Result Maps collection already contains value for com.xxx.dao.tb_userMapper.BaseResultMap”
二、原因分析

    Mybatis-Generator在生成Mapper.xml文件时,会在原来基础上再生成,导致内容重复。

解决方法:删除多余的,或者重新生成