spring_boot整合mybatis项目启动时报错

报错信息如下:

[INFO ] 06-29 10:50:45 [main] com.hand.demo.DemoApplication - logback INFO ( TRACE < DEBUG < INFO < WARN < ERROR )


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.4.0.RELEASE)


[INFO ] 06-29 10:50:46 [main] com.hand.demo.DemoApplication - Starting DemoApplication on LAPTOP-4VJQD705 with PID 10832 (F:\ueba-demo\target\classes started by jinzhifeng in F:\ueba-demo)
[DEBUG] 06-29 10:50:46 [main] com.hand.demo.DemoApplication - Running with Spring Boot v1.4.0.RELEASE, Spring v4.3.2.RELEASE
[INFO ] 06-29 10:50:46 [main] com.hand.demo.DemoApplication - The following profiles are active: demo
[INFO ] 06-29 10:50:46 [background-preinit] o.h.validator.internal.util.Version - HV000001: Hibernate Validator 5.2.4.Final
[INFO ] 06-29 10:50:46 [main] o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@e350b40: startup date [Thu Jun 29 10:50:46 GMT+08:00 2017]; root of context hierarchy
[INFO ] 06-29 10:50:48 [main] o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [file:/F:/ueba-demo/conf/dev/shiro.xml]
[INFO ] 06-29 10:50:49 [main] o.s.b.f.s.DefaultListableBeanFactory - Overriding bean definition for bean 'managementServletContext' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcHypermediaManagementContextConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.class]]
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'alarmDao' and 'com.hand.demo.dao.AlarmDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'applicationDao' and 'com.hand.demo.dao.ApplicationDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'authorityDao' and 'com.hand.demo.dao.AuthorityDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'baseOperDao' and 'com.hand.demo.dao.BaseOperDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'businessDao' and 'com.hand.demo.dao.BusinessDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'companyInfoDao' and 'com.hand.demo.dao.CompanyInfoDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'deAndEmpDao' and 'com.hand.demo.dao.DeAndEmpDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'deptDao' and 'com.hand.demo.dao.DeptDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'deptKpiDao' and 'com.hand.demo.dao.DeptKpiDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'empBusDao' and 'com.hand.demo.dao.EmpBusDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'empDao' and 'com.hand.demo.dao.EmpDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'empDetailDao' and 'com.hand.demo.dao.EmpDetailDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'freeStateDao' and 'com.hand.demo.dao.FreeStateDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'generalDao' and 'com.hand.demo.dao.GeneralDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'informDao' and 'com.hand.demo.dao.InformDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'infoTypeDao' and 'com.hand.demo.dao.InfoTypeDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'infoUrgencyDao' and 'com.hand.demo.dao.InfoUrgencyDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'interStatesDao' and 'com.hand.demo.dao.InterStatesDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'jobWebInfoDao' and 'com.hand.demo.dao.JobWebInfoDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'operateDetailDao' and 'com.hand.demo.dao.OperateDetailDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'operationConfigDao' and 'com.hand.demo.dao.OperationConfigDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'personageKpiDao' and 'com.hand.demo.dao.PersonageKpiDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'reportDao' and 'com.hand.demo.dao.ReportDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'roleDao' and 'com.hand.demo.dao.RoleDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'tagDao' and 'com.hand.demo.dao.TagDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'timeRecordDao' and 'com.hand.demo.dao.TimeRecordDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'workConditionDao' and 'com.hand.demo.dao.WorkConditionDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - Skipping MapperFactoryBean with name 'ywConfigDao' and 'com.hand.demo.dao.YwConfigDao' mapperInterface. Bean already defined with the same name!
[WARN ] 06-29 10:50:49 [main] o.m.s.mapper.ClassPathMapperScanner - No MyBatis mapper was found in '[com.hand.demo.dao]' package. Please check your configuration.
[WARN ] 06-29 10:50:49 [main] o.s.c.a.ConfigurationClassPostProcessor - Cannot enhance @Configuration bean definition 'myBatisMapperScannerConfig' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
[INFO ] 06-29 10:50:50 [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'loginUserManager' of type [class com.hand.demo.shiro.utils.LoginUserManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[INFO ] 06-29 10:50:50 [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor#0' of type [class org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[INFO ] 06-29 10:50:50 [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'DBConfig' of type [class com.hand.demo.config.DBConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[INFO ] 06-29 10:50:50 [main] com.zaxxer.hikari.HikariDataSource - demoDataSourceName - Started.
[INFO ] 06-29 10:50:51 [main] com.zaxxer.hikari.pool.PoolBase - demoDataSourceName - Driver does not support get/set network timeout for connections. (com.mysql.jdbc.JDBC4Connection.getNetworkTimeout()I)
[INFO ] 06-29 10:50:51 [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'dataSource' of type [class com.zaxxer.hikari.HikariDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[INFO ] 06-29 10:50:51 [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration' of type [class org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$$EnhancerBySpringCGLIB$$e3897a4f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[INFO ] 06-29 10:50:51 [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties' of type [class org.springframework.boot.autoconfigure.jdbc.DataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[INFO ] 06-29 10:50:51 [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'dataSourceInitializer' of type [class org.springframework.boot.autoconfigure.jdbc.DataSourceInitializer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[INFO ] 06-29 10:50:51 [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'myBatisConfig' of type [class com.hand.demo.config.MyBatisConfig$$EnhancerBySpringCGLIB$$8d124a16] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[INFO ] 06-29 10:50:51 [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'annotationDrivenTransactionManager' of type [class org.springframework.jdbc.datasource.DataSourceTransactionManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[INFO ] 06-29 10:50:51 [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$195d6ef] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[INFO ] 06-29 10:50:51 [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'redisRealm' of type [class com.hand.demo.shiro.shiro.RedisAuthenticatingRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not elig

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Spring Boot MyBatis 整合可以使用以下步骤: 1. 新建一个 Spring Boot 项目,并添加 MyBatisSpring MVC 的依赖。 ```xml <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.1.4</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> ``` 2. 配置 MyBatis 的数据源和 SQLSessionFactory。 ```java @Configuration @MapperScan("com.example.demo.mapper") public class MybatisConfig { @Bean @ConfigurationProperties(prefix = "spring.datasource") public DataSource dataSource() { return new DruidDataSource(); } @Bean public SqlSessionFactory sqlSessionFactory() throws Exception { SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean(); sessionFactory.setDataSource(dataSource()); return sessionFactory.getObject(); } } ``` 3. 编写 Mapper 接口和对应的 XML 映射文件。 ```java public interface UserMapper { @Select("SELECT * FROM user WHERE id = #{id}") User getUserById(@Param("id") Integer id); } ``` ```xml <mapper namespace="com.example.demo.mapper.UserMapper"> <select id="getUserById" resultType="com.example.demo.entity.User"> SELECT * FROM user WHERE id = #{id} </select> </mapper> ``` 4. 在 Controller 中注入 Mapper 并使用。 ```java @RestController public class UserController { @Autowired private UserMapper userMapper; @GetMapping("/user/{id}") public User getUserById(@PathVariable Integer id) { return userMapper.getUserById(id); } } ``` 以上就是 Spring Boot MyBatis 整合的基本步骤。需要注意的是,在使用 MyBatis 时,需要在 Mapper 接口上添加 `@Mapper` 注解或使用 `@MapperScan` 注解指定 Mapper 接口所在的包。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值