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

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'betRecdMapper' defined in file 
[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 
[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.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!!!!!

你可能感兴趣的:(报错内容)