亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

這個錯誤是怎么回事.UnsatisfiedDependencyException

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'app': Unsatisfied dependency expressed through field 'userDOMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userDOMapper' defined in file [/Users/Tony/Documents/workspace/miaosha/target/classes/com/miaoshaproject/dao/UserDOMapper.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 [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [/Users/Tony/Documents/workspace/miaosha/target/classes/mapping/UserDOMapper.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.miaoshaproject.dao.UserDOMapper.BaseResultMap


正在回答

5 回答

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dbValidator': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [/Volumes/Backup Plus/貓眼/coding-273/源碼/用戶模塊/guns/guns-user/target/classes/com/stylefeng/guns/rest/common/persistence/dao/UserMapper.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 [com/baomidou/mybatisplus/spring/boot/starter/MybatisPlusAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is com.baomidou.mybatisplus.exceptions.MybatisPlusException: Error: GlobalConfigUtils setMetaData Fail !? Cause:java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.


0 回復 有任何疑惑可以回復我~

統一回復:mybatis-generator.xml重新生成Mapper.xml時把之前的xml刪除再次運行

2 回復 有任何疑惑可以回復我~
#1

慕瓜0431166

感謝!
2019-09-01 回復 有任何疑惑可以回復我~

這個好像是每一次運行mybatis-generator命令時會在UserDOMapper.xml和UserPasswordDOMapper.xml中重復生成resultmap的原因,找到重復的刪除就好

3 回復 有任何疑惑可以回復我~

解決了么,我也碰到在這個問題了

0 回復 有任何疑惑可以回復我~

IllegalArgumentException: Result Maps collection already contains value for com.miaoshaproject.dao.UserDOMapper.BaseResultMap

你看下是不是有 resultMap 的 id 重復了,復制之后忘記修改id?

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

這個錯誤是怎么回事.UnsatisfiedDependencyException

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號