ORA-12154: Connecting from JSP to Oracle 8.1.6 ???
Posted on 2001-09-17
I hope someone can help me with the following problem:
As I faced some problems connecting from Weblogic Server to Oracle 8i, using connection pool (please
check question of 7th September, still waiting for answer that solves the problem), I have tried to connect directly from a Java Server Page on Webserver to Oracle 8i, without any pool connection.
I got the following error message:
...java.sql.SQLException: Error while trying to retrieve text for error ORA-12154 ...
ORA-12154 has the following contents:
ORA-12154, 00000, "TNS:could not resolve service name"
// *Cause: The service name specified is not defined correctly in the TNSNAMES.ORA file.
// *Action: Make the following checks and correct the error:
- Verify that a TNSNAMES.ORA file exists and is in the proper place and accessible. See the operating system specific manual for details on the required name and location.
- Check to see that the service name exists in one of the TNSNAMES.ORA files and add it if necessary.
- Make sure there are no syntax errors...
I have checked all three points without result;
I have some doubt about the location of TNSNAMES.ORA that at the moment is the default location.
JDBC is configured properly, and any other Java application that connects to Oracle 8i is working
All the software is on a single machine, and the platform is LINUX.
TNSNAMES.ORA for the Oracle 8i server is:
# TNSNAMES.ORA Configuration #File:/usr/oracle/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
(SID = PLSExtProc)
(PRESENTATION = RO)
(ADDRESS = (PROTOCOL = TCP)(HOST = linux)
(PORT = 1521))
(SID = oralin)
(SERVICE_NAME = oralin.localhost)
(SRVR = SHARED)
The settings for TNSNAMES.ORA for the client are basically the same.
I got the same error messages, setting HOST to localhost (127.0.0.1).
Tnsping oralin.localhost works.
That's all! I would be very pleased in receiving
a solution in detail.
Thanks in advance.