我是靠谱客的博主 帅气石头,最近开发中收集的这篇文章主要介绍jdbc连接oracle scan IP报错Cannot create PoolableConnectionFactory,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

现象:

Cannot create PoolableConnectionFactory (Io 异常:Connectionrefused(DESCRIPTION=(ERR=1153)(VSNNUM=186647040)(ERROR_STACK=(ERROR=(CODE=1153)(EMFI=4)(ARGS='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.4.124.245)(PORT=1521))(CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))null))'))(ERROR=(CODE=303)(EMFI=1)))))

使用的连接串为,其中10.×.×.30为oracle rac 的scan IP,改连接方式通过plsql连接没有问题,但使用jdbc却不能正常连接

SRV_SMP =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST= 10.×.×.30)(PORT = 1521))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = srv_smp3)

)

)

解决方法:

连接串修改为普通的rac vip连接方式后,问题解决

TYDB_SRV_SMP2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.4.×.45)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.4.×.44)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.4.×.43)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = srv_smp3)
)
)

原因分析:

虽然问题解决了,查找了metalink的上的资料,发现有一篇文章和这个很类似,版本完全吻合,是jdbc classpath设置问题,由于问题已经接近,方案中的方法没有验证。



Jdbc Connection Issues Having The TNS-1153 Error In The Listener Log [ID 1364680.1]

In this Document
Symptoms
Cause
Solution
________________________________________
This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.
Applies to:
JDBC - Version: 11.2.0.2 and later [Release: 11.2 and later ]
Information in this document applies to any platform.
Symptoms

On : 11.2.0.2 version, JDBC for Java

When attempting to connect from a java program using the JBC Driver 11.2.0.2,
the following error occurs.

ERROR
-----------------------
In the application side:
Exception java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(ERR=1153)(VSNNUM=186647040)(ERROR_STACK=(ERROR=(CODE=1153)(EMFI=4)(ARGS='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.201.60.115)(PORT=1521))(CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))null))'))(ERROR=(CODE=303)(EMFI=1))))
Exception java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(ERR=1153)(VSNNUM=186647040)(ERROR_STACK=(ERROR=(CODE=1153)(EMFI=4)(ARGS='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.201.60.115)(PORT=1521))(CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))null))'))(ERROR=(CODE=303)(EMFI=1))))
Exception java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(ERR=1153)(VSNNUM=186647040)(ERROR_STACK=(ERROR=(CODE=1153)(EMFI=4)(ARGS='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.201.60.115)(PORT=1521))(CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))null))'))(ERROR=(CODE=303)(EMFI=1))))


In the listener log file:
14-SEP-2011 16:25:21 * 1153
TNS-01153: Failed to process string: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.201.60.115)(PORT=1521))(CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))null))
NL-00303: syntax error in NV string

Cause

The problem was caused by the inclusion of multiple JDBC jar files in the classpath.
In this case it was included the classes12.jar and the ojdbc6.jar. These two jar files were from different version and this was causing the issue.
Solution

As the problem was caused by the inclusion of multiple JDBC jar files in the classpath.
It was taken out the classes12.jar file from the classpath and this fixed the issue.




最后

以上就是帅气石头为你收集整理的jdbc连接oracle scan IP报错Cannot create PoolableConnectionFactory的全部内容,希望文章能够帮你解决jdbc连接oracle scan IP报错Cannot create PoolableConnectionFactory所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(61)

评论列表共有 0 条评论

立即
投稿
返回
顶部