我的日常

登录/注册
您现在的位置:论坛 盖世程序员(我猜到了开头 却没有猜到结局) 盖世程序员 > 程序启动 数据库访问失败问题
总共48086条微博

动态微博

查看: 1445|回复: 1

程序启动 数据库访问失败问题

[复制链接]

7

主题

3

听众

383

金钱

版主

该用户从未签到

跳转到指定楼层
楼主
发表于 2016-07-03 12:39:09 |只看该作者 |正序浏览
2016-07-03 09:47:26 -3906 [main] ERROR   - init datasource error/ D/ O6 K9 E2 W7 l
java.sql.SQLException: Could not retrieve transation read-only status server
5 S7 d3 V, h; O( j    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
0 s" i+ H7 F2 `: |& @% G    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
2 j. m; k9 R, }, t) |. z. w* x9 a    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924)
; _2 n+ s. Q0 x2 ^+ i% q3 H    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870)! h! u, z0 R/ E5 j: F
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:902)
, R, k9 E) O/ i    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:892)
: ]- j3 n  T6 {* K    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3607)# _2 F, _0 x9 v! j  L8 ]
    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3576)) i$ ]" z" e# T8 M; a. c
    at com.alibaba.druid.filter.FilterChainImpl.connection_isReadOnly(FilterChainImpl.java:383)3 j$ K- [+ ~5 u# l
    at com.alibaba.druid.filter.FilterAdapter.connection_isReadOnly(FilterAdapter.java:892), Y; Z$ a% g5 i  D. M9 p
    at com.alibaba.druid.filter.FilterChainImpl.connection_isReadOnly(FilterChainImpl.java:380)
8 K; [; `& }5 a$ c0 L+ b    at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.isReadOnly(ConnectionProxyImpl.java:292)7 o% D+ y& W+ b) w- J+ c
    at com.alibaba.druid.pool.DruidConnectionHolder.<init>(DruidConnectionHolder.java:96)
3 A4 ]) v, p: q& j7 R2 W& Y    at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:619)
. k! D4 A9 X4 Z& T" r6 x. e* h; G    at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:915)
7 W* l: Q0 V: q    at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:911)
; T# f/ O  F8 r6 M    at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:98)
# h, E* @* a' Y3 n- w' J5 }8 A& d    at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseProductName(VendorDatabaseIdProvider.java:76)
  b8 J, k4 Z! C    at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseName(VendorDatabaseIdProvider.java:61)  F, X: I1 k& ~: n: U
    at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseId(VendorDatabaseIdProvider.java:49); I: c0 i. S7 R% y) C! i) R4 G) ^
    at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:445)
# K0 x" V) Z* D  g* ~    at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:336)& {9 G9 w& \7 s* Q6 Y
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)0 O$ }' n" q' [% P5 ]/ n8 B- g
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
7 |% Q0 u3 G# o+ i+ _    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
5 b1 f: p" Q6 k# {    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)- P3 ^$ O( T: m, f( X- x4 V
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)  H# z, C8 @+ U( L. K6 E7 u+ H
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
  {, o7 p1 j2 s) F    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
% U) T  K- ], @2 ?; K    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
5 n$ ~" Z" @6 E% O6 @/ }    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
% S, ]1 e+ L, M. p% B, Z    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)- c( X: C; i4 W3 X
    at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:646), {1 D8 n0 s7 c6 e
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:140)  p7 o2 O- U$ O5 ?: L; g7 [) j
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1114)
1 _( g( ^; N5 \. s    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1017)
! p$ D( u& l+ ^, s, p7 U5 Z    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)$ o9 V/ s1 N; E4 z/ s) B7 }0 V# v3 r* D4 `
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)" N- U4 e, F+ [0 U& {
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
4 h) D- d0 o0 y    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)# \/ ~9 ^8 w8 S/ S+ j8 {
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)/ u: G; n6 Y) C* _2 B/ x0 X, c- H
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
9 t' `$ H0 d9 e$ L0 {! F# W    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:446)
8 M2 K+ }, C# E: [3 g    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:420); c9 B3 d2 F7 V8 M- [
    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:545)
( q9 C( j4 o% h) y" t8 D    at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:155)2 g8 z3 _% I. @+ u' }3 i0 M
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
& Y  Z5 F: ^) p1 [9 p! m    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:305)5 E# k8 ^9 Q  ?
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)
6 [& x5 n% r0 Z' L: I8 \3 F    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537); d' G" p& o% a% f( O8 c
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
2 I; R) T' ~: T+ n7 T    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
, Q* W8 Y- h- ^4 Q9 s9 K    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
3 @& S3 i' T9 T1 G" O* p    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)# `: F, n" `1 h7 n
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)8 j: l2 c% b( }$ l8 d8 b2 r
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
% f4 n1 D( L& r    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)  t) a$ M- \" u% N* Q0 K
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)# l' P- I3 B) |2 z+ O
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)% ~9 m7 O5 |' \6 M8 X( p- p
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)/ ?* h+ A' ^$ \$ ^# e
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
: Z+ T* Y) w; X% \6 f# k    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
9 _, G( Y3 _' {0 n: X    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)- S+ K* t( C2 F; G0 x9 G' f
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)1 c1 s0 [% ^( e% Q
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
4 w7 k" @/ j$ s4 \    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
! ]7 V  ^  _* s    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
) X5 }1 U* U( K( O. o* O    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)1 x) P+ U8 ~6 y* h. V
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
# e* e) _" g) U0 \4 _$ K    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
$ W" }! i- t; d    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)5 g" H3 R6 P( Q, f; b8 T5 s
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)) x2 G" g1 V% {8 M3 D7 N! M" E
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)) C7 R" j% E9 b) ~
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719), H' Q- f! V$ p
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
: ]1 A/ C  ?) K6 m    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)" [, `- b( {; ^( q# l4 V6 X4 p% ^/ p
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)2 {2 t+ B1 d/ m) d
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)9 D  V/ `+ l4 \. ]+ y& G
    at org.apache.catalina.startup.Catalina.start(Catalina.java:566)( v3 b# Y) l3 W( W' g4 g& n" k  o
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+ z7 f/ E3 B9 I" G    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
, q: F4 E1 M% g    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)7 f. m: Z# {/ B: C- t5 I! Z
    at java.lang.reflect.Method.invoke(Method.java:601)
" ^8 g3 I; h  L5 z    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)3 ?3 n% c' H4 I$ a
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)  L' o) e! P! h
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure5 L2 L( z" d- L* u; l
2 S% B8 c0 O4 v8 J* d
The last packet successfully received from the server was 31 milliseconds ago.  The last packet sent successfully to the server was 31 milliseconds ago.: U2 q) f; N5 p/ E
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
% `  ?& C0 l# g! w, [    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
& I6 o! e0 D' V9 c    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45), N- K; T: ~3 T6 L% n- J
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
3 @0 z: _3 v' q: J* l5 n. z* `    at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
% i9 Q6 K4 M4 Q- B' o    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1036)
% y/ v* Y0 M; W) F    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3427)0 Z% n: B% J4 i6 r2 x- F$ Z+ ]
    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3327)) O# `- Z) E, u/ @: s
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3814)3 ?7 F& {! B+ ?: W# _" z
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435), C# P4 ~" h: I5 U6 L( \
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582)) N* v4 ?  d$ _# o* d  X2 J8 E, p
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2526)# N8 T0 e, G  N+ X0 i+ r
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2484)
2 Y1 m7 C5 J+ }' M) C    at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1446)
/ G2 F& w, ^8 k1 m! T    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3601)# a) p4 u4 e( A5 O
    ... 78 more3 h0 [0 M1 ?5 ?- p$ R4 r: }
Caused by: java.net.SocketException: Connection reset
# y& S+ R7 O6 c- n, T, C! N    at java.net.SocketInputStream.read(SocketInputStream.java:189)
) k; y3 K! n6 m    at java.net.SocketInputStream.read(SocketInputStream.java:121)" s- [. `; `. F. ]) {5 F) I" p
    at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:100)
. K" s# }3 }7 {' \5 a! M% {    at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:143)
  i& n# Y& Z# n9 I3 j" J' f; G! J5 ~    at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:173)
; o1 @8 W0 Y4 q# ~2 I    at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2911)
) }3 }  K9 b* I6 n* F4 Q$ G# b2 ^4 I    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3337), C5 n* E/ M" f
    ... 86 more
9 M1 ?! ]. _5 `8 f! d

科帮网 1、本主题所有言论和图片纯属会员个人意见,与本社区立场无关
2、本站所有主题由该帖子作者发表,该帖子作者与科帮网享有帖子相关版权
3、其他单位或个人使用、转载或引用本文时必须同时征得该帖子作者和科帮网的同意
4、帖子作者须承担一切因本文发表而直接或间接导致的民事或刑事法律责任
5、本帖部分内容转载自其它媒体,但并不代表本站赞同其观点和对其真实性负责
6、如本帖侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意
7、科帮网管理员和版主有权不事先通知发贴者而删除本文


JAVA爱好者①群:JAVA爱好者① JAVA爱好者②群:JAVA爱好者② JAVA爱好者③ : JAVA爱好者③

七总是个逗比

7

主题

3

听众

383

金钱

版主

该用户从未签到

沙发
发表于 2016-07-03 12:41:14 |只看该作者
解决办法:更新数据库连接 jar
回复

使用道具 举报

快速回复
您需要登录后才可以回帖 登录 | 立即注册

   

关闭

站长推荐上一条 /1 下一条

发布主题 快速回复 返回列表 联系我们 官方QQ群 科帮网手机客户端
快速回复 返回顶部 返回列表