Home Spring boot project with Oracle DB sometime get IO Connection timeout
Reply: 0

Spring boot project with Oracle DB sometime get IO Connection timeout

user1507
1#
user1507 Published in April 25, 2018, 6:13 pm

I deploy an app with Spring Boot + JPA and use Oracle DB for store data. Sometimes I got this error in log after using the app for a while.

SQL Error: 17002, SQLState: 08006 - IO Error: Connection timed out

Config properties

server.port = 8095
# ===============================
# = DATA SOURCE
# ===============================
# Set here configurations for the database connection
spring.datasource.url=jdbc:oracle:thin:@//localhost:1521/xe
spring.datasource.username=root
spring.datasource.password=root
# Keep the connection alive if idle for a long time (needed in production)
spring.datasource.testWhileIdle=true
spring.datasource.validationQuery=SELECT 1
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver

If I add autoReconnect=true to datasource url I got error when start app.

SQL Error: 12514, SQLState: 08006
oracle.net.ns.NetException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor

at oracle.net.ns.NSProtocolStream.negotiateConnection(NSProtocolStream.java:272)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:263)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1360)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:486)
... 46 common frames omitted

Does anyone know the issue root cause and how to fix it? Thanks.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.306845 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO