Caused by_ org.springframework.beans.factory.UnsatisfiedDependencyException_

Error message

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘LogMapper’ defined in file [F:\sale\build\classes\java\main\com\sun\controller\mapper\LogMapper.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/autoconfigure/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 org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [F:\sale\build\resources\main\mapper\LogMapper.xml]’; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is ‘file [F:\sale\build\resources\main\mapper\LogMapper.xml]’. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias ‘OperLog’. Cause: java.lang.ClassNotFoundException: Cannot find class: OperLog

Cause of the problem: The class cannot be found during custom injection.

Solution: Add path configuration in the configuration file.

mybatis-plus:
  mapper-locations:
    - classpath*:mapper/*Mapper.xml
  # Search for a specified package alias
  typeAliasesPackage: com.sun.domain