JDBC: Oracle Application Server and “The Network Adapter could not establish the connection” error

旧城冷巷雨未停 提交于 2019-12-06 11:01:49

I faced similar problem(able to connect through client but not web application) with Oracle XE when running with default configuration. Increasing number of sessions and processes solved my problem. Check this http://www.markcallen.com/oracle/oracle-xe-tuning.

I assume that Oracle logs failed connection attempts somewhere

It would show up in listener.log, but with the error you get, it seems doubtful that JDBC could even contact the listener.

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=abcd)(SERVER=DEDICATED)))

Is that the same string you use for the web app?

I've had issues with localhost and 127.0.0.1 which go away when using a more definitive host name or address [IE a name that other machines would know the host as.]. I think it was to do with how the name was resolved (eg locally or off to a name server or similar).

Not a java person, but is there any way to simply ping localhost/127.0.0.1 from the java and see whether there's a response.

One of the ways to fix the issueis to update Hosts file at WAS Server with entries for DB servers as shown below: 111.222.333.444 serverab.abc.com serverab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!