views:

449

answers:

4

Hi guys,

I am trying to run some JUnit tests that connect to an Oracle database and whether a connection attempt is made. The following error is thrown:

oracle/jdbc/driver/T2CConnection.t2cGetCharSet([CI[CI[CII[SLoracle/jdbc/driver/GetCharSetError;)S
at oracle.jdbc.driver.T2CConnection.getCharSetIds(T2CConnection.java:2801)
at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:300)
at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:344)
at oracle.jdbc.driver.T2CConnection.(T2CConnection.java:136)
at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:79)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:545)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:194)
at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:109)
at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:77)
at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:59)
at oracle.jdbc.pool.OracleConnectionCacheImpl.getNewPoolOrXAConnection(OracleConnectionCacheImpl.java:414)
at oracle.jdbc.pool.OracleConnectionCacheImpl.setMinLimit(OracleConnectionCacheImpl.java:739)

Has anyone had this error before?

I never used to get this error until recently. However, this error does not occur on a colleague's computer running the same JUnit and using the same ojbdc14.jar file. So some sort of environmental issue should be causing this.

Can you help?

A: 

Do you have the Oracle client installed? I think you are using the "oci" instead of pure java drivers which would require the client install to pick up the native shared libs.

Robin
A: 

Make sure you have -Djava.library.path=<your-oracle-home>\bin as a parameter to the runtime

cagcowboy
A: 

It seems to me that you are intending to use JDBC Type 2 driver (thick client) that require Oracle client library to be installed on your box. Or switch to thin driver if possible by simply changing the URL.

pregzt
+1  A: 

I got the same error in Webesphere environment when using oci dirver, it was due to version mismatch of jar ojdbc14.jar, jar from ORACLE_HOME/jdbc/lib and the the jar in the classpath of JDBCProvider defined in admin console were diffrent.

divi