3 Replies Latest reply on Nov 9, 2009 12:13 PM by peterj

    JBOSS 4.3 EAP NOT PICKING UP TNSNAMES.ORA

    scubie999

      Hi All

      I have installed a Solaris Intel Server with JBOSS 4.3 EAP and Oracle 10.2.0.1 client (64 bit).

      I can do a tnsping and sqlplus to the database with no problem, however, when I start JBOSS it gives me an error:

      10:22:38,335 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
      org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: ORA-12154: TNS:could not resolve the connect identifier specified
      )

      If I change the oci connect descriptor to include the full description from the tnsnames.ora file, the system starts up. If I use the thin connection it also works.

      I have also checked permissions of the $ORACLE_HOME/network/admin, the user has rights to it.

      i.e.:

      This does not work:
      <connection-url>jdbc:oracle:oci:@ORCL</connection-url>

      despite sqlplus user/pass@ORCL working, so does tnsping ORCL.

      This does work:
      <connection-url>jdbc:oracle:oci:@(description=(address=(host=hostname)(protocol=tcp)(port=1521))(connect_data=(sid=ORCL)))</connection-url>


      Any advice will be appreciated.

      Thank you

      Carlo

        • 1. Re: JBOSS 4.3 EAP NOT PICKING UP TNSNAMES.ORA
          peterj

          JBoss AS simply passes the connection URL to the JDBC driver - it is the driver that makes the database connection. Does the Oracle JDBC driver you are using support the "jdbc:oracle:oci:@ORCL" connection URL?

          • 2. Re: JBOSS 4.3 EAP NOT PICKING UP TNSNAMES.ORA
            scubie999

            Hi Peter

            Yes, oci has been installed.

            The following connect descriptor:

            <connection-url>jdbc:oracle:oci:@(description=(address=(host=hostname)(protocol=tcp)(port=1521))(connect_data=(sid=ORCL)))</connection-url>

            also works.

            This seems to me to be a matter of the location of the tnsnames.ora file. It is as if JBOSS expects it elsewhere...? Other than the normal $ORACLE_HOME/network/admin

            Carlo

            • 3. Re: JBOSS 4.3 EAP NOT PICKING UP TNSNAMES.ORA
              peterj

              It has nothing to do with JBoss AS. It is the JDBC driver that makes the connection. Can the driver find the necessary files? How do you tell the driver where to look to find those files? All of that should be in the documentation for the Oracle JDBC driver you are using.