DruidDataSource 配置mysql,启动报错,求大神指点

地址信息:
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/order?characterEncoding=UTF-8
jdbc.username=root
jdbc.password=123456
jdbc.initSize=5
jdbc.maxActive=10
jdbc.maxIdle=5
jdbc.minIdle=2
jdbc.maxWait=1000

<bean id="dataSourceone" class="com.alibaba.druid.pool.DruidDataSource" destroy-method="close">      
    <!-- 数据库基本信息配置 -->
    <property name="driverClassName" value="${jdbc.driver}" />
    <property name="url" value="${jdbc.url}" />
    <property name="username" value="${jdbc.username}" />
    <property name="password" value="${jdbc.password}" />        
    <!-- 初始化连接数量 -->
    <property name="initialSize" value="${jdbc.initSize}" />
    <!-- 最大并发连接数  -->
    <property name="maxActive" value="${jdbc.maxActive}" />
    <!-- 最大空闲连接数 -->
    <property name="maxIdle" value="${jdbc.maxIdle}" />
    <!-- 最小空闲连接数 -->
    <property name="minIdle" value="${jdbc.minIdle}" />
    <!-- 配置获取连接等待超时的时间    ms -->     
    <property name="maxWait" value="${jdbc.maxWait}" />
    <!-- 牺牲效率,避免活锁 -->
    <property name="useUnfairLock" value="false" />
    <!-- 超过时间限制是否回收  未归还(调用close)的连接 -->
    <property name="removeAbandoned" value="false" />
    <!-- 超时回收限制多长;没有批量处理需求,设短一点,单位  秒 -->
    <property name="removeAbandonedTimeout" value="180" />
    <!-- 用来检测连接是否有效的sql,要求是一个查询语句-->
    <property name="validationQuery" value="SELECT 1 FROM dual" />
    <!-- 空闲的时候检测(空闲时间超过下面的值) -->
    <property name="testWhileIdle" value="true" />
    <!-- 申请连接时执行validationQuery检测连接是否有效,配置为true会降低性能 -->
    <property name="testOnBorrow" value="false" />
    <!-- 归还连接时执行validationQuery检测连接是否有效,配置为true会降低性能  -->
    <property name="testOnReturn" value="false" /> 
    <!-- Destroy线程检测是否关闭连接的间隔,同时也是空闲检测的判断依据,单位 毫秒  -->
    <property name="timeBetweenEvictionRunsMillis" value="60000" />
    <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
    <property name="minEvictableIdleTimeMillis" value="600000" />                   
    <!--属性类型是字符串,通过别名的方式配置扩展插件,常用的插件有:                 
            监控统计用的filter:stat
            日志用的filter:log4j
           防御SQL注入的filter:wall--> 
    <property name="filters" value="filter:wall" />
</bean>

    启动报错:org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Access denied for user 'root'@'122.225.88.154' (using password: YES)
    122.225.88.154都不知道是哪里的地址,我已经蒙了,求大神指点

9个回答

(using password: YES)这一句很可能是用户密码不对,你先用navicat自己建立一个连接,看看能不能连接上,如果不行那就是密码有问题,在看看项目中有没有jdbc的驱动,还不行的话查看下数据库的设置,是否允许远程连接,用户是否有连接的权限,无外乎这几种可能,楼主自己排查下吧!

先试着把localhost改成自己本机的IP地址,

试过了,我开始用的192.168.1.26这个是我本机的IP地址,不行,但是我能用Navicat Premium打开,并且数据库root;Host我也修改为了:%

qq_33641544
Jackvei <bean name="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
接近 3 年之前 回复
qq_33641544
Jackvei 是用的mybatis吗?看一下jar、
接近 3 年之前 回复

这个报的错是说你用户名密码错误,你把mysql里user表里的用户信息贴出来吧

【eclipse软件】按Ctrl+H 先把 这个IP地址搜索一下 (MyEclipse没试过)
图片说明

数据库帐号密码正确吗?

错误信息为密码错误,检查一下root的密码是否正确

  1. 检查下地址:122.225.88.154的连通性(ping 下就行);
  2. 查看用户是否具有访问数据库的权限,可用DBA权限登入查看;
  3. 可用换一个你本地的测试库试一下,如果没有,可用使用工具或命令,从目标库中导一份数据下来;

以上为初步看法,希望对你有帮助。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
spring-mvc和mybatis整合DruidDataSource配置连接池报错
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dynamicDatasourceAspect' defined in file [D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\dm_job\WEB-INF\classes\com\creditease\job\aop\DynamicDatasourceAspect.class]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.alibaba.druid.pool.DruidDataSource' to required type 'org.aspectj.lang.JoinPoint' for property 'dbmsDataSource'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.alibaba.druid.pool.DruidDataSource] to required type [org.aspectj.lang.JoinPoint] for property 'dbmsDataSource': no matching editors or conversion strategy found at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.aop.aspectj.annotation.BeanFactoryAspectInstanceFactory.getAspectInstance(BeanFactoryAspectInstanceFactory.java:77) at org.springframework.aop.aspectj.annotation.LazySingletonAspectInstanceFactoryDecorator.getAspectInstance(LazySingletonAspectInstanceFactoryDecorator.java:50) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:603) at org.springframework.aop.aspectj.AspectJMethodBeforeAdvice.before(AspectJMethodBeforeAdvice.java:40) at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:51) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653) at com.creditease.job.service.impl.CityServiceImpl$$EnhancerBySpringCGLIB$$23f19862.getAllCityCodeAndName(<generated>) at com.creditease.job.base.InitDataListener.contextInitialized(InitDataListener.java:48) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.alibaba.druid.pool.DruidDataSource' to required type 'org.aspectj.lang.JoinPoint' for property 'dbmsDataSource'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.alibaba.druid.pool.DruidDataSource] to required type [org.aspectj.lang.JoinPoint] for property 'dbmsDataSource': no matching editors or conversion strategy found at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:476) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:512) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:506) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1523) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1482) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1222) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) ... 26 more Caused by: java.lang.IllegalStateException: Cannot convert value of type [com.alibaba.druid.pool.DruidDataSource] to required type [org.aspectj.lang.JoinPoint] for property 'dbmsDataSource': no matching editors or conversion strategy found at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:287) at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:461) * ... 32 more 配置文件如下: <!-- 基础数据源配置 --> <bean id="baseDataSource" class="com.alibaba.druid.pool.DruidDataSource" destroy-method="close"> <!-- 配置初始化大小、最小、最大 --> <property name="initialSize" value="10" /> <property name="minIdle" value="10" /> <property name="maxActive" value="50" /> <!-- 配置获取连接等待超时的时间 --> <property name="maxWait" value="60000" /> <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 --> <property name="timeBetweenEvictionRunsMillis" value="60000" /> <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 --> <property name="minEvictableIdleTimeMillis" value="300000" /> <property name="validationQuery" value="SELECT * FROM CREDIT_CHANNEL LIMT 1" /> <property name="testWhileIdle" value="true" /> <property name="testOnBorrow" value="false" /> <property name="testOnReturn" value="false" /> <!-- 打开PSCache,并且指定每个连接上PSCache的大小 --> <property name="poolPreparedStatements" value="true" /> <property name="maxPoolPreparedStatementPerConnectionSize" value="20" /> <!-- 配置监控统计拦截的filters --> <property name="filters" value="wall,stat" /> </bean> <!-- kls数据源 --> <bean id="klsDataSource" parent="baseDataSource"> <!-- 基本属性 url、user、password --> <property name="url" value="${kls.jdbc.url}" /> <property name="username" value="${kls.jdbc.username}" /> <property name="password" value="${kls.jdbc.password}" /> </bean> <!-- dbms数据源 --> <bean id="dbmsDataSource" parent="baseDataSource"> <!-- 基本属性 url、user、password --> <property name="url" value="${dbms.jdbc.url}" /> <property name="username" value="${dbms.jdbc.username}" /> <property name="password" value="${dbms.jdbc.password}" /> </bean> <!-- 设置spring 配置文件的配置多数源映射关系 --> <bean id="dataSource" class="com.creditease.job.datasource.DynamicDataSource"> <property name="targetDataSources"> <map> <entry value-ref="klsDataSource" key="kls"></entry> <entry value-ref="dbmsDataSource" key="dbms"></entry> </map> </property> <property name="defaultTargetDataSource" ref="klsDataSource" /> </bean> <bean id="dataSourceProxy" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy"> <property name="targetDataSource" ref="dataSource" /> </bean> <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"> <constructor-arg ref="dataSourceProxy" /> </bean> <!--事务管理器配置 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSourceProxy" /> </bean> <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="*" propagation="REQUIRED" /> </tx:attributes> </tx:advice> <bean class="com.creditease.job.util.SpringUtils" /> <!-- 数据库工厂 --> <!-- mySqlSessionFactory配置 --> <bean id="mySqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="configLocation" value="classpath:mybatis-config.xml" /> </bean> ![图片说明](https://img-ask.csdn.net/upload/201605/16/1463363631_18856.png)
druid 配置多数据源时,允许同时提交多条。报错com.alibaba.druid.pool.DruidDataSource : {dataSource-1} init error
com.alibaba.druid.pool.DruidDataSource : {dataSource-1} init error java.lang.NullPointerException: null at org.springframework.boot.devtools.restart.classloader.RestartClassLoader.loadClass(RestartClassLoader.java:136) ~[spring-boot-devtools-2.0.4.RELEASE.jar:2.0.4.RELEASE] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_131] at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:589) ~[druid-1.1.10.jar:1.1.10] at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:817) [druid-1.1.10.jar:1.1.10] at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1229) [druid-1.1.10.jar:1.1.10] > 按照https://blog.csdn.net/yhl_jxy/article/details/78645010 设置了可以同时提交多条,今天配置多数据源 就会报错,将DruidConfig注释掉就ok了 ``` @Configuration public class DruidConfig { @Bean @ConfigurationProperties(prefix="spring.datasource") public DataSource druidPrimary(){ DruidDataSource druidDataSource = new DruidDataSource(); List<Filter> filterList = new ArrayList<>(); filterList.add(wallFilter()); druidDataSource.setProxyFilters(filterList); return new DruidDataSource(); } @Bean public WallFilter wallFilter(){ WallFilter wallFilter = new WallFilter(); wallFilter.setConfig(wallConfig()); return wallFilter; } @Bean public WallConfig wallConfig() { WallConfig config = new WallConfig(); config.setMultiStatementAllow(true);//允许一次执行多条语句 config.setNoneBaseStatementAllow(true);//允许一次执行多条语句 return config; } } ``` yml ``` #数据源 datasource: type: com.alibaba.druid.pool.DruidDataSource dynamic: primary: xxrx datasource: d1: url: jdbc:mysql://127.0.0.1:3307/d1?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true username: root password: driver-class-name: com.mysql.jdbc.Driver d2: url: jdbc:mysql://127.0.0.1:3307/d2?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true username: root password: driver-class-name: com.mysql.jdbc.Driver druid: initialSize: 5 minIdle: 5 maxActive: 20 maxWait: 60000 timeBetweenEvictionRunsMillis: 60000 minEvictableIdleTimeMillis: 300000 validationQuery: SELECT 1 FROM DUAL testWhileIdle: true testOnBorrow: false testOnReturn: false poolPreparedStatements: true maxPoolPreparedStatementPerConnectionSize: 20 filters: stat,wall,log4j2 connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 ``` 大佬们求解决办法啊
myeclipse中tomcat8.0启动报错,大神们知道怎么解决吗?
2016-06-26 18:55:30,718 [localhost-startStop-1] ERROR [com.alibaba.druid.pool.DruidDataSource] - init datasource error, url: jdbc:oracle:thin:@localhost:1521:orcl java.sql.SQLRecoverableException: IO 错误: Software caused connection abort: socket write error at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:428) at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:536) at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:228) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:148) at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:211) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1377) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1431) at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:632) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) Caused by: java.net.SocketException: Software caused connection abort: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113) at java.net.SocketOutputStream.write(SocketOutputStream.java:159) at oracle.net.ns.Packet.send(Packet.java:386) at oracle.net.ns.ConnectPacket.send(ConnectPacket.java:182) at oracle.net.ns.NSProtocol.connect(NSProtocol.java:284) at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1054) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:308) ... 87 more 2016-06-26 18:55:30,732 [localhost-startStop-1] ERROR [com.alibaba.druid.pool.DruidDataSource] - dataSource init error java.sql.SQLRecoverableException: IO 错误: Software caused connection abort: socket write error at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:428) at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:536) at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:228) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:148) at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:211) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1377) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1431) at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:632) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) 今天我用tomcat启动项目时,启动过程中就报错,这种情况前几天也出现过,我把oracle数据库卸载后重新装,又重启几次电脑,第二天到公司上班又能正常启动了,现在又出现这种问题,请各位师兄帮我看下,非常感谢!
com.alibaba.druid.pool.DruidDataSource 报错
使用springboot2.0.1,数据源使用alibaba的druid,数据库是oracle。启动程序启动报如下错误。同样的程序打包后在其他人电脑可以正常运行,在我电脑上运行就报如下错误。但是在我电脑上用plsql也可以正常连接数据库 ,求大神指点迷津 2018-06-06 10:45:21.242 ERROR 10508 --- [nfoReplicator-0] com.alibaba.druid.pool.DruidDataSource : init datasource error, url: jdbc:oracle:thin:@172.20.26.21:1521:dbtest java.sql.SQLRecoverableException: IO 错误: Got minus one from a read call, connect lapse 3 ms., Authentication lapse 0 ms. at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:794) at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:688) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:39) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:691) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:156) at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:218) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:150) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1560) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1623) at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:861) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1229) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1225) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:90) at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:324) at org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator.getProduct(DataSourceHealthIndicator.java:122) at org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator.doDataSourceHealthCheck(DataSourceHealthIndicator.java:109) at org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator.doHealthCheck(DataSourceHealthIndicator.java:104) at org.springframework.boot.actuate.health.AbstractHealthIndicator.health(AbstractHealthIndicator.java:84) at org.springframework.boot.actuate.health.CompositeHealthIndicator.health(CompositeHealthIndicator.java:68) at org.springframework.cloud.netflix.eureka.EurekaHealthCheckHandler.getHealthStatus(EurekaHealthCheckHandler.java:103) at org.springframework.cloud.netflix.eureka.EurekaHealthCheckHandler.getStatus(EurekaHealthCheckHandler.java:99) at com.netflix.discovery.DiscoveryClient.refreshInstanceInfo(DiscoveryClient.java:1382) at com.netflix.discovery.InstanceInfoReplicator.run(InstanceInfoReplicator.java:117) at com.netflix.discovery.InstanceInfoReplicator$1.run(InstanceInfoReplicator.java:101) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.IOException: Got minus one from a read call, connect lapse 3 ms., Authentication lapse 0 ms. at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:790) ``` ```
Druid连接Mysql出现错误,create connection SQLException
``` 2020-01-17 23:43:11.284 ERROR 1710 --- [reate-161314577] com.alibaba.druid.pool.DruidDataSource : create connection SQLException, url: jdbc:mysql://192.168.151.130:6666/secondskill?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8, errorCode 1049, state 42000 java.sql.SQLSyntaxErrorException: Unknown database 'secondskill' at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[mysql-connector-java-8.0.18.jar:8.0.18] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.18.jar:8.0.18] at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.18.jar:8.0.18] at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836) ~[mysql-connector-java-8.0.18.jar:8.0.18] at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456) ~[mysql-connector-java-8.0.18.jar:8.0.18] at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246) ~[mysql-connector-java-8.0.18.jar:8.0.18] at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) ~[mysql-connector-java-8.0.18.jar:8.0.18] at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1643) ~[druid-1.1.20.jar:1.1.20] at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1709) ~[druid-1.1.20.jar:1.1.20] at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2715) ~[druid-1.1.20.jar:1.1.20] ``` 这个错误是在我修改Mysql时区后出现的,但是我不能确定是不是修改时区导致的这个问题,这个Mysql是在centos系统上的docker里运行的,在我本机上通过navicat是可以连接上Mysql数据库的,用户名和密码是可以保证正确的.这个是出现的错误码 **errorCode 1049, state 42000**,我曾尝试更换了Mysql连接jar包为5.1.38的也是出现这个错误.程序运行是没有问题的,如果过程中有对数据库的操作的话就会也现这个错误,请问这个问题在那里呢?
atomikos 解决分布式事务报错,求大神~
Registering transaction synchronization for SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2d694821] 2019-05-05 16:05:24.561 WARN 12880 --- [nio-8080-exec-1] c.atomikos.jdbc.AbstractDataSourceBean : AtomikosDataSoureBean 'db2': poolSize equals default - this may cause performance problems! 2019-05-05 16:05:24.593 WARN 12880 --- [nio-8080-exec-1] com.alibaba.druid.pool.DruidDataSource : removeAbandoned is true, not use in productiion. 2019-05-05 16:05:25.899 INFO 12880 --- [nio-8080-exec-1] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} inited 2019-05-05 16:05:25.908 INFO 12880 --- [nio-8080-exec-1] c.a.d.xa.XATransactionalResource : db2: refreshed XAResource 2019-05-05 16:05:25.970 WARN 12880 --- [nio-8080-exec-1] c.a.r.xa.XaResourceRecoveryManager : Error while retrieving xids from resource - will retry later... com.mysql.cj.jdbc.MysqlXAException: XAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistency at com.mysql.cj.jdbc.MysqlXAConnection.mapXAExceptionFromSQLException(MysqlXAConnection.java:333) ~[mysql-connector-java-8.0.11.jar:8.0.11] at com.mysql.cj.jdbc.MysqlXAConnection.recover(MysqlXAConnection.java:184) ~[mysql-connector-java-8.0.11.jar:8.0.11] at com.mysql.cj.jdbc.MysqlXAConnection.recover(MysqlXAConnection.java:112) ~[mysql-connector-java-8.0.11.jar:8.0.11] at com.atomikos.datasource.xa.RecoveryScan.recoverXids(RecoveryScan.java:32) ~[transactions-jta-4.0.6.jar:na] at com.atomikos.recovery.xa.XaResourceRecoveryManager.retrievePreparedXidsFromXaResource(XaResourceRecoveryManager.java:158) [transactions-jta-4.0.6.jar:na] at com.atomikos.recovery.xa.XaResourceRecoveryManager.recover(XaResourceRecoveryManager.java:67) [transactions-jta-4.0.6.jar:na] at com.atomikos.datasource.xa.XATransactionalResource.recover(XATransactionalResource.java:449) [transactions-jta-4.0.6.jar:na] at com.atomikos.datasource.xa.XATransactionalResource.setRecoveryService(XATransactionalResource.java:416) [transactions-jta-4.0.6.jar:na] at com.atomikos.icatch.config.Configuration.addResource(Configuration.java:249) [transactions-api-4.0.6.jar:na] at com.atomikos.jdbc.AtomikosDataSourceBean.doInit(AtomikosDataSourceBean.java:183) [transactions-jdbc-4.0.6.jar:na] at com.atomikos.jdbc.AbstractDataSourceBean.init(AbstractDataSourceBean.java:292) [transactions-jdbc-4.0.6.jar:na] at com.atomikos.jdbc.AbstractDataSourceBean.getConnection(AbstractDataSourceBean.java:343) [transactions-jdbc-4.0.6.jar:na] at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:157) [spring-jdbc-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115) [spring-jdbc-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78) [spring-jdbc-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:82) [mybatis-spring-1.3.2.jar:1.3.2] at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:68) [mybatis-spring-1.3.2.jar:1.3.2] at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:338) [mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:84) [mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49) [mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) [mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) [mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198) [mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185) [mybatis-3.4.6.jar:3.4.6] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_102] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_102] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_102] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_102] at com.yintw.springboot.config.CustomSqlSessionTemplate$SqlSessionInterceptor.invoke(CustomSqlSessionTemplate.java:117) [classes/:na] at com.sun.proxy.$Proxy64.insert(Unknown Source) [na:na] at com.yintw.springboot.config.CustomSqlSessionTemplate.insert(CustomSqlSessionTemplate.java:231) [classes/:na] at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:58) [mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) [mybatis-3.4.6.jar:3.4.6] at com.sun.proxy.$Proxy66.insert(Unknown Source) [na:na] at com.yintw.springboot.dao.impl.TuserDaoImpl.insert(TuserDaoImpl.java:83) [classes/:na] at com.yintw.springboot.dao.impl.TuserDaoImpl$$FastClassBySpringCGLIB$$6f464830.invoke(<generated>) [classes/:na] at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) [spring-core-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749) [spring-aop-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) [spring-aop-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:56) [spring-aop-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) [spring-aop-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:47) [spring-aop-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) [spring-aop-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294) ~[spring-tx-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) ~[spring-tx-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) [spring-aop-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93) ~[spring-aop-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) [spring-aop-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) ~[spring-aop-5.1.4.RELEASE.jar:5.1.4.RELEASE] at com.yintw.springboot.dao.impl.TuserDaoImpl$$EnhancerBySpringCGLIB$$c2209d67.insert(<generated>) ~[classes/:na] at com.yintw.springboot.service.impl.ProgrammerServiceImpl.insert(ProgrammerServiceImpl.java:95) ~[classes/:na] at com.yintw.springboot.service.impl.ProgrammerServiceImpl$$FastClassBySpringCGLIB$$286d4e3f.invoke(<generated>) ~[classes/:na] at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) [spring-core-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749) [spring-aop-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) [spring-aop-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294) ~[spring-tx-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) ~[spring-tx-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) [spring-aop-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) ~[spring-aop-5.1.4.RELEASE.jar:5.1.4.RELEASE] at com.yintw.springboot.service.impl.ProgrammerServiceImpl$$EnhancerBySpringCGLIB$$6ec96463.insert(<generated>) ~[classes/:na] at com.yintw.springboot.controller.ProgrammerController.insert(ProgrammerController.java:52) ~[classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_102] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_102] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_102] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_102] at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189) ~[spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:908) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882) ~[spring-webmvc-5.1.4.RELEASE.jar:5.1.4.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.14.jar:9.0.14] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:124) ~[druid-1.1.16.jar:1.1.16] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) ~[spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) ~[spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_102] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_102] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.14.jar:9.0.14] at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_102] Caused by: java.sql.SQLException: XAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistency at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:127) ~[mysql-connector-java-8.0.11.jar:8.0.11] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:95) ~[mysql-connector-java-8.0.11.jar:8.0.11] at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.11.jar:8.0.11] at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1247) ~[mysql-connector-java-8.0.11.jar:8.0.11] at com.mysql.cj.jdbc.MysqlXAConnection.recover(MysqlXAConnection.java:163) ~[mysql-connector-java-8.0.11.jar:8.0.11] ... 116 common frames omitted ![图片说明](https://img-ask.csdn.net/upload/201905/05/1557044056_5358.jpg)![图片说明](https://img-ask.csdn.net/upload/201905/05/1557044064_836340.jpg)
springboot整合mybatis-plus无法映射xml文件
异常信息: ```org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)``` 异常原因排除: 1. 项目正常启动 2. mybaits-plus配置mapper.xml扫描没问题 ```xml mybatis-plus: # 配置扫描xml mapper-locations: classpath*:mapper/*/*Mapper.xml # 实体扫描,多个package用逗号或者分号分隔 type-aliases-package: org.cnplo.control.modules.admin.domain ``` 3. mapperscan扫描mapper正常 4.mybatis-plus的配置文件 MybatisPlusConfig配置 ```java @Configuration @MapperScan("org.cnplo.control.modules.*.mapper") public class MybatisPlusConfig { /** * 乐观锁插件 */ @Bean public OptimisticLockerInterceptor optimisticLockerInterceptor() { return new OptimisticLockerInterceptor(); } /** * mybatis-plus分页插件 */ @Bean public PaginationInterceptor paginationInterceptor() { return new PaginationInterceptor(); } } ``` DruidDataSourceConfig配置 ```java @Configuration public class DruidDataSourceConfig { /** * @return DruidDataSource */ @Bean @ConfigurationProperties(prefix = "spring.datasource") public DruidDataSource druidDataSource() { return new DruidDataSource(); } /** * 配置事物管理器 */ @Bean public DataSourceTransactionManager transactionManager() { return new DataSourceTransactionManager(druidDataSource()); } } ``` 项目正常启动,执行数据库请求的时候异常BindingException。请问这是什么问题,大胆猜测是哪个jar包升级引起的,还请大佬们不吝赐教 ``` <properties> <java.version>1.8</java.version> <json.version>1.2.54</json.version> <druid.version>1.1.20</druid.version> <swagger.version>2.7.0</swagger.version> <mybatisplus.version>3.3.1.tmp</mybatisplus.version> </properties> <dependencies> <!--web--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!--lombok--> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> <!--druid--> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>${druid.version}</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <!-- mybatisplus与springboot整合 --> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>${mybatisplus.version}</version> </dependency> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus</artifactId> <version>${mybatisplus.version}</version> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-autoconfigure</artifactId> <version>1.3.2</version> </dependency> <!-- swagger2 rest api start--> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>${swagger.version}</version> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>${swagger.version}</version> </dependency> <!--json工具--> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>${json.version}</version> </dependency> <!-- jwt --> <dependency> <groupId>io.jsonwebtoken</groupId> <artifactId>jjwt</artifactId> <version>0.9.1</version> </dependency> <!--redis--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <!--thymeleaf--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <!--test--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <exclusions> <exclusion> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> </exclusion> </exclusions> </dependency> </dependencies> ```
springboot 使用druidDataSource,用配置文件自动配置,如果想把DataSource注入该怎么做 ?
工程中使用的式druidDataSource,没有写任何Java配置文件,直接使用properties文件创建的数据源。现在想使用shiro,jdbcreadlm使用时需要set数据源,我直接在配置文件上方使用autowired会报错。请问有什么解决方案么?。 ``` spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://127.0.0.1:3306/random_recommend?characterEncoding=utf-8 spring.datasource.username=root spring.datasource.password=root@password #druid数据源需要的东西 spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.druid.max-active=20 spring.datasource.druid.test-on-borrow=true ``` ``` @Autowired DruidDataSource druidDataSource; @ExceptionHandler(AuthorizationException.class) @ResponseStatus(HttpStatus.FORBIDDEN) public String handleException(AuthorizationException e, Model model) { // you could return a 404 here instead (this is how github handles 403, so the user does NOT know there is a // resource at that location) LogUtil.debug(this.getClass(),"AuthorizationException was thrown", e); Map<String, Object> map = new HashMap<String, Object>(); map.put("status", HttpStatus.FORBIDDEN.value()); map.put("message", "用户权限不足"); model.addAttribute("errors", map); return "error403"; } @Bean public Realm realm() { JdbcRealm jdbcRealm = new JdbcRealm(); jdbcRealm.setDataSource(druidDataSource); jdbcRealm.setPermissionsLookupEnabled(true); String sqlQueryUserPassword = "select user_password from tb_sys_user where user_id = ?"; jdbcRealm.setAuthenticationQuery(sqlQueryUserPassword); return jdbcRealm; } ```
急!!本机项目访问linux下的mysql 一直报错
31-Oct-2017 19:41:43.520 严重 [Druid-ConnectionPool-Create-1019023074] com.alibaba.druid.pool.DruidDataSource.error create connection error, url: jdbc:mysql://zhang:3306/test?useSSL=false&autoReconnect=true&failOverReadOnly=false, errorCode 0, state 08001 com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. at sun.reflect.GeneratedConstructorAccessor19.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:404) at com.mysql.jdbc.Util.getInstance(Util.java:387) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:917) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:896) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:885) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:860) at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2165) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2090) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:795) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44) at sun.reflect.GeneratedConstructorAccessor17.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:404) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:400) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:327) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1464) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1529) at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2178) Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at sun.reflect.GeneratedConstructorAccessor15.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:404) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:981) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:339) at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2253) at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2106) ... 12 more Caused by: java.net.UnknownHostException: zhang at java.net.InetAddress.getAllByName0(InetAddress.java:1280) at java.net.InetAddress.getAllByName(InetAddress.java:1192) at java.net.InetAddress.getAllByName(InetAddress.java:1126) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:188) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:298) ... 14 more
在线等!!!linux服务器连接mysql5.7数据库报错 Could not get JDBC Connection; nested exception is com.alibaba.druid.pool.GetConnectionTimeoutException
以下是服务器上的报错代码 ![图片说明](https://img-ask.csdn.net/upload/201911/12/1573526989_375593.png) ``` >org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 1000, active 0, maxActive 500, creating 1 ``` 问题就是出在这里. 1,本地项目正常启动,无任何报错,数据库连接正常(使用的都是linux上面的数据库). ![图片说明](https://img-ask.csdn.net/upload/201911/12/1573527132_402324.png) 2,数据库工具使用无任何问题 ![图片说明](https://img-ask.csdn.net/upload/201911/12/1573527246_699888.png) 3,下面放出jdbc配置文件和spring配置文件 ``` jdbc.driverClassName=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://..XXXXXX.:/XXXXXX?useUnicode=true&characterEncoding=UTF-8&useSSL=false jdbc.username=xxxx jdbc.password=xxxxx jdbc.filters=stat jdbc.maxActive=500 jdbc.initialSize=1 jdbc.maxWait=1000 jdbc.minIdle=10 jdbc.maxIdle=15 jdbc.timeBetweenEvictionRunsMillis=60000 jdbc.minEvictableIdleTimeMillis=300000 jdbc.validationQuery=SELECT 'x' jdbc.testWhileIdle=true jdbc.testOnBorrow=false jdbc.testOnReturn=false jdbc.maxOpenPreparedStatements=20 jdbc.removeAbandoned=true jdbc.removeAbandonedTimeout=180 jdbc.logAbandoned=true ``` spring 配置 ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> <!-- 扫描service包下所有使用注解的类型 --> <context:component-scan base-package="com.yoFish.service"/> <!-- 配置数据库相关参数properties的属性:${url} --> <context:property-placeholder location="classpath:jdbc.properties"/> <!-- 阿里 druid 数据库连接池 --> <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" destroy-method="close"> <!-- 数据库基本信息配置 --> <property name="driverClassName" value="${jdbc.driverClassName}"/> <property name="url" value="${jdbc.url}"/> <property name="username" value="${jdbc.username}"/> <property name="password" value="${jdbc.password}"/> <property name="filters" value="${jdbc.filters}"/> <!-- 最大并发连接数 --> <property name="maxActive" value="${jdbc.maxActive}"/> <!-- 初始化连接数量 --> <property name="initialSize" value="${jdbc.initialSize}"/> <!-- 配置获取连接等待超时的时间 --> <property name="maxWait" value="${jdbc.maxWait}"/> <!-- 最小空闲连接数 --> <property name="minIdle" value="${jdbc.minIdle}"/> <!-- 最大空闲连接数 --> <property name="maxIdle" value="${jdbc.maxIdle}"/> <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 --> <property name="timeBetweenEvictionRunsMillis" value="${jdbc.timeBetweenEvictionRunsMillis}"/> <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 --> <property name="minEvictableIdleTimeMillis" value="${jdbc.minEvictableIdleTimeMillis}"/> <property name="validationQuery" value="${jdbc.validationQuery}"/> <property name="testWhileIdle" value="${jdbc.testWhileIdle}"/> <property name="testOnBorrow" value="${jdbc.testOnBorrow}"/> <property name="testOnReturn" value="${jdbc.testOnReturn}"/> <property name="maxOpenPreparedStatements" value="${jdbc.maxOpenPreparedStatements}"/> <!-- 超过时间限制是否回收 --> <property name="removeAbandoned" value="${jdbc.removeAbandoned}"/> <!-- 1800 秒,也就是 30 分钟 --> <property name="removeAbandonedTimeout" value="${jdbc.removeAbandonedTimeout}"/> <!-- 关闭 abanded 连接时输出错误日志 --> <property name="logAbandoned" value="${jdbc.logAbandoned}"/> </bean> <!-- 配置SqlSessionFactory对象 --> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <!-- 注入数据库连接池 --> <property name="dataSource" ref="dataSource"/> <!-- 扫描model包 使用别名 --> <property name="typeAliasesPackage" value="com.yoFish.model"/> <!-- 扫描sql配置文件:mapper需要的xml文件 --> <property name="mapperLocations" value="classpath:mapper/*.xml"/> </bean> <!-- 配置扫描Dao接口包,动态实现Dao接口,注入到spring容器中 --> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <!-- 注入sqlSessionFactory --> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/> <!-- 给出需要扫描Dao接口包 --> <property name="basePackage" value="com.yoFish.dao"/> </bean> <!-- 配置事务管理器 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <!-- 注入数据库连接池 --> <property name="dataSource" ref="dataSource"/> </bean> <!-- 配置基于注解的声明式事务 --> <tx:annotation-driven transaction-manager="transactionManager"/> </beans> ``` 这个问题搞了很久了,主要就是不知道问题在哪,本地真的是没有任何问题,很多方式我也试过了.很头疼,求大佬帮忙解决
java内存溢出问题,不确定哪里出的问题
项目运行的时候出现了内存溢出情况,复现方式无法确定,大概出现了五六次,每次复现的方式都不一样,下面是我用MAT工具分析的dump文件 ![图片说明](https://img-ask.csdn.net/upload/202001/20/1579508231_612899.png) ![图片说明](https://img-ask.csdn.net/upload/202001/20/1579508244_502327.png) 除了hibernate里的那两个对象,其他的1000多万个对象里全是integer类型的对象 这是当时出现的时候产生的异常 ``` 2020-01-17 13:32:55 ERROR [DruidDataSource.java:2469] - create connection SQLException, url: jdbc:mysql://localhost:55060/mcs?useUnicode=true&characterEncoding=utf-8, errorCode 0, state 08S01 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 1 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3517) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3417) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3860) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:864) at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1707) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1217) at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2189) at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2220) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2015) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:768) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) at sun.reflect.GeneratedConstructorAccessor118.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:385) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:323) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1513) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1578) at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2466) Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost. at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2969) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3427) ... 19 more 2020-01-17 13:33:03 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_preset_rlat failed: java.lang.OutOfMemoryError: GC overhead limit exceeded at net.sf.ehcache.util.MemoryEfficientByteArrayOutputStream.getBytes(MemoryEfficientByteArrayOutputStream.java:65) at net.sf.ehcache.util.MemoryEfficientByteArrayOutputStream.serialize(MemoryEfficientByteArrayOutputStream.java:99) at net.sf.ehcache.store.disk.DiskStorageFactory.serializeElement(DiskStorageFactory.java:405) at net.sf.ehcache.store.disk.DiskStorageFactory.write(DiskStorageFactory.java:384) at net.sf.ehcache.store.disk.DiskStorageFactory$DiskWriteTask.call(DiskStorageFactory.java:485) at net.sf.ehcache.store.disk.DiskStorageFactory$PersistentDiskWriteTask.call(DiskStorageFactory.java:1088) at net.sf.ehcache.store.disk.DiskStorageFactory$PersistentDiskWriteTask.call(DiskStorageFactory.java:1072) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) 2020-01-17 13:32:59 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:32:59 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:32:55 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:33:16 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:33:27 WARN [SqlExceptionHelper.java:143] - SQL Error: 0, SQLState: null 2020-01-17 13:33:27 ERROR [SqlExceptionHelper.java:144] - wait millis 7401, active 16, maxActive 40, creating 1 2020-01-17 13:33:27 INFO [GetCWRCapHandler.java:114] - 解析录像服务器上报心跳协议过程中出现异常:org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection 2020-01-17 13:33:33 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:33:33 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:33:49 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:33:49 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:33:49 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:33:49 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:33:49 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:33:53 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:33:53 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:33:53 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:34:02 WARN [SqlExceptionHelper.java:143] - SQL Error: 0, SQLState: null 2020-01-17 13:34:02 ERROR [SqlExceptionHelper.java:144] - wait millis 5503, active 18, maxActive 40, creating 1 2020-01-17 13:34:02 INFO [GetCWRCapHandler.java:114] - 解析录像服务器上报心跳协议过程中出现异常:org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection 2020-01-17 13:34:04 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:34:08 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:34:12 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:34:12 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:34:14 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:34:14 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:34:14 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:34:17 WARN [SqlExceptionHelper.java:143] - SQL Error: 0, SQLState: null 2020-01-17 13:34:17 ERROR [SqlExceptionHelper.java:144] - wait millis 5485, active 19, maxActive 40, creating 1 2020-01-17 13:34:17 INFO [GetCWRCapHandler.java:114] - 解析录像服务器上报心跳协议过程中出现异常:org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access: SQLException for SQL [n/a]; SQL state [null]; error code [0]; Could not open connection; nested exception is org.hibernate.exception.GenericJDBCException: Could not open connection 2020-01-17 13:34:17 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:34:27 INFO [DeviceCache.java:249] - 设备状态及报警维护过程中出现异常 2020-01-17 13:34:35 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:34:35 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:34:42 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:34:42 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:34:44 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:34:44 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:34:52 WARN [SqlExceptionHelper.java:143] - SQL Error: 0, SQLState: null 2020-01-17 13:34:52 ERROR [SqlExceptionHelper.java:144] - wait millis 7301, active 22, maxActive 40, creating 1 2020-01-17 13:34:52 INFO [GetCWRCapHandler.java:114] - 解析录像服务器上报心跳协议过程中出现异常:org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection 2020-01-17 13:34:53 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:35:05 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_roll_preset failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-17 13:35:18 WARN [SqlExceptionHelper.java:143] - SQL Error: 0, SQLState: null 2020-01-17 13:35:18 ERROR [SqlExceptionHelper.java:144] - Error 2020-01-17 13:35:50 WARN [SqlExceptionHelper.java:143] - SQL Error: 0, SQLState: null 2020-01-17 13:35:50 ERROR [SqlExceptionHelper.java:144] - Error 2020-01-17 13:36:13 WARN [SqlExceptionHelper.java:143] - SQL Error: 1205, SQLState: 40001 2020-01-17 13:36:13 ERROR [SqlExceptionHelper.java:144] - Lock wait timeout exceeded; try restarting transaction 2020-01-17 13:36:13 WARN [SqlExceptionHelper.java:143] - SQL Error: 1205, SQLState: 40001 2020-01-17 13:36:24 ERROR [SqlExceptionHelper.java:144] - Lock wait timeout exceeded; try restarting transaction 2020-01-17 13:36:13 WARN [SqlExceptionHelper.java:143] - SQL Error: 1205, SQLState: 40001 2020-01-17 13:37:01 ERROR [SqlExceptionHelper.java:144] - Lock wait timeout exceeded; try restarting transaction 2020-01-17 13:37:43 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-17 13:36:37 WARN [SqlExceptionHelper.java:143] - SQL Error: 1205, SQLState: 40001 2020-01-17 13:36:33 WARN [SqlExceptionHelper.java:143] - SQL Error: 1205, SQLState: 40001 2020-01-17 13:36:22 WARN [SqlExceptionHelper.java:143] - SQL Error: 1205, SQLState: 40001 ``` 现在就是无法确定到底哪里导致的内存溢出? 这个是上次出现的异常和代码 ``` 2020-01-13 13:21:44 WARN [SqlExceptionHelper.java:143] - SQL Error: 1205, SQLState: 40001 2020-01-13 13:21:44 ERROR [SqlExceptionHelper.java:144] - Lock wait timeout exceeded; try restarting transaction 2020-01-13 13:23:55 INFO [MQTTProtocolHandler.java:283] - 接收到设备接入协议:{"topic":"info/deviceBaseInfo/BHIP118-S/00:00:01:A6:00:A2","reportTime":"256573751","decodeCapacity":{"totalLevel":2,"totalBlock":36,"totalPixel":16588800},"outputList":[{"status":"start","ratio":"UHD","pixel":"3840*2160","type":"UDP","url":"udp://231.0.100.80:7001"},{"status":"start","ratio":"HD","pixel":"960*540","type":"UDP","url":"udp://231.0.101.80:7001"},{"status":"start","ratio":"SD","pixel":"352*288","type":"UDP","url":"udp://231.0.102.80:7001"},{"status":"stop","ratio":"UHD","pixel":"3840*2160","type":"RTMP","url":"rtmp://192.168.15.80:1935/live/100"},{"status":"stop","ratio":"HD","pixel":"960*540","type":"RTMP","url":"rtmp://192.168.15.124:1935/live/101"},{"status":"stop","ratio":"SD","pixel":"352*288","type":"RTMP","url":"rtmp://192.168.15.80:1935/live/102"}],"baseInfo":{"deviceType":"BHIP118-S","code":"00:00:01:A6:00:A2","version":"v1.0.0.11","ip":"192.168.16.80"},"online":true} 2020-01-13 13:23:59 INFO [DeviceCache.java:127] - 接收到新增/更新设备信息:00:00:01:A6:00:A2 :BaseInfo [type=0,name=BHIP118-S,ip=192.168.16.80,port=0,code=00:00:01:A6:00:A2,groupCode=null,groupIndex=0,online=true,multiCastTime=0,ver=v1.0.0.11,channel=0,reserve=0,lockStatus=null,workMode=null,videoPixerls=null,kvmMode=null,serialNumber=null,sdipPortInfo is null,hdIpPortInfo is null,audioIpPortInfo is null,outputList[SourceOutput [ratio=UHD, url=udp://231.0.100.80:7001, pixel=3840*2160, channel=0, SourceOutput [ratio=HD, url=udp://231.0.101.80:7001, pixel=960*540, channel=0, SourceOutput [ratio=SD, url=udp://231.0.102.80:7001, pixel=352*288, channel=0, SourceOutput [ratio=UHD, url=rtmp://192.168.15.80:1935/live/100, pixel=3840*2160, channel=0, SourceOutput [ratio=HD, url=rtmp://192.168.15.124:1935/live/101, pixel=960*540, channel=0, SourceOutput [ratio=SD, url=rtmp://192.168.15.80:1935/live/102, pixel=352*288, channel=0],callStatus=null] 2020-01-13 13:24:06 INFO [MultiCastDeviceInfoHandler.java:229] - 更新视频合成器设备信息: Device [id=ff8080816f694555016f6a4bf61e158c, code=00:00:01:A6:00:A2, name=192.168.16.80, ip=192.168.16.80, port=0, status=0, type=BHIP118, deviceType=BHIP118-S, stamp=2020-01-03 15:26:00, abilityInfo=null, netCardInfo=null] 2020-01-13 13:24:53 INFO [MultiCastDeviceInfoHandler.java:364] - 更新解码器信息:Decoder [IP=192.168.16.80, Port=0, Channel=0, totalBlocks=36, totalLevel=2, uRefWidth=1920, uRefHeight=1080, audioPort=0, totalPixel=16588800, deviceTypeName=BHIP118-S, pixelsWidth=null, pixelsHeight=null] 2020-01-13 13:25:17 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:25:17 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:25:17 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:25:19 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:25:28 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:25:42 WARN [SqlExceptionHelper.java:143] - SQL Error: 0, SQLState: null 2020-01-13 13:25:42 ERROR [SqlExceptionHelper.java:144] - wait millis 14463, active 11, maxActive 40, creating 1 2020-01-13 13:25:46 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_playback_task failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-13 13:25:48 WARN [SqlExceptionHelper.java:143] - SQL Error: 0, SQLState: null 2020-01-13 13:25:50 ERROR [SqlExceptionHelper.java:144] - wait millis 18056, active 11, maxActive 40, creating 1 2020-01-13 13:25:50 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_source_volume failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-13 13:25:51 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:25:51 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:25:51 INFO [GetCWRCapHandler.java:114] - 解析录像服务器上报心跳协议过程中出现异常:org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access: SQLException for SQL [n/a]; SQL state [null]; error code [0]; Could not open connection; nested exception is org.hibernate.exception.GenericJDBCException: Could not open connection 2020-01-13 13:25:51 INFO [GetCWRCapHandler.java:114] - 解析录像服务器上报心跳协议过程中出现异常:org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection 2020-01-13 13:25:58 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_kvm failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-13 13:25:56 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:25:56 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:26:03 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_video_terminal failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-13 13:26:05 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_pic_layer failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-13 13:26:05 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_template failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-13 13:26:05 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_multicast_address failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-13 13:26:08 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_mass_source failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-13 13:26:08 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_pic_encoder_block failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-13 13:26:08 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_ipc_preset_group failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-13 13:26:08 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:26:13 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_video_terminal failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-13 13:26:17 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_record_layer_block failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-13 13:26:24 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_video_meeting failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-13 13:26:28 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_audio_preset_rlat failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-13 13:26:28 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_preset failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-13 13:26:28 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_layer_block failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-13 13:26:28 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:26:32 WARN [SqlExceptionHelper.java:143] - SQL Error: 0, SQLState: null 2020-01-13 13:26:32 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:26:32 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:26:32 ERROR [DiskStorageFactory.java:495] - Disk Write of mcs_encoder failed: java.lang.OutOfMemoryError: GC overhead limit exceeded 2020-01-13 13:26:52 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:27:07 ERROR [SqlExceptionHelper.java:144] - wait millis 20150, active 12, maxActive 40, creating 1 2020-01-13 13:26:50 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:26:46 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:26:46 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:26:41 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:26:41 ERROR [SqlExceptionHelper.java:144] - wait millis 23244, active 12, maxActive 40, creating 1 2020-01-13 13:26:41 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:26:41 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:30:29 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:30:25 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:30:07 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:30:07 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 2020-01-13 13:30:07 WARN [DruidDataSource.java:1258] - get connection timeout retry : 1 ``` 这个是组播上报的设备信息,因为组播是一秒钟上报了好几次,是不是这里一直占用着连接 ``` public void run() { try { ms = new MulticastSocket(multiCastPort);//建立组播套接字 ms.setReceiveBufferSize(65535); // ms.setNetworkInterface(NetworkInterface.getByInetAddress(localAddress)); ms.joinGroup(InetAddress.getByName(multiCastIP));//加入组播组 LogHome.getLog().info("正常启动监听" + localAddress.getHostAddress()); byte[] buffer = null; DatagramPacket dp = null; while (true) { try { if (IsStop) { break; } buffer = new byte[1400]; dp = new DatagramPacket(buffer, buffer.length); LogHome.getLog().debug("等待接受组播信息:"); ms.receive(dp); MultiCastInfoParser info = new MultiCastInfoParser(dp.getData()); DeviceCache.baseInfoOf1004Handler(info.parse()); } catch (Exception e) { if (IsStop) {// 如果换网卡可能会出问题 break; } else { if (ms.isClosed()) { ms = new MulticastSocket(multiCastPort); ms.setNetworkInterface(NetworkInterface.getByInetAddress(localAddress)); ms.joinGroup(InetAddress.getByName(multiCastIP)); } } LogHome.getLog().error("接受并设置组播信息失败",e); }finally{ Thread.sleep(1); } } } catch (Exception e) { e.printStackTrace(); try { if (listenerList.containsKey(localAddress.getHostAddress())) { listenerList.remove(localAddress.getHostAddress()); } } catch (Exception ex) { LogHome.getLog().error(ex); } } ```
linux执行jar包报Caused by: com.mysql.cj.exceptions.CJException: Access denied for user 'root'@'root' (using password: YES)错误
我用idea创建一个spring boot项目本地执行application可以运行程序。 但是项目打成jar包后放入linux中用 java -jar执行报错,报错情况如下: [ERROR] 2019-09-28 13:10:36,293 method:com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1846) create connection error java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:897) at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:822) at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:447) at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:237) at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1375) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1431) at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1844) Caused by: com.mysql.cj.exceptions.CJException: Access denied for user 'root'@'root' (using password: YES) at sun.reflect.GeneratedConstructorAccessor34.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:129) at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:795) at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:720) at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:688) at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:130) at com.mysql.cj.protocol.a.NativeAuthenticationProvider.proceedHandshakeWithPluggableAuthentication(NativeAuthenticationProvider.java:540) at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:202) at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1348) at com.mysql.cj.NativeSession.connect(NativeSession.java:163) at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:841) ... 7 more [ERROR] 2019-09-28 13:10:40,298 method:com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1846) create connection error java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:897) at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:822) at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:447) at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:237) at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1375) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1431) at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1844) Caused by: com.mysql.cj.exceptions.CJException: Access denied for user 'root'@'root' (using password: YES) at sun.reflect.GeneratedConstructorAccessor34.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:129) at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:795) at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:720) at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:688) at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:130) at com.mysql.cj.protocol.a.NativeAuthenticationProvider.proceedHandshakeWithPluggableAuthentication(NativeAuthenticationProvider.java:540) at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:202) at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1348) at com.mysql.cj.NativeSession.connect(NativeSession.java:163) at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:841) ... 7 more
使用本地mysql数据库启动web项目报错,相同配置外网msql数据库可以用,是数据库设置问题吗?
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-728509313] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1375196893] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1375196893] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-380877983] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-380877983] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1958976357] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1958976357] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-888791044] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-888791044] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1680977194] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1680977194] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1500697905] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1500697905] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-825092351] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-825092351] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1919336130] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1919336130] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1359718323] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1359718323] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1142728862] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1142728862] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1138364809] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1138364809] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-2022546549] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-2022546549] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-457812181] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-457812181] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1835450670] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1835450670] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-934642271] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-934642271] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-915430016] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-915430016] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1356768196] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1356768196] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-637974190] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-637974190] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1501782061] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1501782061] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1251056048] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1251056048] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1209733166] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1209733166] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1941586899] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1941586899] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-605818094] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-605818094] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-651898843] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-651898843] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-169993469] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-169993469] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-2041263650] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-2041263650] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-34172156] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-34172156] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-80652875] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-80652875] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1958707362] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1958707362] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1254259586] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1254259586] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1706166937] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1706166937] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1469827928] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1469827928] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-70546237] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-70546237] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1112957965] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1112957965] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1521483596] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1521483596] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-2125473300] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-2125473300] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1555851957] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1555851957] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1287820448] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1287820448] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1211567269] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1211567269] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-220305539] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-220305539] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-785223761] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-785223761] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-826024929] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-826024929] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-544982821] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-544982821] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-969010839] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-969010839] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-715510897] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-715510897] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-473561128] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-473561128] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-255438821] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-255438821] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-905866025] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-905866025] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1925254828] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1925254828] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-733906291] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-733906291] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-91786407] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-91786407] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-305450723] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-305450723] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-2048634884] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-2048634884] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1455136124] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1455136124] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1576668749] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1576668749] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-840738895] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-840738895] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1027628996] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1977) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Destroy-1027628996] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Thread.sleep(Native Method) com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2070) 九月 27, 2018 8:36:47 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [apperceiveIHomeCenter] appears to have started a thread named [Druid-ConnectionPool-Create-1028752618] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
使用ssm出现java.lang.ClassNotFoundException: ${jdbc.driver}异常,求各位大神看一下
spring配置文件 <!-- 配置读取properties文件 jdbc.properties --> <context:property-placeholder location="classpath:jdbc.properties" /> <!-- 配置数据源 --> <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"> <property name="driverClassName" value="${jdbc.driver}" /> <property name="url" value="${jdbc.url}"/> <property name="username" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> </bean> <!-- 配置sqlSessionFactory --> <bean id ="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <!-- 核心配置文件 --> <property name="configLocation" value="classpath:mybatis/SqlMapConfig.xml" /> <!-- 注入数据源 --> <property name="dataSource" ref="dataSource" /> </bean> properties文件: jdbc.driver=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://localhost:3306/crm?characterEncoding=utf-8 jdbc.username=root jdbc.password=root classpath下配置了驱动 ![图片说明](https://img-ask.csdn.net/upload/201906/13/1560422889_65440.png) tomcat也配置了 ![图片说明](https://img-ask.csdn.net/upload/201906/13/1560423511_262957.png) 但是还是报错,求各位大神指点一下!
springMVC整合报错,求大神帮帮忙,两天了试了好多方法,还是摆不平
_ 2017-11-14 15:32:29,157 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed_ org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-beans.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'class path resource [BloggerMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for ssm.blog.dao.BloggerDao.BloggerResult at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:756) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4643) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5105) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1413) at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1377) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1613) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:304) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1172) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1394) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1398) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1366) at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.core.NestedIOException: Failed to parse mapping resource: 'class path resource [BloggerMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for ssm.blog.dao.BloggerDao.BloggerResult at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:522) at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:381) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ... 25 more Caused by: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for ssm.blog.dao.BloggerDao.BloggerResult at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:120) at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:92) at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:520) ... 28 more Caused by: java.lang.IllegalArgumentException: Result Maps collection already contains value for ssm.blog.dao.BloggerDao.BloggerResult at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:837) at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:809) at org.apache.ibatis.session.Configuration.addResultMap(Configuration.java:591) at org.apache.ibatis.builder.MapperBuilderAssistant.addResultMap(MapperBuilderAssistant.java:214) at org.apache.ibatis.builder.ResultMapResolver.resolve(ResultMapResolver.java:47) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:285) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:252) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElements(XMLMapperBuilder.java:244) at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:116) ... 30 more springMVC整合报错,求大神帮帮忙,两天了试了好多方法,还是摆不平 spring-bean.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd"> <!-- 开启包扫描 --> <context:component-scan base-package="ssm.blog"/> <!-- 配置druid数据源 --> <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"> <property name="username" value="root"/> <property name="password" value="admin"/> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost:3306/db_blog"/> </bean> <!-- 配置mybatis的sqlSessionFactory --> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <!-- 自动扫描mapper.xml文件--> <property name="mapperLocations" value="classpath:BloggerMapper.xml"/> <!-- 载入mybatis全局配置文件--> <property name="configLocation" value="classpath:mybatis-conf.xml"/> </bean> <!-- 配置mybatis dao接口扫描--> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="ssm.blog.dao"/> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/> <!-- <property name="javax.persistence.validation.mode"></property>--> </bean> <!-- 配置spring的声明式事务,名字为默认值 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> <!-- 开启事务控制的注解支持 --> <tx:annotation-driven transaction-manager="transactionManager"/> </beans>
springboot2.1.4 + jpa + hibernate 使用aop注解形式实现多数据源管理 可能懒加载出现问题求大神解答
最近项目中使用springboot2.1.4 + jpa + hibernate 使用aop注解形式实现多数据源管理,用的就是网上大多数人使用的一套代码,但是我在项目中使用后发现如果配置 spring配置文件 application.yml 中open-in-view: false 跨数据源查询正常,但是保存或者修改失败原因是事务没有提交,一旦把open-in-view改成true则不能跨数据源查询,修改保存正常事务正常提交求解,具体代码如下实现 1. application.yml ``` spring: ## 数据库配置 #datasource: #driver-class-name: com.mysql.jdbc.Driver #url: jdbc:mysql://192.168.101.125:3306/cdv?useSSL=false&characterEncoding=utf-8 #username: root #password: 123456 #url: jdbc:mysql://127.0.0.1:3306/boot-jpa-back-sys2?useSSL=false&characterEncoding=utf-8 #username: root #password: datasource: test1: driver-class-name: com.mysql.jdbc.Driver jdbc-url: jdbc:mysql://192.168.101.125:3306/cdv?useSSL=false&characterEncoding=utf-8 username: root password: 123456 type: com.alibaba.druid.pool.DruidDataSource test2: driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver jdbc-url: jdbc:sqlserver://192.168.101.125:1433;database=Test; username: sa password: Zqvideo123 type: com.alibaba.druid.pool.DruidDataSource ## jpa配置 jpa: show-sql: true hibernate: #ddl-auto: update properties: hibernate.dialect: com.common.mysql.MySQLDialectUTF8 hibernate.format_sql: false open-in-view: false ``` DataSourceAsepct ``` package com.common.db; import java.lang.reflect.Method; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.reflect.MethodSignature; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; @Aspect @Component @Order(0) public class DataSourceAsepct { //加载数据源 @Pointcut("@annotation(com.common.db.DataSourceSet)") // @AfterThrowing(pointcut="@annotation(com.common.db.DataSource)", throwing= "error") public void pointCut(){ } @Before("pointCut()") public void before(JoinPoint joinPoint) { Object target = joinPoint.getTarget(); MethodSignature signature = (MethodSignature) joinPoint.getSignature(); DataSourceEnum dataSource = DataSourceEnum.DEFAULT; try { Method method = target.getClass().getMethod(signature.getName(), signature.getParameterTypes()); if (method.isAnnotationPresent(DataSourceSet.class)) { DataSourceSet annotation = method.getAnnotation(DataSourceSet.class); dataSource = annotation.value(); } } catch (NoSuchMethodException e) { e.printStackTrace(); } //实现aop切换数据源 System.out.println("aop切换数据源:" + dataSource.getName()); DataSourceHolder.setDataSource(dataSource); } // @After("pointCut()") @AfterThrowing(pointcut="@annotation(com.common.db.DataSourceSet)", throwing= "error") public void after() { DataSourceHolder.clearDataSource(); String v = DataSourceHolder.getDataSource(); System.out.println(v); } } ``` DataSourceConfig ``` package com.common.db; import java.util.HashMap; import java.util.Map; import javax.sql.DataSource; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.jta.atomikos.AtomikosDataSourceBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.jta.JtaTransactionManager; @Configuration public class DataSourceConfig { //连接数据库db1 @Bean("test1") @ConfigurationProperties("spring.datasource.test1") public DataSource test1() { return DataSourceBuilder.create().build(); } //连接数据库db2 @Bean("test2") @ConfigurationProperties("spring.datasource.test2") public DataSource test2() { return DataSourceBuilder.create().build(); } @Bean("dynamicDataSource") @Primary public DataSource dynamicDataSource() { DynamicDataSource dataSource = new DynamicDataSource(); dataSource.setDefaultTargetDataSource(test1()); Map<Object, Object> dataSourceMap = new HashMap<>(2); dataSourceMap.put(DataSourceEnum.TEST1.getName(), test1()); dataSourceMap.put(DataSourceEnum.TEST2.getName(), test2()); dataSource.setTargetDataSources(dataSourceMap); return dataSource ; } @Bean public PlatformTransactionManager transactionManager() { return new DataSourceTransactionManager(dynamicDataSource()); } } ``` DataSourceEnum ``` package com.common.db; import lombok.AllArgsConstructor; import lombok.Getter; @AllArgsConstructor @Getter public enum DataSourceEnum { DEFAULT("test1"), TEST1("test1"), TEST2("test2"); private String name; } ``` DataSourceHolder ``` package com.common.db; public class DataSourceHolder { private static final ThreadLocal<String> DS_HOLDER = new ThreadLocal<>(); public static void setDataSource(DataSourceEnum dataSource) { DS_HOLDER.set(dataSource.getName()); } public static String getDataSource() { return DS_HOLDER.get(); } public static void clearDataSource() { DS_HOLDER.remove(); } } ``` DataSourceSet ``` package com.common.db; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Documented public @interface DataSourceSet { //枚举 DataSourceEnum value(); } ``` DynamicDataSource ``` package com.common.db; import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; public class DynamicDataSource extends AbstractRoutingDataSource { @Override protected Object determineCurrentLookupKey() { //基于aop切换数据源 System.out.println("dynamic datasource 切换数据源" + DataSourceHolder.getDataSource()); return DataSourceHolder.getDataSource(); } } ``` 测试调用 ``` server层 @Override @DataSourceSet(DataSourceEnum.TEST1) public String test1(Long id) { String s = programRepository.findids(id); System.out.println(s); return s; } @Override @DataSourceSet(DataSourceEnum.TEST2) public String test2(Long id) { String s = testRepository.findids1(id); System.out.println(s); return s; } ``` ``` Controller层 @PostMapping("/test") @ResponseBody public ResultVo test(Long id) { id = 1l; String beProgram1 = programService.test1(id); System.out.println(222); id=2l; String beProgram = testService.test2(id); System.out.println(333); return ResultVoUtil.success(beProgram+beProgram1); } ```
springboot 配置hibernate 开始使用的是mysql,都正常,但是换成Oracle后总是创建表。
springboot 配置hibernate 开始使用的是mysql,都正常,但是换成Oracle后总是创建表。所以后台报如下表重复错误。这是为什么呀?应该是如果发现表已经有的话不应该再创建才对,请帮我看下哪里配置错了。 再详细说明下我的场景: 数据库映射的对象Product。 第一次系统启动肯定会创建一个,因为数据库中是没有这个表,然后系统重启或者再次启动,正常来讲,Product对象没有改过,数据库表也存在,hibernate不应该再创建,但是目前就是再创建,所以报表名已经有的错误。 ``` Caused by: java.sql.SQLSyntaxErrorException: ORA-00955: 名称已由现有对象使用 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447) ~[ojdbc-6.6.0.jar:11.2.0.4.0] at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396) ~[ojdbc-6.6.0.jar:11.2.0.4.0] at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:951) ~[ojdbc-6.6.0.jar:11.2.0.4.0] ``` ``` server: port: 8001 spring: application: name: DEMO_TEST #f服务名称定义 datasource: type: com.alibaba.druid.pool.DruidDataSource # 当前数据源操作类型 #driver-class-name: com.mysql.cj.jdbc.Driver # mysql驱动包 driver-class-name: oracle.jdbc.driver.OracleDriver #url: jdbc:mysql://127.0.0.1:3306/rd_plm?serverTimezone=GMT%2B8 # 数据库名称 url: jdbc:oracle:thin:@127.0.0.1:1521/DD username: root password: root dbcp2: min-idle: 5 # 数据库连接池的最小维持连接数 initial-size: 5 # 初始化连接数 max-total: 5 # 最大连接数 max-wait-millis: 150 # 等待连接获取的最大超时时间 jpa: hibernate: naming: physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl ddl-auto: update show-sql: true properties: hibernate: #dialect: org.hibernate.dialect.MariaDBDialect dialect: org.hibernate.dialect.OracleDialect current_session_context_class: org.springframework.orm.hibernate5.SpringSessionContext #database: MYSQL database: oracle open-in-view: true ```
springboot一共7个jar,在本地idea上面都没问题,但是在服务器,一个jar启动不了
springboot项目,在idea上面正常启动,没有任何问题,但是在测试服务器(linux系统)启动不了,直接初始化数据源后close,各位大神谁可以看下是什么原因不,谢谢! ``` C:\Users\Administrator\Desktop\localJar>java -jar ad_user-0.0.1-SNAPSHOT.jar log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.StandardServletEnvironment). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.0.1.RELEASE) 2020-01-02 15:59:03.441 INFO 14568 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode! 2020-01-02 15:59:04.626 INFO 14568 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2020-01-02 15:59:04.626 INFO 14568 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.29 2020-01-02 15:59:04.639 INFO 14568 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:\Program Files\xftp\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;D:\Program Files\NetSarang\Xshell 6\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;D:\Program Files\GIT\bin;D:\maven\apache-maven-3.3.9\bin\;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;C:\Users\Administrator\AppData\Local\GitHubDesktop\bin;"C:\Program Files\Java\jdk1.8.0_221\bin;C:\Program Files\Java\jdk1.8.0_221\jre\bin;";;.] 2020-01-02 15:59:04.729 INFO 14568 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/user] : Initializing Spring embedded WebApplicationContext 2020-01-02 15:59:05.005 WARN 14568 --- [ost-startStop-1] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources. 2020-01-02 15:59:05.005 INFO 14568 --- [ost-startStop-1] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath. 2020-01-02 15:59:05.032 INFO 14568 --- [ost-startStop-1] c.netflix.config.DynamicPropertyFactory : DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@3c432935 2020-01-02 15:59:05.420 INFO 14568 --- [ost-startStop-1] c.a.d.s.b.a.DruidDataSourceAutoConfigure : Init DruidDataSource 2020-01-02 15:59:05.816 INFO 14568 --- [ost-startStop-1] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} inited 2020-01-02 15:59:07.798 INFO 14568 --- [ main] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} closed 2020-01-02 15:59:07.800 INFO 14568 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] ```
springboot 在eclipse中正常启动,打包成jar包启动报错。
如题,我在eclipse中可以正常启动,无报错。 但是打成包后通过java -jar启动报如下错误 ``` 2019-04-12 15:09:42.682 INFO 6356 --- [main] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} inited 2019-04-12 15:09:45.151 WARN 6356 --- [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apiController': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in URL [jar:file:/C:/monitored.jar!/BOOT-INF/classes!/com/zsyt/monitored/modular/system/mapper/UserMapper.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/spring/boot/starter/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: 'URL [jar:file:C:\\monitored.jar!/BOOT-INF/classes/com/zsyt/monitored/modular/system/mapper/mapping/ClassifyMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'URL [jar:file:C:\\monitored.jar!/BOOT-INF/classes/com/zsyt/monitored/modular/system/mapper/mapping/ClassifyMapper.xml]'. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.zsyt.monitored.modular.system.mapper.ClassifyMapper.BaseResultMap 2019-04-12 15:09:45.180 INFO 6356 --- [main] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} closed 2019-04-12 15:09:45.182 INFO 6356 --- [main] o.s.c.ehcache.EhCacheManagerFactoryBean : Shutting down EhCache CacheManager 2019-04-12 15:09:45.262 INFO 6356 --- [main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2019-04-12 15:09:45.339 INFO 6356 --- [main] ConditionEvaluationReportLoggingListener : Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2019-04-12 15:09:45.353 ERROR 6356 --- [main] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apiController': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in URL [jar:file:/C:/monitored.jar!/BOOT-INF/classes!/com/zsyt/monitored/modular/system/mapper/UserMapper.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/spring/boot/starter/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: 'URL [jar:file:C:\\monitored.jar!/BOOT-INF/classes/com/zsyt/monitored/modular/system/mapper/mapping/ClassifyMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'URL [jar:file:C:\\monitored.jar!/BOOT-INF/classes/com/zsyt/monitored/modular/system/mapper/mapping/ClassifyMapper.xml]'. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.zsyt.monitored.modular.system.mapper.ClassifyMapper.BaseResultMap at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:587) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:91) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:373) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1344) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:578) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) at com.zsyt.monitored.GunsApplication.main(GunsApplication.java:22) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) ``` 然后更精彩的是这个jar包在服务器上(win server2012)也能正常启动无报错。 然而在我的打包环境(win7 64 企业版)无法启动。
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私...
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
Linux(服务器编程):15---两种高效的事件处理模式(reactor模式、proactor模式)
前言 同步I/O模型通常用于实现Reactor模式 异步I/O模型则用于实现Proactor模式 最后我们会使用同步I/O方式模拟出Proactor模式 一、Reactor模式 Reactor模式特点 它要求主线程(I/O处理单元)只负责监听文件描述符上是否有事件发生,有的话就立即将时间通知工作线程(逻辑单元)。除此之外,主线程不做任何其他实质性的工作 读写数据,接受新的连接,以及处...
阿里面试官问我:如何设计秒杀系统?我的回答让他比起大拇指
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图和个人联系方式,欢迎Star和指教 前言 Redis在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在Redis的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸,打败了...
五年程序员记流水账式的自白。
不知觉已中码龄已突破五年,一路走来从起初铁憨憨到现在的十九线程序员,一路成长,虽然不能成为高工,但是也能挡下一面,从15年很火的android开始入坑,走过java、.Net、QT,目前仍处于android和.net交替开发中。 毕业到现在一共就职过两家公司,目前是第二家,公司算是半个创业公司,所以基本上都会身兼多职。比如不光要写代码,还要写软著、软著评测、线上线下客户对接需求收集...
C语言魔塔游戏
很早就很想写这个,今天终于写完了。 游戏截图: 编译环境: VS2017 游戏需要一些图片,如果有想要的或者对游戏有什么看法的可以加我的QQ 2985486630 讨论,如果暂时没有回应,可以在博客下方留言,到时候我会看到。 下面我来介绍一下游戏的主要功能和实现方式 首先是玩家的定义,使用结构体,这个名字是可以自己改变的 struct gamerole { char n...
一文详尽系列之模型评估指标
点击上方“Datawhale”,选择“星标”公众号第一时间获取价值内容在机器学习领域通常会根据实际的业务场景拟定相应的不同的业务指标,针对不同机器学习问题如回归、分类、排...
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观...
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外...
压测学习总结(1)——高并发性能指标:QPS、TPS、RT、吞吐量详解
一、QPS,每秒查询 QPS:Queries Per Second意思是“每秒查询率”,是一台服务器每秒能够相应的查询次数,是对一个特定的查询服务器在规定时间内所处理流量多少的衡量标准。互联网中,作为域名系统服务器的机器的性能经常用每秒查询率来衡量。 二、TPS,每秒事务 TPS:是TransactionsPerSecond的缩写,也就是事务数/秒。它是软件测试结果的测量单位。一个事务是指一...
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip installselenium -ihttps://pypi.tuna.tsinghua.edu.cn/simple/ ...
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
程序员该看的几部电影
1、骇客帝国(1999) 概念:在线/离线,递归,循环,矩阵等 剧情简介: 不久的将来,网络黑客尼奥对这个看似正常的现实世界产生了怀疑。 他结识了黑客崔妮蒂,并见到了黑客组织的首领墨菲斯。 墨菲斯告诉他,现实世界其实是由一个名叫“母体”的计算机人工智能系统控制,人们就像他们饲养的动物,没有自由和思想,而尼奥就是能够拯救人类的救世主。 可是,救赎之路从来都不会一帆风顺,到底哪里才是真实的世界?如何...
Python绘图,圣诞树,花,爱心 | Turtle篇
每周每日,分享Python实战代码,入门资料,进阶资料,基础语法,爬虫,数据分析,web网站,机器学习,深度学习等等。 公众号回复【进群】沟通交流吧,QQ扫码进群学习吧 微信群 QQ群 1.画圣诞树 import turtle screen = turtle.Screen() screen.setup(800,600) circle = turtle.Turtle()...
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东...
还记得那个提速8倍的IDEA插件吗?VS Code版本也发布啦!!
去年,阿里云发布了本地 IDE 插件 Cloud Toolkit,仅 IntelliJ IDEA 一个平台,就有 15 万以上的开发者进行了下载,体验了一键部署带来的开发便利。时隔一年的今天,阿里云正式发布了 Visual Studio Code 版本,全面覆盖前端开发者,帮助前端实现一键打包部署,让开发提速 8 倍。 VSCode 版本的插件,目前能做到什么? 安装插件之后,开发者可以立即体验...
破14亿,Python分析我国存在哪些人口危机!
一、背景 二、爬取数据 三、数据分析 1、总人口 2、男女人口比例 3、人口城镇化 4、人口增长率 5、人口老化(抚养比) 6、各省人口 7、世界人口 四、遇到的问题 遇到的问题 1、数据分页,需要获取从1949-2018年数据,观察到有近20年参数:LAST20,由此推测获取近70年的参数可设置为:LAST70 2、2019年数据没有放上去,可以手动添加上去 3、将数据进行 行列转换 4、列名...
2019年除夕夜的有感而发
天气:小雨(加小雪) 温度:3摄氏度 空气:严重污染(399) 风向:北风 风力:微风 现在是除夕夜晚上十点钟,再有两个小时就要新的一年了; 首先要说的是我没患病,至少现在是没有患病;但是心情确像患了病一样沉重; 现在这个时刻应该大部分家庭都在看春晚吧,或许一家人团团圆圆的坐在一起,或许因为某些特殊原因而不能团圆;但不管是身在何处,身处什么境地,我都想对每一个人说一句:新年快乐! 不知道csdn这...
听说想当黑客的都玩过这个Monyer游戏(1~14攻略)
第零关 进入传送门开始第0关(游戏链接) 请点击链接进入第1关: 连接在左边→ ←连接在右边 看不到啊。。。。(只能看到一堆大佬做完的留名,也能看到菜鸡的我,在后面~~) 直接fn+f12吧 &lt;span&gt;连接在左边→&lt;/span&gt; &lt;a href="first.php"&gt;&lt;/a&gt; &lt;span&gt;←连接在右边&lt;/span&gt; o...
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ...... ...
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!...
2020年的1月,我辞掉了我的第一份工作
其实,这篇文章,我应该早点写的,毕竟现在已经2月份了。不过一些其它原因,或者是我的惰性、还有一些迷茫的念头,让自己迟迟没有试着写一点东西,记录下,或者说是总结下自己前3年的工作上的经历、学习的过程。 我自己知道的,在写自己的博客方面,我的文笔很一般,非技术类的文章不想去写;另外我又是一个还比较热衷于技术的人,而平常复杂一点的东西,如果想写文章写的清楚点,是需要足够...
别低估自己的直觉,也别高估自己的智商
所有群全部吵翻天,朋友圈全部沦陷,公众号疯狂转发。这两周没怎么发原创,只发新闻,可能有人注意到了。我不是懒,是文章写了却没发,因为大家的关注力始终在这次的疫情上面,发了也没人看。当然,我...
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。 再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。 下文是原回答,希望能对你能有所启发。 如果我说,这个世界上人真的分三六九等,...
节后首个工作日,企业们集体开晨会让钉钉挂了
By 超神经场景描述:昨天 2 月 3 日,是大部分城市号召远程工作的第一天,全国有接近 2 亿人在家开始远程办公,钉钉上也有超过 1000 万家企业活跃起来。关键词:十一出行 人脸...
Java基础知识点梳理
虽然已经在实际工作中经常与java打交道,但是一直没系统地对java这门语言进行梳理和总结,掌握的知识也比较零散。恰好利用这段时间重新认识下java,并对一些常见的语法和知识点做个总结与回顾,一方面为了加深印象,方便后面查阅,一方面为了掌握好Android打下基础。
2020年全新Java学习路线图,含配套视频,学完即为中级Java程序员!!
新的一年来临,突如其来的疫情打破了平静的生活! 在家的你是否很无聊,如果无聊就来学习吧! 世上只有一种投资只赚不赔,那就是学习!!! 传智播客于2020年升级了Java学习线路图,硬核升级,免费放送! 学完你就是中级程序员,能更快一步找到工作! 一、Java基础 JavaSE基础是Java中级程序员的起点,是帮助你从小白到懂得编程的必经之路。 在Java基础板块中有6个子模块的学...
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合...
相关热词 c# 时间比天数 c# oracle查询 c# 主动推送 事件 c# java 属性 c# 控制台 窗体 c# 静态类存值 c#矢量作图 c#窗体调用外部程式 c# enum是否合法 c# 如何卸载引用
立即提问