本文介绍了JDBC:Oracle应用服务器和“网络适配器无法建立连接”错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到错误:网络适配器无法与Oracle应用服务器10g中部署的Web应用程序建立连接。数据库是本地的,所以不应该有任何连接问题。

I am getting the error: "The Network Adapter could not establish the connection" from a web application deployed in Oracle Application Server 10g. The database is local, so there shouldn't be any connection issues.

第一个测试:我可以连接到数据库没有问题来自SQL plus,运行查询等。
第二次测试:我可以从服务器上本地安装的JDeveloper连接数据库没问题,并运行查询等没问题。这适用于简短的JDBC scring和长的scring(如下所示)。

First test: I can connect to the DB no problem from SQL plus, run queries, etc.Second test: I can connect to the database no problem from a locally installed JDeveloper on the server, and run queries, etc. no problem. This works with the short JDBC scring, and the long one (shown below).

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

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

然而当我运行网络应用程序,它给出了上述错误。对我来说似乎太通用了。

Yet when I run the web app, it gives the above error. It seems too generic for me to do anything about.

有关如何解决此问题的任何建议?我假设Oracle在某处记录了失败的连接尝试,但我在数据库alert.log文件中找不到任何相关内容。

Any suggestions on how to solve this? I assume that Oracle logs failed connection attempts somewhere, but I couldn't find anything relevant in the databases alert.log file.

问题可能是应用程序使用旧的jsdk,但我会假设然后会出现一些版本不匹配错误而不是网络连接消息。

It is possible that the problem is that the application is using an old jsdk, but I would assume that then some version mismatch error would be given instead of a "network connection" message.

编辑:我不知道知道这是OAS问题还是特定Web应用程序的问题,我想首先想出来,因为它看起来应该很容易。在WebSphere中,有一个测试连接按钮来指定您添加的目标数据源,但似乎OAS10中没有这样的功能?不知怎的,我认为必须有,我只是错过了,因为我不是OAS专家。

I don't know whether this is an OAS problem or a problem with the specific Web Application, I would like to figure this out first, as it seems it should be easy. In WebSphere, there is a "test connection" button to dest data-sources you have added, but it seems there is no such functionality in OAS10? Somehow I think there must be, and I am just missing it because I am not an OAS expert.

编辑2:我在远程机器上安装了JDevelop并连接到没有问题的数据库,所以我确定这不是数据库连接本身的问题 - 看起来它必须是OAS中的问题?

Edit 2: I installed JDevelop on a remote machine and connected to the database with no problems, so I know for sure it isn't an issue with the database connectivity itself - it seems like it must be a problem within OAS?

推荐答案

在使用默认配置运行时,我遇到了类似的问题(能够通过客户端而不是Web应用程序连接)与Oracle XE。越来越多的会话和流程解决了我的问题。请查看。

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.

这篇关于JDBC:Oracle应用服务器和“网络适配器无法建立连接”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 06:46