Hi,

I am using JMeter v. 2.3 to run some load tests on an Oracle 10g2 database.

However, JMeter is unable to connect using a TNSNAMES.ORA entry. JMeter
_can_ connect with this EZConnect string:

        jdbc:oracle:thin:@localhost/ORCL

but not with this one:

        jdbc:oracle:thin:@ORCL

NB the relevant TNSNAMES entry for this is pretty standard:

ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = SHARED)
      (SID = ORCL)
    )
  )

The error I get with the above example, from jmeter.log, is:

2008/02/18 15:47:55 WARN  - jmeter.protocol.jdbc.config.DataSourceElement:
Could not return Connection java.sql.SQLException: Io exception: Unknown
host specified
        at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
        at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
        at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:254)
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:386)
        at
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:438)
        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:164)
        at
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:
34)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:752)
        at java.sql.DriverManager.getConnection(DriverManager.java:525)
        at java.sql.DriverManager.getConnection(DriverManager.java:171)
        at
org.apache.avalon.excalibur.datasource.JdbcConnectionFactory.newInstance(Jdb
cConnectionFactory.java:185)
        at
org.apache.avalon.excalibur.pool.ResourceLimitingPool.newPoolable(ResourceLi
mitingPool.java:672)
        at
org.apache.avalon.excalibur.pool.ValidatedResourceLimitingPool.newPoolable(V
alidatedResourceLimitingPool.java:178)
        at
org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcConnectionPool.ne
wPoolable(ResourceLimitingJdbcConnectionPool.java:123)
        at
org.apache.avalon.excalibur.pool.ResourceLimitingPool.get(ResourceLimitingPo
ol.java:402)
        at
org.apache.avalon.excalibur.pool.ValidatedResourceLimitingPool.get(Validated
ResourceLimitingPool.java:130)
        at
org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource.getCon
nection(ResourceLimitingJdbcDataSource.java:222)
        at
org.apache.jmeter.protocol.jdbc.config.DataSourceElement$DataSourceComponent
Impl.getConnection(DataSourceElement.java:281)
        at
org.apache.jmeter.protocol.jdbc.config.DataSourceElement.getConnection(DataS
ourceElement.java:151)
        at
org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler.sample(JDBCSampler.java:
153)
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:300)
        at java.lang.Thread.run(Thread.java:595)

It seems to me that JMeter is parsing the Database URL incorrectly, assuming
that "ORCL" is the first part of a machine name. Since there's no host
called ORCL on the domain, it throws an error.  How can I configure JMeter
to accept this for what it is, i.e. a TNSNAMES entry, not part of a full
connect string?

The Oracle docs state that I should be able to use a TNSNAMES entry with the
Type 4 driver from 10.2.0.1.0 upwards. See for this:

http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/urls.htm#BEIJFH
HB

for supported database specifiers.

Here is my test configuration:

Test Plan
        -> Thread Group
                -> Counter
                -> JDBC Connection Configuration
                -> User Parameters
                -> JDBC Request
                -> Response Assertion
                -> View Results in Table

JDBC Connection Config is:
        Database URL: jdbc:oracle:thin:@ORCL
        JDBC driver class: oracle.jdbc.driver.OracleDriver
        (username and password withheld, but it's a valid schema)


Environment:
        I am running JMeter on Windows XP v. 2002 SP2, using a Sun JVM as 
follows:
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05), 
Java
HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
        My Oracle driver is the Type 4 one, Oracle JDBC Driver version -
"10.2.0.3.0",
        (I have also found the same issue with the 10.2.0.1.0 version).
        Oracle database is v. 10.2.0.1.0.

Thanks for your help.

Regards,

Simon Payne


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to