NutzCN Logo
问答 使用 nutz-plugins-spring-boot-starter 建表报错
发布于 2606天前 作者 pontali 1553 次浏览 复制 上一个帖子 下一个帖子
标签:

图片描述

使用 nutz-plugins-spring-boot-starter 第一次创建数据库表的时候报错,其实已经创建成功,第二次启动的时候就不报了

5 回复

看来还是把图片上传关掉才行

2017-09-27 09:22:20.468  INFO 3196 --- [           main] cn.sayyoo.example.ExampleApplication     : Starting ExampleApplication on huanghuideMacBook-Pro.local with PID 3196 (/Users/ponta/Documents/workspace/sayyoo/sayyoo-microservice/microservice-example/target/classes started by ponta in /Users/ponta/Documents/workspace/sayyoo/sayyoo-microservice)
2017-09-27 09:22:20.471  INFO 3196 --- [           main] cn.sayyoo.example.ExampleApplication     : No active profile set, falling back to default profiles: default
2017-09-27 09:22:20.571  INFO 3196 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@79079097: startup date [Wed Sep 27 09:22:20 CST 2017]; root of context hierarchy
2017-09-27 09:22:21.881  WARN 3196 --- [           main] o.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[cn.sayyoo.example]' package. Please check your configuration.
2017-09-27 09:22:21.959  INFO 3196 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2017-09-27 09:22:22.776  INFO 3196 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$72c0dea7] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-09-27 09:22:23.280  INFO 3196 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8010 (http)
2017-09-27 09:22:23.299  INFO 3196 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2017-09-27 09:22:23.300  INFO 3196 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.16
2017-09-27 09:22:23.443  INFO 3196 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2017-09-27 09:22:23.443  INFO 3196 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 2880 ms
2017-09-27 09:22:23.785  INFO 3196 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
2017-09-27 09:22:23.787  INFO 3196 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'statViewServlet' to [/druid/*]
2017-09-27 09:22:23.792  INFO 3196 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2017-09-27 09:22:23.792  INFO 3196 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2017-09-27 09:22:23.792  INFO 3196 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2017-09-27 09:22:23.792  INFO 3196 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2017-09-27 09:22:23.792  INFO 3196 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'webStatFilter' to urls: [/*]
2017-09-27 09:22:26.033  INFO 3196 --- [           main] org.nutz.dao.jdbc.Jdbcs                  : Get Connection from DataSource for JdbcExpert, if you lock at here, check your database server and configure
2017-09-27 09:22:27.171  INFO 3196 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} inited
2017-09-27 09:22:27.808  INFO 3196 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/example/add]}" onto public cn.sayyoo.core.base.Result<cn.sayyoo.example.model.Example> cn.sayyoo.example.controller.ExampleController.add()
2017-09-27 09:22:27.810  INFO 3196 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/example/all]}" onto public cn.sayyoo.core.base.Result cn.sayyoo.example.controller.ExampleController.all()
2017-09-27 09:22:27.811  INFO 3196 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/example/find/{id}]}" onto public cn.sayyoo.core.base.Result<cn.sayyoo.example.model.Example> cn.sayyoo.example.controller.ExampleController.findById(long)
2017-09-27 09:22:27.816  INFO 3196 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/swagger-resources]}" onto public org.springframework.http.ResponseEntity<java.util.List<springfox.documentation.swagger.web.SwaggerResource>> springfox.documentation.swagger.web.ApiResourceController.swaggerResources()
2017-09-27 09:22:27.817  INFO 3196 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/swagger-resources/configuration/ui]}" onto public org.springframework.http.ResponseEntity<springfox.documentation.swagger.web.UiConfiguration> springfox.documentation.swagger.web.ApiResourceController.uiConfiguration()
2017-09-27 09:22:27.818  INFO 3196 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/swagger-resources/configuration/security]}" onto public org.springframework.http.ResponseEntity<springfox.documentation.swagger.web.SecurityConfiguration> springfox.documentation.swagger.web.ApiResourceController.securityConfiguration()
2017-09-27 09:22:27.824  INFO 3196 --- [           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)
2017-09-27 09:22:27.826  INFO 3196 --- [           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,javax.servlet.http.HttpServletResponse)
2017-09-27 09:22:28.056  INFO 3196 --- [           main] pertySourcedRequestMappingHandlerMapping : Mapped URL path [/v2/api-docs] onto method [public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest)]
2017-09-27 09:22:28.479  INFO 3196 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@79079097: startup date [Wed Sep 27 09:22:20 CST 2017]; root of context hierarchy
2017-09-27 09:22:28.566  INFO 3196 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-09-27 09:22:28.567  INFO 3196 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-09-27 09:22:28.664  INFO 3196 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-09-27 09:22:29.312 ERROR 3196 --- [           main] druid.sql.Statement                      : {conn-10005, stmt-20000} execute error. SELECT * FROM example LIMIT 1

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'example.example' doesn't exist
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_121]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_121]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_121]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_121]
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) ~[mysql-connector-java-5.1.43.jar:5.1.43]
	at com.mysql.jdbc.Util.getInstance(Util.java:408) ~[mysql-connector-java-5.1.43.jar:5.1.43]
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943) ~[mysql-connector-java-5.1.43.jar:5.1.43]
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973) ~[mysql-connector-java-5.1.43.jar:5.1.43]
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909) ~[mysql-connector-java-5.1.43.jar:5.1.43]
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527) ~[mysql-connector-java-5.1.43.jar:5.1.43]
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680) ~[mysql-connector-java-5.1.43.jar:5.1.43]
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2490) ~[mysql-connector-java-5.1.43.jar:5.1.43]
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2448) ~[mysql-connector-java-5.1.43.jar:5.1.43]
	at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1381) ~[mysql-connector-java-5.1.43.jar:5.1.43]
	at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2473) [druid-1.1.2.jar:1.1.2]
	at com.alibaba.druid.filter.FilterAdapter.statement_executeQuery(FilterAdapter.java:2503) [druid-1.1.2.jar:1.1.2]
	at com.alibaba.druid.filter.FilterEventAdapter.statement_executeQuery(FilterEventAdapter.java:302) [druid-1.1.2.jar:1.1.2]
	at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2470) [druid-1.1.2.jar:1.1.2]
	at com.alibaba.druid.wall.WallFilter.statement_executeQuery(WallFilter.java:511) [druid-1.1.2.jar:1.1.2]
	at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2470) [druid-1.1.2.jar:1.1.2]
	at com.alibaba.druid.filter.FilterAdapter.statement_executeQuery(FilterAdapter.java:2503) [druid-1.1.2.jar:1.1.2]
	at com.alibaba.druid.filter.FilterEventAdapter.statement_executeQuery(FilterEventAdapter.java:302) [druid-1.1.2.jar:1.1.2]
	at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2470) [druid-1.1.2.jar:1.1.2]
	at com.alibaba.druid.filter.FilterAdapter.statement_executeQuery(FilterAdapter.java:2503) [druid-1.1.2.jar:1.1.2]
	at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2470) [druid-1.1.2.jar:1.1.2]
	at com.alibaba.druid.proxy.jdbc.StatementProxyImpl.executeQuery(StatementProxyImpl.java:227) [druid-1.1.2.jar:1.1.2]
	at com.alibaba.druid.pool.DruidPooledStatement.executeQuery(DruidPooledStatement.java:217) [druid-1.1.2.jar:1.1.2]
	at org.nutz.dao.impl.jdbc.AbstractJdbcExpert.setupEntityField(AbstractJdbcExpert.java:88) [nutz-1.r.63-20170926.144244-97.jar:1.r.63-SNAPSHOT]
	at org.nutz.dao.impl.entity.AnnotationEntityMaker._checkupEntityFieldsWithDatabase(AnnotationEntityMaker.java:568) [nutz-1.r.63-20170926.144244-97.jar:1.r.63-SNAPSHOT]
	at org.nutz.dao.impl.entity.AnnotationEntityMaker.make(AnnotationEntityMaker.java:288) [nutz-1.r.63-20170926.144244-97.jar:1.r.63-SNAPSHOT]
	at org.nutz.dao.impl.EntityHolder.getEntity(EntityHolder.java:72) [nutz-1.r.63-20170926.144244-97.jar:1.r.63-SNAPSHOT]
	at org.nutz.dao.impl.NutDao.create(NutDao.java:801) [nutz-1.r.63-20170926.144244-97.jar:1.r.63-SNAPSHOT]
	at org.nutz.dao.util.Daos.createTablesInPackage(Daos.java:469) [nutz-1.r.63-20170926.144244-97.jar:1.r.63-SNAPSHOT]
	at org.nutz.plugin.spring.boot.listener.NutzDataBaseIniter$1.invoke(NutzDataBaseIniter.java:39) [nutz-plugins-spring-boot-starter-1.r.63-SNAPSHOT.jar:na]
	at org.nutz.plugin.spring.boot.listener.NutzDataBaseIniter$1.invoke(NutzDataBaseIniter.java:35) [nutz-plugins-spring-boot-starter-1.r.63-SNAPSHOT.jar:na]
	at org.nutz.lang.Lang.each(Lang.java:1595) [nutz-1.r.63-20170926.144244-97.jar:1.r.63-SNAPSHOT]
	at org.nutz.lang.Lang.each(Lang.java:1560) [nutz-1.r.63-20170926.144244-97.jar:1.r.63-SNAPSHOT]
	at org.nutz.plugin.spring.boot.listener.NutzDataBaseIniter.create(NutzDataBaseIniter.java:35) [nutz-plugins-spring-boot-starter-1.r.63-SNAPSHOT.jar:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:366) [spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:311) [spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:134) [spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409) [spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1620) [spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) [spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) [spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) [spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) [spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) [spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) [spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) [spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) [spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) [spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
	at cn.sayyoo.example.ExampleApplication.main(ExampleApplication.java:25) [classes/:na]

2017-09-27 09:22:29.428 ERROR 3196 --- [           main] druid.sql.Statement                      : {conn-10005, stmt-20001} execute error. SELECT COUNT(1) FROM example where 1!=1

@wendal 大神,帮忙看看呗 ,虽然不影响使用,但是启动的时候看着别扭 😄

把druid的filters设置改一下,去掉log4j拦截器,就不会打印了

@wendal 解决,完美,谢谢🙏

添加回复
请先登陆
回到顶部