今天在测试的时候,http访问远程应用,却报出500错误。
部署后一直是正常的,后来服务器关闭了一次,就成这样了。
所以问题的可能性集中在服务器的配置环境上,先查看中间件日志,发现如下错误:
Caused by: java.sql.SQLException:
Io 异常: The Network Adapter could not establish the
connection
这个错误很明显是连接不到数据库,于是进行了以下步骤:
1、sqlplus - 操作正常
2、查看中间件的lib文件夹
ojdbc14存在
3、进入中间件数据源配置ping数据库 报相同异常
The Network Adapter could not establish the
connection
有点懵圈了,为什么应用连不上数据库,但本地登陆数据库却没任何问题。
这时想起了数据库监听
执行lsnrctl
status
看到了以下赤裸裸的信息
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
执行lsnrctl
start
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on
20-FEB-2013 16:41:22
Copyright (c) 1991, 2005, Oracle. All rights
reserved.
Starting /oracle/product/10.2.0/db_1/bin/tnslsnr: please
wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is
/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to
/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on:
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on:
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start
Date 20-FEB-2013 16:41:24
Uptime 0 days 0 hr. 0 min. 0 sec
Trace
Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log
File /oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1
handler(s) for this service...
The command completed successfully
应用正常了,郁闷,unix下启动数据库后还必须手动启动监听吗
,悄悄记载一下。。。。