进入controller2018-10-2921:16:40.997ERROR9580---[nio-8088-exec-1]o.a.c.c.C.[.[.[/].[dispatcherServlet]:Servlet.service()forservlet[dispatcherServlet]incontextwithpath[]threwexception[Requestprocessingfailed;nestedexceptionisorg.springframework.transaction.CannotCreateTransactionException:CouldnotopenJDBCConnectionfortransaction;nestedexceptionisjava.sql.SQLException:Unabletoopenatestconnectiontothegivendatabase.JDBCurl=jdbc:mysql://127.0.0.1:3306/tmfv?useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true,username=root.Terminatingconnectionpool(setlazyInittotrueifyouexpecttostartyourdatabaseafteryourapp).OriginalException:------com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:Couldnotcreateconnectiontodatabaseserver.Attemptedreconnect3times.Givingup.atsun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeMethod)atsun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)atsun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)atjava.lang.reflect.Constructor.newInstance(Constructor.java:423)atcom.mysql.jdbc.Util.handleNewInstance(Util.java:425)atcom.mysql.jdbc.Util.getInstance(Util.java:408)atcom.mysql.jdbc.SQLError.createSQLException(SQLError.java:918)atcom.mysql.jdbc.SQLError.createSQLException(SQLError.java:897)atcom.mysql.jdbc.SQLError.createSQLException(SQLError.java:886)atcom.mysql.jdbc.SQLError.createSQLException(SQLError.java:860)atcom.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2115)atcom.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2040)atcom.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:790)atcom.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)atsun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeMethod)atsun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)atsun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)atjava.lang.reflect.Constructor.newInstance(Constructor.java:423)atcom.mysql.jdbc.Util.handleNewInstance(Util.java:425)atcom.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:400)atcom.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)atjava.sql.DriverManager.getConnection(DriverManager.java:664)atjava.sql.DriverManager.getConnection(DriverManager.java:247)atcom.jolbox.bonecp.BoneCP.obtainRawInternalConnection(BoneCP.java:363)atcom.jolbox.bonecp.BoneCP.(BoneCP.java:416)atcom.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:120)atorg.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:246)atorg.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)atorg.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:447)atorg.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:277)atorg.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)atorg.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656)atcom.sunlei.springboot.service.BusinessService$$EnhancerBySpringCGLIB$$39cb4cb2.getToday()atcom.sunlei.springboot.controller.BusinessController.today(BusinessController.java:26)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)atjava.lang.reflect.Method.invoke(Method.java:498)atorg.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)atorg.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)atorg.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)atorg.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)atorg.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)atorg.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)atorg.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)atorg.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)atorg.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)atorg.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:622)atorg.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:729)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)atorg.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)atorg.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)atorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)atorg.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105)atorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)atorg.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)atorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)atorg.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)atorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)atorg.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)atorg.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)atorg.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)atorg.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798)atorg.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434)atorg.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)atorg.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)atjava.lang.Thread.run(Thread.java:745)Causedby:java.sql.SQLException:Accessdeniedforuser'root'@'localhost'(usingpassword:YES)atcom.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)atcom.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)atcom.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)atcom.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:873)atcom.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1710)atcom.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226)atcom.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2205)atcom.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2056)...78more------]withrootcausejava.sql.SQLException:Accessdeniedforuser'root'@'localhost'(usingpassword:YES)atcom.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)~[mysql-connector-java-5.1.41.jar:5.1.41]atcom.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)~[mysql-connector-java-5.1.41.jar:5.1.41]atcom.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)~[mysql-connector-java-5.1.41.jar:5.1.41]atcom.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:873)~[mysql-connector-java-5.1.41.jar:5.1.41]atcom.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1710)~[mysql-connector-java-5.1.41.jar:5.1.41]atcom.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226)~[mysql-connector-java-5.1.41.jar:5.1.41]atcom.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2205)~[mysql-connector-java-5.1.41.jar:5.1.41]atcom.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2056)~[mysql-connector-java-5.1.41.jar:5.1.41]atcom.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2040)~[mysql-connector-java-5.1.41.jar:5.1.41]atcom.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:790)~[mysql-connector-java-5.1.41.jar:5.1.41]atcom.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)~[mysql-connector-java-5.1.41.jar:5.1.41]atsun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeMethod)~[na:1.8.0_92]atsun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)~[na:1.8.0_92]atsun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)~[na:1.8.0_92]atjava.lang.reflect.Constructor.newInstance(Constructor.java:423)~[na:1.8.0_92]atcom.mysql.jdbc.Util.handleNewInstance(Util.java:425)~[mysql-connector-java-5.1.41.jar:5.1.41]atcom.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:400)~[mysql-connector-java-5.1.41.jar:5.1.41]atcom.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)~[mysql-connector-java-5.1.41.jar:5.1.41]atjava.sql.DriverManager.getConnection(DriverManager.java:664)~[na:1.8.0_92]atjava.sql.DriverManager.getConnection(DriverManager.java:247)~[na:1.8.0_92]atcom.jolbox.bonecp.BoneCP.obtainRawInternalConnection(BoneCP.java:363)~[bonecp-0.8.0.RELEASE.jar:na]atcom.jolbox.bonecp.BoneCP.(BoneCP.java:416)~[bonecp-0.8.0.RELEASE.jar:na]atcom.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:120)~[bonecp-0.8.0.RELEASE.jar:na]atorg.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:246)~[spring-jdbc-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)~[spring-tx-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:447)~[spring-tx-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:277)~[spring-tx-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)~[spring-tx-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)~[spring-aop-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656)~[spring-aop-4.3.7.RELEASE.jar:4.3.7.RELEASE]atcom.sunlei.springboot.service.BusinessService$$EnhancerBySpringCGLIB$$39cb4cb2.getToday()~[classes/:na]atcom.sunlei.springboot.controller.BusinessController.today(BusinessController.java:26)~[classes/:na]atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)~[na:1.8.0_92]atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)~[na:1.8.0_92]atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)~[na:1.8.0_92]atjava.lang.reflect.Method.invoke(Method.java:498)~[na:1.8.0_92]atorg.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]atjavax.servlet.http.HttpServlet.service(HttpServlet.java:622)~[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]atjavax.servlet.http.HttpServlet.service(HttpServlet.java:729)~[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)~[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)~[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)~[tomcat-embed-websocket-8.5.11.jar:8.5.11]atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)~[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)~[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)~[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)~[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105)~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)~[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)~[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)~[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)~[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)~[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)~[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)~[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474)[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798)[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434)[tomcat-embed-core-8.5.11.jar:8.5.11]atorg.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)[tomcat-embed-core-8.5.11.jar:8.5.11]atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_92]atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[na:1.8.0_92]atorg.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)[tomcat-embed-core-8.5.11.jar:8.5.11]atjava.lang.Thread.run(Thread.java:745)[na:1.8.0_92]在@serivce层加了事务注解,然后调用controller的接口就报错了。数据库参数,应该没错:jdbc.driverClassName=com.mysql.jdbc.Driverjdbc.url=jdbc:mysql://127.0.0.1:3306/tmfv?useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=truejdbc.username=rootjdbc.password=123456数据源配置:@Configuration//通过该注解来表明该类是一个Spring的配置,相当于一个xml文件@ComponentScan(basePackages="com.sunlei.springboot")//配置扫描包@PropertySource(value={"classpath:jdbc.properties"},ignoreResourceNotFound=true)//各种配置文件参数,@PropertySource(value={"","",""})配多个publicclassSpringConfig{@Value("${jdbc.url}")privateStringjdbcUrl;@Value("${jdbc.driverClassName}")privateStringjdbcDriverClassName;@Value("${jdbc.username}")privateStringjdbcUsername;@Value("${jdbc.password}")privateStringjdbcPassword;@Bean(destroyMethod="close")publicDataSourcedataSource(){System.out.println("创建DataSource:"+jdbcUrl+"\n"+jdbcDriverClassName+"\n"+jdbcUsername+"\n"+jdbcPassword);BoneCPDataSourceboneCPDataSource=newBoneCPDataSource();//数据库驱动boneCPDataSource.setDriverClass(jdbcDriverClassName);//相应驱动的jdbcUrlboneCPDataSource.setJdbcUrl(jdbcUrl);//数据库的用户名boneCPDataSource.setUsername(jdbcUsername);//数据库的密码boneCPDataSource.setPassword(jdbcUsername);//检查数据库连接池中空闲连接的间隔时间,单位是分,默认值:240,如果要取消则设置为0boneCPDataSource.setIdleConnectionTestPeriodInMinutes(60);//连接池中未使用的链接最大存活时间,单位是分,默认值:60,如果要永远存活设置为0boneCPDataSource.setIdleMaxAgeInMinutes(30);//每个分区最大的连接数boneCPDataSource.setMaxConnectionsPerPartition(100);//每个分区最小的连接数boneCPDataSource.setMinConnectionsPerPartition(5);returnboneCPDataSource;}}
添加回答
举报
0/150
提交
取消