Myeclipse开发:ORA-12505,TNS:listener does not currently know of SID given in connect descriptor.开发环境:Myeclipse 6.5,Tomcat 5.5,oracle 10g,数据库服务器在IP为192.168.10.10的机子上,用户为:username.密码是:password,数据库实例为:test.启动Tomcat时报错,错误信息如下:[main] ERROR:org.hibernate.util.JDBCExceptionReporter#logExceptions :Cannot create PoolableConnectionFactory (Listener refused the connection with the following error:ORA-12505,TNS:listener does not currently know of SID given in conne
Myeclipse开发:ORA-12505,TNS:listener does not currently know of SID given in connect descriptor.
开发环境:Myeclipse 6.5,Tomcat 5.5,oracle 10g,数据库服务器在IP为192.168.10.10的机子上,用户为:username.密码是:password,数据库实例为:test.
启动Tomcat时报错,错误信息如下:
[main] ERROR:org.hibernate.util.JDBCExceptionReporter#logExceptions :Cannot create PoolableConnectionFactory (Listener refused the connection with the following error:
ORA-12505,TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
localhost:1521:mydb
)
(16 ms) [main] WARN :org.hibernate.cfg.SettingsFactory#buildSettings :Could not obtain connection metadata
org.apache.commons.dbcp.SQLNestedException:Cannot create PoolableConnectionFactory (Listener refused the connection with the following error:
ORA-12505,TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
localhost:1521:mydb
)
我在content.xml中的配置如下:
name="orcl"
type="javax.sql.DataSource"
maxActive="20"
maxIdle="2"
username="username"
maxWait="500000"
validationQuery="select 1 from dual"
driverClassName="oracle.jdbc.driver.OracleDriver"
password="password"
url="jdbc:oracle:thin:@192.168.10.10:1521:test"/>
而且本机上也没有mydb的用户
请问是什么原因引起的?应该怎么解决?
而在另外一台机子上一样的项目文件,却没有报出这个错误……
碰到过这种问题,改listener.ora 试试是否能解决.
解决方法:
打开Oracle的 listener.ora 文件:
(我的目录 oracle/oracle/product/10.2.0/db_1/network/admin/listener.ora)
可参照参考资料: