我的日常

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

动态微博

查看: 1453|回复: 1

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

[复制链接]

7

主题

3

听众

383

金钱

版主

该用户从未签到

跳转到指定楼层
楼主
发表于 2016-07-03 12:39:09 |只看该作者 |倒序浏览
2016-07-03 09:47:26 -3906 [main] ERROR   - init datasource error5 y6 l/ N8 p7 V
java.sql.SQLException: Could not retrieve transation read-only status server7 p# X( p; C! ^# Y* A5 w
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)/ Q* E5 B0 S; N; r& g. B
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)  v" l. I0 E9 P1 M. l
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924)- V" t/ N( t2 R& `
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870)7 j5 R) K% K1 N: z" m
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:902)
# \0 W- B  M7 N- n+ o    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:892)
4 J/ R! _6 t% K8 }+ d* C7 \3 r  A    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3607)
3 ?% Y7 \9 q, J. Z! }    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3576)
$ R4 K( _, ^# d: n    at com.alibaba.druid.filter.FilterChainImpl.connection_isReadOnly(FilterChainImpl.java:383)
/ E5 F6 y6 o( \- g  Q    at com.alibaba.druid.filter.FilterAdapter.connection_isReadOnly(FilterAdapter.java:892)
$ _. p% j. L$ O    at com.alibaba.druid.filter.FilterChainImpl.connection_isReadOnly(FilterChainImpl.java:380). R9 [7 l5 _0 h1 d# u. z3 x9 m7 Y/ T0 t
    at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.isReadOnly(ConnectionProxyImpl.java:292), j9 u' j) |6 }  }9 s/ x
    at com.alibaba.druid.pool.DruidConnectionHolder.<init>(DruidConnectionHolder.java:96)
* t, e" j1 |0 d    at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:619)
# W- I0 X$ {, k) s. z6 n* T    at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:915)4 w4 K5 n8 w1 n& C3 i% d- @, a" }$ c
    at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:911); \$ z, O* i* }, _+ \; o- s
    at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:98)
3 s9 z& D" p- Z, o1 z    at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseProductName(VendorDatabaseIdProvider.java:76); G1 a- h/ y: S' k% d* E) n
    at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseName(VendorDatabaseIdProvider.java:61)- A) x- k! g. J: S- O" c7 o
    at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseId(VendorDatabaseIdProvider.java:49)" z! I3 u' [1 e7 z5 C2 X- H/ T+ H
    at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:445)- C3 h' f6 d7 I# r
    at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:336)
5 a6 f1 ^3 }' s# x) f    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)# X; g0 e! B; _% t8 [5 S
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
  y1 t: T! I0 N+ i! C( O# c* ~4 k    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)7 M/ J8 h, s6 Z: M1 `' A
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)" ]3 w% D3 q$ l% }0 ?
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)# l7 N3 D  X$ X
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)1 l% T3 a. i% x, j
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
7 }) h! D* P: s    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)6 j! }; v6 q# I3 A8 ?
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)8 d0 v! U/ O; |0 y
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)7 x/ K4 v! ?7 p1 G1 v
    at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:646); h; O2 {" v; U4 x3 \( L9 Y1 P, c. R
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:140)  l- G! W, [( C0 e2 z
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1114)7 F% N, G* u& e0 T
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1017)
" c  c) @- G: h, Z& H    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
* A& V/ z  Y; o8 @: l0 ]: h% l    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
0 d% g# ?5 H3 m6 b) a    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
) E0 R, k- e3 p) O    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
3 n5 E8 z# j* k: G! G- \7 J    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)1 _# t3 C5 }! z1 O, o  @  M
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)4 C& j9 L" H/ d3 J& T( {6 h
    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:446)
$ o$ G( q2 g. Y9 l" c/ m    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:420)) w' [) X3 f' `7 j: j9 B
    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:545), [7 ?* q8 o" m& X$ M
    at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:155)
6 @5 [0 W# c! U! m) [    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)' _' O1 B: a( p0 T' ^
    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:305)
# Q% N0 [* l/ {1 O7 T    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)
+ ]% [+ ^0 w) V    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)2 y. f" P1 Z; r( B; S$ }5 C+ M5 x6 G
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
8 U7 C; s: h: I" M    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
1 H. f4 _" ], `    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
- p0 L5 g9 h$ c- L    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)* l' D9 G2 P( _! Y9 e8 h
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
0 ?" y, b; O3 F% v% w3 r+ `    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
6 _: [, T5 D7 [    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)0 X- h$ g; Q# U* W& Y( F5 U
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)# t( c7 e( G% g3 {; H
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)5 L8 a# J; n' x
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)  O4 |3 g& W8 S0 [' q
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)* f) h  d' N$ H7 i3 ~, p. D
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
9 _0 |- H2 ~% s3 I8 E' d    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
3 A9 ~# C7 Y, x! a. u/ B2 }3 C2 `    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
2 f+ ~5 O* ?% S' F9 l) T  Y' w    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)7 X# U, K, l* v7 L0 i
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
9 U" G2 D, d8 G+ e    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
2 L  K, _  O' o( F( w# C    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
  f& p8 r) W$ b* y; v0 x    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
; I" V7 h/ a9 G    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138). C# t: r- Y: z' ^( s; ^' m6 I& r1 b! t
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
9 j. X" E; ]$ k7 q    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117). O/ A' i( y2 P
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)  F7 q( G( @0 V  j1 S: @
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
$ l# _" Y+ Z" Q7 W6 ]6 \  b9 e* D& Z    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)9 O) m- K( w  C8 y7 z3 O+ t7 a
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)# U/ C6 X2 q) M4 n! J
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
1 S5 s; ^; e1 S) V1 G! @    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)4 l$ J. E+ _7 Z2 g* I
    at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
$ x  @! Y: ~7 |, B9 K$ X    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method): ~: r, ]' f9 l* \
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
$ @2 i! F) k& l5 }% P% y0 c    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
- k5 f* h% x9 @1 _! K    at java.lang.reflect.Method.invoke(Method.java:601)+ G6 G$ ]2 a& B5 R
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)0 f$ R, w  l6 D/ @+ {
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)8 a: S' _# F' Y4 Y6 ^1 s' l
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure) F& x2 Z( [  e7 O0 y) r8 Z
4 |4 f- [) q3 Z( T0 j
The last packet successfully received from the server was 31 milliseconds ago.  The last packet sent successfully to the server was 31 milliseconds ago.
3 D5 d* `1 X4 K8 Y( x5 t# K7 h: }    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)$ T% M9 U" v+ G  j* ^2 A
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
+ G* o# P1 i+ q- r3 o: W" ^9 q; U    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)7 V- Q: |) v7 [- v# y2 {
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)8 r6 T4 {0 f: ^- ]# @# v
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
" X3 x9 b$ ~$ {    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1036)
9 D0 p  M2 i) Y, v8 v$ b    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3427)
3 a* }4 {$ K* R; ?: |! ~' V    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3327)8 `% O4 D) j. w& G. C2 Y& q
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3814)# l& y* D# O( y) ?' {
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435)
! ~$ f6 s* X- |# b5 {+ G    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582)
" B2 q5 t+ r5 b& a    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2526): m! G1 o8 `* c& Z5 h4 Y+ U
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2484)
; t9 n2 n7 z7 f" E( W" x* v* R( [    at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1446)
4 l8 y0 S" h/ J6 D7 d0 \    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3601)& Z( i+ X/ w7 F* H6 ?; I
    ... 78 more
3 n) n" H3 e2 \) q3 {1 p) SCaused by: java.net.SocketException: Connection reset
8 V, A! N- r" q! v& `/ Z    at java.net.SocketInputStream.read(SocketInputStream.java:189)
, q* `- {% a- C, [    at java.net.SocketInputStream.read(SocketInputStream.java:121)" }3 H; \/ {* o6 a% u. L! K- m" M
    at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:100)
7 `: V  g4 t$ q& V7 T! C    at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:143)
6 q  ?4 P. ^, z+ y6 s" K6 w    at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:173)
9 j% L( Q' l. X    at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2911)
1 \0 U+ H, T( A! ^+ t    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3337)
0 x0 t+ \2 g. D, a* ], |$ {    ... 86 more8 N  H2 a, j7 a6 c; C5 Q6 N

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