The alias 'GeneratedCriteria' is already mapped to the value '***.***.***.ManagerExample$

末蓝、 2022-01-17 20:09 617阅读 0赞
  1. Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'betRecdMapper' defined in file
  2. [F:\IdeaProjects\game\target\classes\com\good\game\dao\def\BetRecdMapper.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
  3. [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]:
  4. Factory method 'sqlSessionFactory' threw exception; nested exception is org.apache.ibatis.type.TypeException: The alias 'Criterion' is already mapped to the value 'com.good.game.domain.def.GameListExample$Criterion'.

百度了半天,在外国友人的一个论坛下发现了这么一句话。

我使用mybatis生成器生成域和映射器。当我生成一个表时它很好用。

当我生成另一个表时,问题出现了。似乎”xxxExample”和”xxxExample”中的Criterion类冲突,但它是由mybatis生成的。

给出的解决方案:
目前的解决方法是使用mybatis-spring 2.0.0或2.0.2-SNAPSHOT。

很奇怪的问题!我换了以后好使了!

注意我这里使用的是springboot2.1.4!!!!!

发表评论

表情:
评论列表 (有 0 条评论,617人围观)

还没有评论,来说两句吧...

相关阅读