我的日常

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

动态微博

查看: 1444|回复: 1

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

[复制链接]

7

主题

3

听众

383

金钱

版主

该用户从未签到

跳转到指定楼层
楼主
发表于 2016-07-03 12:39:09 |只看该作者 |倒序浏览
2016-07-03 09:47:26 -3906 [main] ERROR   - init datasource error( e% Z8 G5 t3 L, \
java.sql.SQLException: Could not retrieve transation read-only status server' c% Q2 E3 s6 n$ n  ]1 G2 I6 }% r
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
4 ]1 R) O* A) y4 R    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
: b' X, X" J$ h- q. t1 z    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924)
3 E$ v2 k2 j3 p: e  @    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870)' R) M6 L& a% F5 a
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:902)
' d4 V7 ], k4 J+ B    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:892). p( D  H$ ]6 i' ?7 e, u
    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3607)7 ]1 Q0 t- Y/ r- f# d& K0 e
    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3576)
6 L- @8 E# G2 Y* Y% _, p0 K    at com.alibaba.druid.filter.FilterChainImpl.connection_isReadOnly(FilterChainImpl.java:383)
/ m8 F' r! [8 @, v    at com.alibaba.druid.filter.FilterAdapter.connection_isReadOnly(FilterAdapter.java:892)$ L2 A( N# a1 c% m
    at com.alibaba.druid.filter.FilterChainImpl.connection_isReadOnly(FilterChainImpl.java:380)
. ~4 n" `5 F% g8 ?9 |    at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.isReadOnly(ConnectionProxyImpl.java:292)& q5 R& ^5 D7 X; L# U1 M* |9 F; \
    at com.alibaba.druid.pool.DruidConnectionHolder.<init>(DruidConnectionHolder.java:96)
8 j7 j8 V5 i- X6 @! ]    at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:619)# u3 d9 X/ }. g% f2 ^
    at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:915)/ X% Q1 T5 p- w0 I. D: o5 A$ x  \
    at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:911)
. `# {9 ~, [) E3 t) X! _) v    at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:98)
' I0 I) n: j( {    at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseProductName(VendorDatabaseIdProvider.java:76)
  {' I& J0 A( |    at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseName(VendorDatabaseIdProvider.java:61)) @$ v+ Z0 R' H5 h
    at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseId(VendorDatabaseIdProvider.java:49)
9 g( @. I1 g$ O    at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:445)
9 e, r; w6 b9 @  ~/ u    at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:336)
! d" w* t8 \- p( e. k; f" ^9 l    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)0 O- t. }: |2 m! Y
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
' ?; r7 s6 `* _7 _$ _% m8 _( Z    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)+ a% Y+ _- \+ ~  e1 k5 D( {0 f
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
% M( V! |. N' P, t) V    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
! {+ ~7 ^4 g  E. U( ]    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
# A; E3 N# t  `) ^2 h+ |! q    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
6 s3 t- T- I- ?/ Q+ m1 Z    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)- `8 ?# U) @9 P1 z( }7 A
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
! K1 ], d# x7 M, d5 F8 s+ a    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
( l5 K2 i3 A3 J6 c2 B5 t    at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:646)
; n) Z7 Z/ ~% |# K  Z    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:140)
1 s$ b0 ?( J1 i2 V0 F  P- a    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1114)
2 K/ B  ~9 `3 Z; Y5 z$ D    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1017)
/ L8 o! |8 P2 [. t' I    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
- Z. @' @$ n$ a! l! ^* g" ?8 T    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)/ A' S1 s9 P3 k9 C: }! i
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)$ q2 e' R; a3 P7 \! D7 h
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
, K9 O: G4 c. }    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)8 c3 m: Z6 o4 g
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
; M; M/ B& H9 O4 N/ R3 @    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:446)
) w% m- S" A' C% b5 |    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:420)+ m. g! s1 u! i- E' z3 O
    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:545)
3 t9 P( U, }) c3 ^4 N/ K    at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:155)' C: u! u% ?1 P
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)" E( F* O# ]) h7 q, E8 u
    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:305)# u) P4 |3 `( h. v, T8 l7 @1 j
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)9 i1 }7 u' u3 d- F( _
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)# K6 I! J2 N5 c! R9 d& O6 Y
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
; C9 H# S5 W, T3 M( g2 }    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
9 i* i) r7 `& D4 }    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
; E3 |1 ?. n3 H) g! d    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
. d( ~2 B/ }; h6 P2 s4 c    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)7 u$ |7 D! O5 M4 q/ T
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
7 J# z' y( b8 {4 {% _: G    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760); {9 y: J' Y, W2 W+ i  F
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
, X% q1 q3 z* s    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
! _4 [+ |! `9 M+ c& y' l3 W. G    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
% }/ ]6 X+ @' @! I1 w' ?' m$ n5 c    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)) Q% k, O; E$ g- G  w' E
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
3 E) I6 t$ c% V4 t4 O& @    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)( {/ o" r( x) c; u
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)5 k# p5 @; K% M. U( T
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771); T7 y, K( J* y3 `
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525), J! U2 r! X6 c# ^9 \% a
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920). ^. p5 [+ W4 Z$ l7 x( q
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
3 V# o9 C3 M& T& d5 Y    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
9 T" `1 `0 s: ^2 @) C9 [: W2 E5 {    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)! `+ V" L: Y' v) I* y
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311), U+ [, Z+ i$ O$ ]) L0 F
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)2 R  a' q# m. ?
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
" B; B! i: T0 L: ]0 I    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
7 J  l- m) P0 X  @, v    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)( z; T$ }1 \. K* _. L
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)3 r2 A/ W% b9 u6 z% W) Z$ n
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
: |- V$ r- ^% }4 L6 {( R" j& d    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)- M+ z" A2 m5 _3 J7 Q; Q
    at org.apache.catalina.startup.Catalina.start(Catalina.java:566)8 j1 a4 b# V# V6 g7 r7 `+ o2 P+ ?
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- e9 n! D- h5 q- H    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)# I, n4 o9 s2 [) ]9 f2 _2 J: r
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)% f1 l; E" m% i  v! p* b
    at java.lang.reflect.Method.invoke(Method.java:601)  i- H- n" ^7 c" U
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
5 W! I& f+ n2 C- ]    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)* |& L2 i6 Z0 y' w0 ]& J
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure6 I1 [( n3 {4 h) K# `% c, i( |
7 ?$ E; @6 d$ ^% Z/ t1 M
The last packet successfully received from the server was 31 milliseconds ago.  The last packet sent successfully to the server was 31 milliseconds ago.7 H7 @6 G- d1 ?9 Q% }
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
4 x5 y4 p7 A+ {    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)" z* z# F! r3 a( n' ]0 b
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
. A8 K" J( E# n: s. H& i    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
$ e  t& X& k* v- e/ Y    at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)/ i/ U; F" t3 n
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1036)- x4 F7 o3 R# k$ t7 Z5 B( H# C
    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3427)# c% N, @7 a4 a! }- K
    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3327)' ?" }, s$ q; @/ z. h4 F- Z
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3814)
) J0 t! ^9 B  O* k0 z+ H    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435); q8 C& C  Z/ t
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582)
6 ]0 D" m1 H+ Y$ q( Y    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2526)
' S5 I  }  f0 Y0 a8 Y$ ?    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2484)
8 Y5 k, |- ]. v5 e# C& ~0 t    at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1446)8 P8 x" {4 |, w/ ~) i
    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3601)2 K7 L! N8 v; l& x0 s- q
    ... 78 more5 s% y/ w2 O0 _) m* Q' G/ l/ ~
Caused by: java.net.SocketException: Connection reset# B8 I9 L6 j5 ?/ o! H# ^0 @
    at java.net.SocketInputStream.read(SocketInputStream.java:189)+ J2 v9 ^) b9 g: e% q7 r
    at java.net.SocketInputStream.read(SocketInputStream.java:121)8 n1 B3 L+ l6 h( R
    at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:100)( ~; U; u1 V* N8 {1 x& u
    at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:143): g( ~. q7 ]& J$ e
    at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:173)9 o2 T4 \  k* h2 r6 z7 G) U( a
    at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2911)- B" v6 U& h4 W- c
    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3337)% Y( t. i( q% e& K8 W, Y, Y8 c
    ... 86 more$ [2 u4 a) {2 Z/ b: R/ H1 f

科帮网 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群 科帮网手机客户端
快速回复 返回顶部 返回列表