我的日常

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

动态微博

查看: 1443|回复: 1

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

[复制链接]

7

主题

3

听众

383

金钱

版主

该用户从未签到

跳转到指定楼层
楼主
发表于 2016-07-03 12:39:09 |只看该作者 |倒序浏览
2016-07-03 09:47:26 -3906 [main] ERROR   - init datasource error
7 {/ H* K% |! g( j- Zjava.sql.SQLException: Could not retrieve transation read-only status server' v3 [- g6 |+ D7 N( A8 h! M  {
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
( \! u  F9 i) H7 @0 i    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
: {+ p6 |7 _% d) F- o$ q5 b% F    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924)
  a- J" d7 w, A; x1 J" D# L- b    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870)
8 K) r2 v# V6 Q    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:902)$ g( L7 _/ M  H- O+ F* {; b
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:892)  P0 f' P! Z6 J  s3 G- M
    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3607); s% Z5 Q3 g/ @) v2 l
    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3576)
2 C; U: `/ \7 F; j+ x  Z6 @0 \+ S    at com.alibaba.druid.filter.FilterChainImpl.connection_isReadOnly(FilterChainImpl.java:383)- m: `" t# z3 P* D
    at com.alibaba.druid.filter.FilterAdapter.connection_isReadOnly(FilterAdapter.java:892)
! D' W( n& q& c4 |' d    at com.alibaba.druid.filter.FilterChainImpl.connection_isReadOnly(FilterChainImpl.java:380)
" ?( A& v- i# S1 G    at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.isReadOnly(ConnectionProxyImpl.java:292)+ D, v% d, |  Y
    at com.alibaba.druid.pool.DruidConnectionHolder.<init>(DruidConnectionHolder.java:96)
2 P# S. [# E5 m2 L% N7 R    at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:619)
& o* H8 }1 b+ k' s3 N    at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:915)% @! d3 w; G) i) L$ ?" ]# Z
    at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:911)
% s3 v: D+ {! l3 A- r    at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:98)
  s' d. [) k& [1 |0 z7 L1 W    at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseProductName(VendorDatabaseIdProvider.java:76)
7 t9 H) R/ A5 d" ^2 x    at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseName(VendorDatabaseIdProvider.java:61)9 V( O4 v& ^+ Z7 j0 t
    at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseId(VendorDatabaseIdProvider.java:49)
7 i  o; O4 E2 @( J* D    at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:445)
9 J8 D4 X9 h. H' `    at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:336)& C% u, ?2 L9 r& p& _# Y# ?
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)
1 a: T: ~7 t4 y# d    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
1 w& w3 d' `# H, J& d& k    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
$ a3 K2 o: W2 e5 p: W    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)5 h. b3 N( S/ x7 A9 {! Y4 N
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)0 n- h3 Z2 @5 |" h2 X# `( }/ J+ ~
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)2 t4 B: A' ^+ D, J8 k/ d8 L
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)4 D9 v3 [& D/ y- f" D
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
% f# a( a) x0 x0 h! a/ B2 _    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
7 }% n8 V) i: j- x' M    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
; u" i& W6 v' z- x5 ]( _* F- {    at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:646)( B, w, q7 B( M
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:140), F8 B# V/ L* b* ?
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1114)
" u! f2 F! U/ O& }7 p2 t    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1017)
: e; a% a$ X% I  _) z& X% m. @    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
, C) \7 _! t0 @* ?    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)2 X0 @2 Z, ?6 ?  {; R) W  a+ ]7 j
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)( w* \* t0 r6 Y1 Z7 t4 f5 A3 V
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)' y4 h7 F7 F& Y; k0 c8 _
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
4 i9 g/ D" A' z! O    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
8 ^( |1 R# }  x, ~8 W9 b0 [    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:446)# \( N; R) A5 m) t7 `' d
    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:420)4 c7 {8 @  h* W0 E6 m
    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:545)) p$ a( D6 o6 G
    at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:155)  n0 U5 g9 ~9 d0 r- a) O
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
/ Y' ~+ I# k6 k8 t    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:305)0 Q4 ~) S7 ?, m# D
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)  t  x% p7 {# ^' T$ K& ~8 j
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
2 F$ {# Y  |: B2 `% Y9 J0 w, }    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
: s6 R# B: B+ V" Y2 [' ^. {/ g8 R: Z    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
0 _7 s3 H; L  K  K6 R2 ^    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
3 V3 N9 W& M8 L$ k    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)9 n4 y, U( |+ d" H" l& i
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
! ]9 ]: Q* R$ b% `    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)/ g, V0 t. N3 _) ~. M0 t
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)# X7 |/ n/ H% I  R+ f4 Y
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
( I. I9 u! }: y' B5 O    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)+ p* i, K1 \: h" `2 c# F
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
4 }$ L0 b8 L8 {1 c% `% @% t% h+ q& }    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106): n# Q3 D1 q3 G, J9 E. V; w" y9 E
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
' U  I8 e! @6 V) B8 O, G: H: b9 G  |" m    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
' o$ M1 d% z6 g  W    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
3 b3 T3 O. r6 }# `: t, o    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)# O% U% {- L' g3 ^( ], q! n
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
; U- V- L2 _4 e9 y0 l    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)( T1 [1 d  I0 ]* e" h( _
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
( G+ v" d0 ]( {' y    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
8 g3 ?  w9 n" a7 U    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)" B5 Y/ t* W/ `0 I3 U6 j
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311). n" V/ A% R7 q5 }8 x
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
% `6 u9 W% s5 S% O, y    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)# e. d# W; R% y
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719); v8 m7 U( H% U( n9 n1 t6 J/ f% r1 o
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045): L/ M& @* D$ v: E5 E) }' `
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
+ n2 ~2 R4 d( ~5 u) ]    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
5 U, ?5 z. S9 h1 U7 n8 d& ~    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710): g6 ?% m2 m3 E6 U. z( v0 e
    at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
5 j# x7 l/ \& z1 g1 y+ t+ i    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
3 G5 W8 {9 E/ ]9 B( O7 H( l5 x    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)9 i" G& W& A, X& f: Z8 U7 F: S3 A
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
$ Y* T( `) v# g/ e2 a) p/ V    at java.lang.reflect.Method.invoke(Method.java:601)4 }, f# S7 [2 f( E# f
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
4 M3 e+ J; g& }3 _( `    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)& ?5 h5 [0 a5 w2 Q, c+ ~
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure' r& V# H  F; I! i% t
2 v6 |' ^0 f0 {$ 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.
" U8 b1 m  _, t    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
9 Y. r8 U" I* W, u$ [+ \4 L5 I' \+ s    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)6 ?4 q5 N+ B5 Y+ Q8 ~  P1 ^6 }0 h
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
: a1 O* ^- O8 f: P+ {    at java.lang.reflect.Constructor.newInstance(Constructor.java:525); g7 ^6 ?. `% ]
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)' b  e8 w" O; \9 {
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1036)
8 t( s* s3 U% G( Z" q    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3427)6 e$ C' {9 N# z
    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3327)
. F4 c4 Q2 K4 r% w6 D5 M. a, j    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3814)
# b6 R/ _( I" W; n. e! X1 S) d5 E    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435)
3 p2 G4 J6 A( |; ~    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582)% [+ C- \( a( G! S) T; k8 J8 n! F
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2526)
3 \# R' I5 N, G' |4 r7 F% N2 ^& a* @    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2484)
7 F3 v2 o: F1 i1 ]    at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1446)
- q$ @" f3 P% D, k$ v  C/ i    at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3601)
0 f' i3 N, y4 a( d% U    ... 78 more. T1 w( a0 T' }8 I5 g  _( q) \
Caused by: java.net.SocketException: Connection reset
3 i: h0 z  f% p1 R0 @! i    at java.net.SocketInputStream.read(SocketInputStream.java:189)
+ m, I# ]- g. C! e/ C, K    at java.net.SocketInputStream.read(SocketInputStream.java:121)
3 p# W( ^6 z7 w; D! p    at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:100)- c; [1 ]% _6 y2 s4 E
    at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:143)
: ]& f0 o. G7 Q  Q( `( q+ o    at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:173)
2 p; O; L5 a3 Q    at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2911)
2 [( t0 @: |3 |3 \* d/ D2 b    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3337)
. d! i: G: y) H2 p    ... 86 more
) Z2 u6 D0 c3 Y) m0 d: z

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