Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003
    Location
    The Netherlands
    Posts
    2

    Unanswered: ORA-12154: TNS:could not resolve service name

    I'm running the following on the same Solaris 8 machine (same user):

    Oracle 9i (9.0.1.4) database client
    Oracle 9iAS (9.0.3 - J2EE & Web Cache)

    and I am having difficulty in setting up the environment correctly. I have created an OC4J data source (type II driver) and get the following error when I attempt to use it to access my database:

    SQLException java.sql.SQLException: ORA-12154: TNS:could not resolve service name
    :fwcsPooledDS

    How should I set up my environment to make both Oracle products happy? The 9iAS Containers for J2EE Services Guide suggested that I would need to do the following:

    * install the Oracle Client on the same machine on which OC4J is installed
    * set the ORACLE_HOME variable
    * set LD_LIBRARY_PATH (or the equivalent environment variable for your OS) to $ORACLE_HOME/lib
    * set TNS_ADMIN to a valid Oracle administration directory with a valid tnsnames.ora file

    I followed these steps (setting ORACLE_HOME to point to the app server and TNS_ADMIN to point to the database client's network/admin directory). I have read conflicting reports about whether ORACLE_HOME should be set at all on a system with multiple Oracle products installed.

    Can anyone advise me where I am going wrong? I don't want to give up on this and use the thin driver...

  2. #2
    Join Date
    Aug 2003
    Posts
    3
    ORA-12154 basically means that the alias you have used to connect to your database is not correct.
    Check if the alias used is defined in the tnsnames.ora file. Also, check if SQLNET.ORA file on TNS_ADMIN directory contains NAMES.DEFAULT_DOMAIN parameter defined. If so, try to comment that out.

  3. #3
    Join Date
    Aug 2003
    Location
    The Netherlands
    Posts
    2
    The interesting thing is that I'm making the connection through the data source and fwcsPooledDS is not the SID - it relates to the data source, which is as follows:

    class="com.evermind.sql.DriverManagerDataSource" location="jdbc/fwcsCoreDS"
    pooled-location="jdbc/fwcsPooledDS"
    password="csuser"
    min-connections="10"
    username="csuser"
    url="jdbc:oracle:oci8:@hermione"
    xa-location="jdbc/xa/fwcsXADS"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    schema="database-schemas/oracle.xml"
    max-connections="100"
    name="fwcs"
    ejb-location="jdbc/fwcsDS"

  4. #4
    Join Date
    Aug 2003
    Posts
    3
    Your connection is setup to using the "hermione" alias. Is this the correct alias defined in the tnsnames.ora ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •