Comments (12)
today, i meet the same problem ,but when i try
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.1</version>
this problem gone away, i guess this bug is belong to mybatis-spring
from mybatis-spring-boot.
包含两个吗?我测试过两个没问题。。
from mybatis-spring-boot.
包含2个,我是在原基础上增加了一个实体类,一个mapper和一个mapper.xml文件,就会出现上述问题,增加方式有不一样的地方吗?或者是否能提供该项目为多个mapper的情况
from mybatis-spring-boot.
我会增加多个mapper.
from mybatis-spring-boot.
期待您的多mapper模式
from mybatis-spring-boot.
我在项目中又新增了2个表和对应的实体、Mapper,你可以下载最新代码试试这个问题。
from mybatis-spring-boot.
赞,赶紧更新做了尝试,发现问题依旧,启动后会出现WARN,并且每个mapper重复3遍。
本次完全重新pull,仅修改了数据库连接地址和端口,感觉问题很诡异,附加本次相关的环境信息及日志,希望有所帮助。pom文件没有动过。另求一下您的编译环境。感觉这个问题很诡异,使用IDEA和mvn编译结果都一样。相关信息如下:
mac os X Yosemite
版本 10.10.1(14B25)
编译环境:
Information:Using javac 1.8.0_20 to compile java sources
Information:Module "mybatis-spring-boot (1) (tk.mybatis)" was fully rebuilt due to project configuration/dependencies changes
Information:16/1/31 下午11:04 - Compilation completed successfully in 6s 345ms
java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
mvn -version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T19:57:37+08:00)
Maven home: /usr/share/maven
Java version: 1.8.0_20, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.1", arch: "x86_64", family: "mac"
以下是日志信息:
:: Spring Boot :: (v1.3.0.RELEASE)
2016-01-31 23:05:00.842 INFO 71587 --- [ main] tk.mybatis.springboot.Application : Starting Application on localhost with PID 71587 (/Users/leiming/IdeaProjects/spdemo/abel533/MyBatis-Spring-Boot/target/classes started by leiming in /Users/leiming/IdeaProjects/spdemo)
2016-01-31 23:05:00.851 DEBUG 71587 --- [ main] tk.mybatis.springboot.Application : Running with Spring Boot v1.3.0.RELEASE, Spring v4.2.3.RELEASE
2016-01-31 23:05:00.852 INFO 71587 --- [ main] tk.mybatis.springboot.Application : No profiles are active
2016-01-31 23:05:01.106 INFO 71587 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@404bbcbd: startup date [Sun Jan 31 23:05:01 CST 2016]; root of context hierarchy
2016-01-31 23:05:04.156 WARN 71587 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'countryMapper' defined in file [ /IdeaProjects/spdemo/abel533/MyBatis-Spring-Boot/target/classes/tk/mybatis/springboot/mapper/CountryMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?
2016-01-31 23:05:04.158 WARN 71587 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userInfoMapper' defined in file [ /IdeaProjects/spdemo/abel533/MyBatis-Spring-Boot/target/classes/tk/mybatis/springboot/mapper/UserInfoMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?
2016-01-31 23:05:04.166 WARN 71587 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'countryMapper' defined in file [ /IdeaProjects/spdemo/abel533/MyBatis-Spring-Boot/target/classes/tk/mybatis/springboot/mapper/CountryMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?
2016-01-31 23:05:04.167 WARN 71587 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userInfoMapper' defined in file [ /IdeaProjects/spdemo/abel533/MyBatis-Spring-Boot/target/classes/tk/mybatis/springboot/mapper/UserInfoMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?
2016-01-31 23:05:04.188 WARN 71587 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'countryMapper' defined in file [ /IdeaProjects/spdemo/abel533/MyBatis-Spring-Boot/target/classes/tk/mybatis/springboot/mapper/CountryMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?
2016-01-31 23:05:04.189 WARN 71587 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userInfoMapper' defined in file [ /IdeaProjects/spdemo/abel533/MyBatis-Spring-Boot/target/classes/tk/mybatis/springboot/mapper/UserInfoMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?
2016-01-31 23:05:04.409 INFO 71587 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.datasource.CONFIGURATION_PROPERTIES' 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)
2016-01-31 23:05:04.411 INFO 71587 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$NonEmbeddedConfiguration' of type [class org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$NonEmbeddedConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-01-31 23:05:04.912 INFO 71587 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [class com.alibaba.druid.pool.DruidDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-01-31 23:05:04.915 INFO 71587 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'myBatisConfig' of type [class tk.mybatis.springboot.conf.MyBatisConfig$$EnhancerBySpringCGLIB$$d6934dc6] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-01-31 23:05:05.651 INFO 71587 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionFactory' of type [class org.apache.ibatis.session.defaults.DefaultSqlSessionFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-01-31 23:05:05.973 INFO 71587 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'cityMapper' of type [class tk.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-01-31 23:05:06.080 INFO 71587 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'countryMapper' of type [class tk.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-01-31 23:05:06.180 INFO 71587 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'userInfoMapper' of type [class tk.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-01-31 23:05:06.407 INFO 71587 --- [ main] trationDelegate$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)
2016-01-31 23:05:06.415 INFO 71587 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$9e0aead9] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-01-31 23:05:07.020 INFO 71587 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8082 (http)
2016-01-31 23:05:07.088 INFO 71587 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
2016-01-31 23:05:07.090 INFO 71587 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.0.28
2016-01-31 23:05:07.317 INFO 71587 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2016-01-31 23:05:07.318 INFO 71587 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 6223 ms
2016-01-31 23:05:07.568 INFO 71587 --- [ost-startStop-1] o.s.b.c.e.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2016-01-31 23:05:07.605 INFO 71587 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2016-01-31 23:05:08.278 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/]}" onto java.lang.String tk.mybatis.springboot.Application.home()
2016-01-31 23:05:08.283 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/cities/add]}" onto public tk.mybatis.springboot.model.City tk.mybatis.springboot.controller.CityController.add()
2016-01-31 23:05:08.284 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/cities/delete/{id}]}" onto public org.springframework.ui.ModelMap tk.mybatis.springboot.controller.CityController.delete(java.lang.Integer)
2016-01-31 23:05:08.284 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/cities/save],methods=[POST]}" onto public org.springframework.ui.ModelMap tk.mybatis.springboot.controller.CityController.save(tk.mybatis.springboot.model.City)
2016-01-31 23:05:08.284 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/cities/view/{id}]}" onto public tk.mybatis.springboot.model.City tk.mybatis.springboot.controller.CityController.view(java.lang.Integer)
2016-01-31 23:05:08.284 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/cities]}" onto public com.github.pagehelper.PageInfo<tk.mybatis.springboot.model.City> tk.mybatis.springboot.controller.CityController.getAll(tk.mybatis.springboot.model.City)
2016-01-31 23:05:08.291 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/countries/add]}" onto public org.springframework.web.servlet.ModelAndView tk.mybatis.springboot.controller.CountryController.add()
2016-01-31 23:05:08.291 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/countries/delete/{id}]}" onto public org.springframework.web.servlet.ModelAndView tk.mybatis.springboot.controller.CountryController.delete(java.lang.Integer,org.springframework.web.servlet.mvc.support.RedirectAttributes)
2016-01-31 23:05:08.292 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/countries/save],methods=[POST]}" onto public org.springframework.web.servlet.ModelAndView tk.mybatis.springboot.controller.CountryController.save(tk.mybatis.springboot.model.Country)
2016-01-31 23:05:08.292 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/countries/view/{id}]}" onto public org.springframework.web.servlet.ModelAndView tk.mybatis.springboot.controller.CountryController.view(java.lang.Integer)
2016-01-31 23:05:08.292 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/countries]}" onto public org.springframework.web.servlet.ModelAndView tk.mybatis.springboot.controller.CountryController.getAll(tk.mybatis.springboot.model.Country)
2016-01-31 23:05:08.294 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/users/add]}" onto public tk.mybatis.springboot.model.UserInfo tk.mybatis.springboot.controller.UserInfoController.add()
2016-01-31 23:05:08.295 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/users/delete/{id}]}" onto public org.springframework.ui.ModelMap tk.mybatis.springboot.controller.UserInfoController.delete(java.lang.Integer)
2016-01-31 23:05:08.295 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/users/save],methods=[POST]}" onto public org.springframework.ui.ModelMap tk.mybatis.springboot.controller.UserInfoController.save(tk.mybatis.springboot.model.UserInfo)
2016-01-31 23:05:08.295 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/users/view/{id}]}" onto public tk.mybatis.springboot.model.UserInfo tk.mybatis.springboot.controller.UserInfoController.view(java.lang.Integer)
2016-01-31 23:05:08.296 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/users]}" onto public com.github.pagehelper.PageInfo<tk.mybatis.springboot.model.UserInfo> tk.mybatis.springboot.controller.UserInfoController.getAll(tk.mybatis.springboot.model.UserInfo)
2016-01-31 23:05:08.305 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2016-01-31 23:05:08.306 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)
2016-01-31 23:05:08.368 INFO 71587 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/static/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-01-31 23:05:08.455 INFO 71587 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@404bbcbd: startup date [Sun Jan 31 23:05:01 CST 2016]; root of context hierarchy
2016-01-31 23:05:09.594 INFO 71587 --- [ main] o.s.w.s.v.f.FreeMarkerConfigurer : ClassTemplateLoader for Spring macros added to FreeMarker configuration
2016-01-31 23:05:10.037 INFO 71587 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2016-01-31 23:05:10.040 INFO 71587 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'dataSource' has been autodetected for JMX exposure
2016-01-31 23:05:10.051 INFO 71587 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located MBean 'dataSource': registering with JMX server as MBean [com.alibaba.druid.pool:name=dataSource,type=DruidDataSource]
2016-01-31 23:05:10.208 INFO 71587 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8082 (http)
2016-01-31 23:05:10.217 INFO 71587 --- [ main] tk.mybatis.springboot.Application : Started Application in 10.919 seconds (JVM running for 12.521)
from mybatis-spring-boot.
我发个我这里的日志,也有警告:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.3.0.RELEASE)
2016-02-01 22:09:34.389 INFO 208 --- [ main] tk.mybatis.springboot.Application : Starting Application on liuzh-PC with PID 208 (F:\Liu\Git\MyBatis\MyBatis-Spring-Boot\target\classes started by liuzh_3nofxnp in F:\Liu\IDEA\MyBatis)
2016-02-01 22:09:34.391 DEBUG 208 --- [ main] tk.mybatis.springboot.Application : Running with Spring Boot v1.3.0.RELEASE, Spring v4.2.3.RELEASE
2016-02-01 22:09:34.391 INFO 208 --- [ main] tk.mybatis.springboot.Application : No profiles are active
2016-02-01 22:09:34.446 INFO 208 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@15b204a1: startup date [Mon Feb 01 22:09:34 CST 2016]; root of context hierarchy
2016-02-01 22:09:35.783 WARN 208 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'countryMapper' defined in file [F:\Liu\Git\MyBatis\MyBatis-Spring-Boot\target\classes\tk\mybatis\springboot\mapper\CountryMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?
2016-02-01 22:09:35.784 WARN 208 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userInfoMapper' defined in file [F:\Liu\Git\MyBatis\MyBatis-Spring-Boot\target\classes\tk\mybatis\springboot\mapper\UserInfoMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?
2016-02-01 22:09:35.786 WARN 208 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'countryMapper' defined in file [F:\Liu\Git\MyBatis\MyBatis-Spring-Boot\target\classes\tk\mybatis\springboot\mapper\CountryMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?
2016-02-01 22:09:35.787 WARN 208 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userInfoMapper' defined in file [F:\Liu\Git\MyBatis\MyBatis-Spring-Boot\target\classes\tk\mybatis\springboot\mapper\UserInfoMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?
2016-02-01 22:09:35.792 WARN 208 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'countryMapper' defined in file [F:\Liu\Git\MyBatis\MyBatis-Spring-Boot\target\classes\tk\mybatis\springboot\mapper\CountryMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?
2016-02-01 22:09:35.793 WARN 208 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userInfoMapper' defined in file [F:\Liu\Git\MyBatis\MyBatis-Spring-Boot\target\classes\tk\mybatis\springboot\mapper\UserInfoMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sqlSessionFactory': Requested bean is currently in creation: Is there an unresolvable circular reference?
2016-02-01 22:09:35.894 INFO 208 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.datasource.CONFIGURATION_PROPERTIES' 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)
2016-02-01 22:09:35.895 INFO 208 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$NonEmbeddedConfiguration' of type [class org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$NonEmbeddedConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-02-01 22:09:36.139 INFO 208 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [class com.alibaba.druid.pool.DruidDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-02-01 22:09:36.141 INFO 208 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'myBatisConfig' of type [class tk.mybatis.springboot.conf.MyBatisConfig$$EnhancerBySpringCGLIB$$ee5723cb] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-02-01 22:09:36.445 INFO 208 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionFactory' of type [class org.apache.ibatis.session.defaults.DefaultSqlSessionFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-02-01 22:09:36.561 INFO 208 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'cityMapper' of type [class tk.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-02-01 22:09:36.603 INFO 208 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'countryMapper' of type [class tk.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-02-01 22:09:36.640 INFO 208 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'userInfoMapper' of type [class tk.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-02-01 22:09:36.662 INFO 208 --- [ main] trationDelegate$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)
2016-02-01 22:09:36.663 INFO 208 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$b5cec0de] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-02-01 22:09:37.055 INFO 208 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2016-02-01 22:09:37.065 INFO 208 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
2016-02-01 22:09:37.067 INFO 208 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.0.28
2016-02-01 22:09:37.176 INFO 208 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2016-02-01 22:09:37.176 INFO 208 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2733 ms
2016-02-01 22:09:37.295 INFO 208 --- [ost-startStop-1] o.s.b.c.e.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2016-02-01 22:09:37.300 INFO 208 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2016-02-01 22:09:37.541 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/]}" onto java.lang.String tk.mybatis.springboot.Application.home()
2016-02-01 22:09:37.544 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/cities/add]}" onto public tk.mybatis.springboot.model.City tk.mybatis.springboot.controller.CityController.add()
2016-02-01 22:09:37.544 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/cities/delete/{id}]}" onto public org.springframework.ui.ModelMap tk.mybatis.springboot.controller.CityController.delete(java.lang.Integer)
2016-02-01 22:09:37.544 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/cities/save],methods=[POST]}" onto public org.springframework.ui.ModelMap tk.mybatis.springboot.controller.CityController.save(tk.mybatis.springboot.model.City)
2016-02-01 22:09:37.544 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/cities/view/{id}]}" onto public tk.mybatis.springboot.model.City tk.mybatis.springboot.controller.CityController.view(java.lang.Integer)
2016-02-01 22:09:37.545 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/cities]}" onto public com.github.pagehelper.PageInfo<tk.mybatis.springboot.model.City> tk.mybatis.springboot.controller.CityController.getAll(tk.mybatis.springboot.model.City)
2016-02-01 22:09:37.547 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/countries/add]}" onto public org.springframework.web.servlet.ModelAndView tk.mybatis.springboot.controller.CountryController.add()
2016-02-01 22:09:37.547 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/countries/delete/{id}]}" onto public org.springframework.web.servlet.ModelAndView tk.mybatis.springboot.controller.CountryController.delete(java.lang.Integer,org.springframework.web.servlet.mvc.support.RedirectAttributes)
2016-02-01 22:09:37.547 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/countries/save],methods=[POST]}" onto public org.springframework.web.servlet.ModelAndView tk.mybatis.springboot.controller.CountryController.save(tk.mybatis.springboot.model.Country)
2016-02-01 22:09:37.548 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/countries/view/{id}]}" onto public org.springframework.web.servlet.ModelAndView tk.mybatis.springboot.controller.CountryController.view(java.lang.Integer)
2016-02-01 22:09:37.548 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/countries]}" onto public org.springframework.web.servlet.ModelAndView tk.mybatis.springboot.controller.CountryController.getAll(tk.mybatis.springboot.model.Country)
2016-02-01 22:09:37.549 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/users/add]}" onto public tk.mybatis.springboot.model.UserInfo tk.mybatis.springboot.controller.UserInfoController.add()
2016-02-01 22:09:37.549 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/users/delete/{id}]}" onto public org.springframework.ui.ModelMap tk.mybatis.springboot.controller.UserInfoController.delete(java.lang.Integer)
2016-02-01 22:09:37.549 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/users/save],methods=[POST]}" onto public org.springframework.ui.ModelMap tk.mybatis.springboot.controller.UserInfoController.save(tk.mybatis.springboot.model.UserInfo)
2016-02-01 22:09:37.549 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/users/view/{id}]}" onto public tk.mybatis.springboot.model.UserInfo tk.mybatis.springboot.controller.UserInfoController.view(java.lang.Integer)
2016-02-01 22:09:37.549 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/users]}" onto public com.github.pagehelper.PageInfo<tk.mybatis.springboot.model.UserInfo> tk.mybatis.springboot.controller.UserInfoController.getAll(tk.mybatis.springboot.model.UserInfo)
2016-02-01 22:09:37.556 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2016-02-01 22:09:37.557 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)
2016-02-01 22:09:37.627 INFO 208 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@15b204a1: startup date [Mon Feb 01 22:09:34 CST 2016]; root of context hierarchy
2016-02-01 22:09:37.685 INFO 208 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/static/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-02-01 22:09:38.143 INFO 208 --- [ main] o.s.w.s.v.f.FreeMarkerConfigurer : ClassTemplateLoader for Spring macros added to FreeMarker configuration
2016-02-01 22:09:38.231 INFO 208 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2016-02-01 22:09:38.233 INFO 208 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'dataSource' has been autodetected for JMX exposure
2016-02-01 22:09:38.236 INFO 208 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located MBean 'dataSource': registering with JMX server as MBean [com.alibaba.druid.pool:name=dataSource,type=DruidDataSource]
2016-02-01 22:09:38.317 INFO 208 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2016-02-01 22:09:38.321 INFO 208 --- [ main] tk.mybatis.springboot.Application : Started Application in 4.36 seconds (JVM running for 5.725)
from mybatis-spring-boot.
原来同有,我一开始想解决这个WARN,跟踪spring代码跟的晕了,对于会重复加载固定的3遍比较困惑,跟踪发现主要是在sqlSessionFactory加载时报错。不过在换为官方的spring-mybatis时,却没有该警告,不知道是不是和tk包里的MapperScannerConfigurer实现有关系。
from mybatis-spring-boot.
我找时间和mybatis-starter对比看看。
from mybatis-spring-boot.
这个bug是mybatis-spring的,换到最新的1.2.4版本就没问题了。
详细内容看这里:mybatis/spring#58
from mybatis-spring-boot.
赞,已更新1.2.4尝试,并且需将通用mapper升级为3.3.6后,启动无warn。
from mybatis-spring-boot.
Related Issues (20)
- 将 mybatis-spring-boot-starter:1.3.2升级2.0.0 程序报错 HOT 1
- 请问此项目不支持yml配置吗?一定要使用properties? HOT 1
- 分页
- 在springboot中如何配置自定义的mybatis拦截器和分页拦截器的执行书顺序 HOT 3
- 升级版2.0.0及以上报异常Caused by: java.lang.NoSuchMethodException: tk.mybatis.mapper.provider.base.BaseInsertProvider.<init>()。并且@tk.mybatis.spring.annotation.MapperScan("com.sinosoft.**.domain") HOT 2
- BaseResultMap怎么生成了两份 HOT 1
- [BUG] SpringBoot 2.1.7 异常信息如下 HOT 1
- 自定义interceptor和pageInterceptor执行顺序是如何 的,有没有办法指定执行顺序 HOT 1
- 当使用Example查询实体中包含名为rank的字段,在mysql8中会语法异常 HOT 1
- 当第一页就查出全部行数时不排序
- 建议添加支持JPA功能
- 请问在Spring boot 下单元测试使用@MybatisTest注解时,如何才能加载自动生成的类?
- 5.1.4的pagehelper的com.github.pagehelper.dialect.helper.OracleDialect类下的public String getPageSql(String sql, Page page, CacheKey pageKey)方法是不是有BUG?
- 数据库字段有默认值,但是使用自动生成的dao代码, insert语句不会插入默认值 HOT 1
- tk.mybatis.spring.mapper.ClassPathMapperScanner
- 分页 HOT 1
- Date类型转换成了Timestamp
- 能用在elasticsearch搜索分页码?
- pagehelper 页数传递超过总页数为啥不会返回空 HOT 1
- AggregationMapper使用报错
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mybatis-spring-boot.