请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

Context initialization failed

严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userManageController’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.mall.service.IUserService com.mall.controller.backend.UserManageController.iUserService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘iUserService’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.mall.dao.UserMapper com.mall.service.impl.UserServiceImpl.userMapper; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userMapper’ defined in file [E:\apache-tomcat-7.0.75\webapps\ROOT\WEB-INF\classes\com\mall\dao\UserMapper.class]: Unsatisfied dependency expressed through bean property ‘sqlSessionFactory’: : Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [applicationContext-datasource.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [E:\apache-tomcat-7.0.75\webapps\ROOT\WEB-INF\classes\mappers\CartMapper.xml]’; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.mall.dao.CartMapper.BaseResultMap; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [applicationContext-datasource.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [E:\apache-tomcat-7.0.75\webapps\ROOT\WEB-INF\classes\mappers\CartMapper.xml]’; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.mall.dao.CartMapper.BaseResultMap

public interface IUserService {
ServerResponse login(String username, String password);
ServerResponse register(User user);
ServerResponse checkValid(String str, String type);
ServerResponse selectQuestion(String username);
ServerResponse checkAnswer(String username, String question, String answer);
ServerResponse forgetResetPassword(String username, String passwordNew, String forgetToken);
ServerResponse resetPassword( String passwordOld, String passwordNew, User user);
ServerResponse updateInformation(User user);
ServerResponse getInformation(Integer userId);
}

@Service(“iUserService”)
public class UserServiceImpl implements IUserService{
@Autowired
private UserMapper userMapper;

@Controller
@RequestMapping("/manage/user")
public class UserManageController {
@Autowired
private IUserService iUserService;

正在回答 回答被采纳积分+3

1回答

geelylucky 2020-03-30 19:04:22

同学,看这个Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.mall.dao.CartMapper.BaseResultMap

你的CartMapper.xml里面已经存在了com.mall.dao.CartMapper.BaseResultMap,不能同时写多个。

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号