我的日常

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

动态微博

查看: 1480|回复: 1

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

[复制链接]

7

主题

3

听众

383

金钱

版主

该用户从未签到

跳转到指定楼层
楼主
发表于 2016-07-03 12:39:09 |只看该作者 |倒序浏览
2016-07-03 09:47:26 -3906 [main] ERROR   - init datasource error
. w- h; p# m0 m& g: zjava.sql.SQLException: Could not retrieve transation read-only status server- E. o1 L4 {/ }8 _3 l
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
9 W' A# r. Q3 ]3 }; M3 o. `    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)- V. d3 |0 N/ f9 ^. R
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924)4 ^  F9 t- Y: B4 r% Y3 b
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870)
) V& s6 u% P* u' y    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:902)5 H, S$ x4 N0 G
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:892)
1 ^6 R% s* d/ K! A    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3607)$ ?. z) j& ~7 v  e2 R: t
    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3576)
" H$ r+ P/ x/ }9 H' V, C4 U: d    at com.alibaba.druid.filter.FilterChainImpl.connection_isReadOnly(FilterChainImpl.java:383): ~# {- h0 P) p* y1 I; i. Y
    at com.alibaba.druid.filter.FilterAdapter.connection_isReadOnly(FilterAdapter.java:892)$ L7 _! v* a2 j: c# B( k
    at com.alibaba.druid.filter.FilterChainImpl.connection_isReadOnly(FilterChainImpl.java:380)6 r! l( y) V( ?+ e4 @$ Q
    at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.isReadOnly(ConnectionProxyImpl.java:292)9 z% l! h  h% l6 h  J
    at com.alibaba.druid.pool.DruidConnectionHolder.<init>(DruidConnectionHolder.java:96)
- T/ K* D, M4 [7 E+ O( U7 Q    at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:619)
0 u5 y2 w8 w. p. A0 {    at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:915): I2 U  V' _7 N' Z3 I
    at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:911)
. `- F5 j! {7 L    at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:98)" P! }+ \1 |' i0 r3 k
    at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseProductName(VendorDatabaseIdProvider.java:76)" _1 d8 o( I+ Z! V
    at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseName(VendorDatabaseIdProvider.java:61). D+ Z/ H% g& s$ d6 |
    at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseId(VendorDatabaseIdProvider.java:49)) j" e; c4 U; |% L2 l
    at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:445)
1 Q9 q% j% R" h4 D) m    at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:336)  f' j2 a' x5 G, ]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)
/ z/ s/ p  `3 N* I5 d0 f    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
/ l7 K& H' o8 K: m    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
* K0 y3 q0 q, Y    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
( K% K& v7 [- ~    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)0 w+ Y3 @0 P9 v6 v' q
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
. @4 c$ i& l. G    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
. C3 w* X% ~$ T8 `/ u3 b    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)+ b* c' S2 J4 J: ]! a# Q
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)% B4 Y8 A. O# ]: O* p
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
. _% r) D3 _, D9 k# ^    at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:646)1 L5 r: ^6 Y7 X
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:140)
* b. m# z7 w, J, `. I4 {9 O% T2 x7 s    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1114)
# b' G% l& O/ b/ l8 E) n    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1017)
5 m; e7 S7 m* k5 P8 C    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
+ y9 p9 L6 L$ e, Y6 {5 p, v    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)6 x- J: C/ n5 f& |* E# v
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
1 Q. p+ t7 m) \- C7 a' Q, m    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
5 R1 t0 C* B( C    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)7 }/ G5 \- G; x8 I: n7 o+ G
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
' I7 k2 e, z1 G    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:446)
& O0 [, Q* u1 m% [% z- N" [    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:420)3 O6 D" e  A+ {) h; b
    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:545)
1 R' r3 s2 g5 T9 L    at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:155)
6 M! g$ [* p: [3 U# S  m    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87): g# r6 J& n2 c8 D
    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:305)
5 y4 e9 P1 f- ^+ z    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)8 E& R& g4 D9 r( U5 _% _) [
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
9 ?% s* S6 J9 E; |7 l4 d% m    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
( ]8 L9 R4 R6 @  s. W/ @* Z" y    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)3 ?2 L1 a2 G" A) b1 `# j' i
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
9 K8 C# x" R% N/ K4 x/ G$ T    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)% t3 N* T" p8 {+ G; _# D+ }, x$ ~
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)4 O9 r0 D' [( q% r) U5 x
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
/ I5 x9 R: R2 y6 [* g! U' V    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
& _6 ?# j' u8 M    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
9 R* j0 L/ m* L, [    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403); b1 g3 R+ V8 G- e1 c
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)5 x0 i7 g2 \. t8 z
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)! ?3 Y* O2 i1 D& K9 ^) ]0 V
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
2 a' N+ R, F, e; B' n8 a2 A# m0 p    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
) K2 |8 i6 F3 C0 y" _' h. U0 I    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)8 I* S! a" f# V; F6 e; D
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)9 n) k+ d2 t; c% y9 `) v
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
; I( I& Y% v+ ?9 `/ O. ^% n    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
$ a& e* e, X. O    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
! t  B9 t' [  }7 M' d8 A    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)) R  J. s6 h+ a: z
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
/ J: P& b) C% _# [) v/ B( A    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)/ j1 ^+ h5 ]# Y! w1 ~  h
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
3 z$ ~9 t: Y3 M$ F" M& K' R$ _    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
8 b% D) }7 X; w2 e( t- F* m& i+ b    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
9 `4 i& q( T- `6 s    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)& ~4 S% ^8 J7 m% n. ?' t3 W
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)# ]3 x/ G3 x# o7 i
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)2 H) h6 U( K% h& T/ B
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)7 t- N4 n* f4 _! {; P" A& T
    at org.apache.catalina.startup.Catalina.start(Catalina.java:566)" g3 D3 r! @% B5 h  }9 e
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
5 H* q4 w) _/ H' K( l7 E1 u0 L# q    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
5 N. ^* s, A: a# P3 G    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
, m8 v! L7 N8 G& M7 Z3 d. K( b6 b    at java.lang.reflect.Method.invoke(Method.java:601)
2 F# a" Q) X/ J4 E  x# S7 Q( Q    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)& ^( P* Q% f! D3 H- b! ]. Q7 Z
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)" x) P. t; L9 B
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure4 v! a5 s8 F( Y( w5 R
1 V. q5 M1 r& e, k
The last packet successfully received from the server was 31 milliseconds ago.  The last packet sent successfully to the server was 31 milliseconds ago.
/ @! J/ R* l7 |8 b    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)' K) k  S; v  O* A; g/ A5 g
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
1 G# F' ^6 L. O4 W) b, g    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
! D  C: y3 P' J3 s    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)' R4 w8 k' ]7 K% n; d) Y4 f1 x
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
& Y5 C1 h( v8 k( j/ G0 L2 A    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1036)
8 B9 J8 |; f* H7 R    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3427)
  X/ u5 ~5 a, |& v' g    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3327)
3 K. V# s* M" P. n2 L    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3814)
' J: p( g" @0 i/ @; n! {- E    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435)
( m4 o! G$ Q% }2 L    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582)& _& x9 |1 B8 V" P/ @2 @, M; g
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2526)
2 Y2 ?' B2 [4 R4 R5 R: t8 I    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2484)( f* A: h$ x" ]( J* n; W
    at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1446)) d) I2 G9 H( `6 N9 m- l, J
    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3601): Q  ]' V8 b# o: b
    ... 78 more
# p9 V$ L: C9 A& W' o3 FCaused by: java.net.SocketException: Connection reset0 a6 |! w# b; A
    at java.net.SocketInputStream.read(SocketInputStream.java:189)1 z) h2 Q8 u/ B
    at java.net.SocketInputStream.read(SocketInputStream.java:121)% J- S& E0 k& n" M2 c' `; x8 `
    at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:100)5 ?2 B( T- J5 F  Y7 H( {+ S7 }
    at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:143), h9 r6 ?' b; j' A4 O
    at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:173)6 V9 x7 @- b+ L- x* K0 y
    at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2911)/ X$ D6 c2 e: V8 |# e; I+ I' ^
    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3337)
6 c+ ?- O! F, \5 w) l; u    ... 86 more, o$ [( G  }+ N" i

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