What kind of error do you see when you try to access your Oracle-based data source
An invalid Oracle URL is specified
This error might be caused by an incorrectly specified URL on the URL property of the target data source.
Examine the URL property for the data source object in the administrative console. For the 8i OCI driver, verify that oci8 is used in the URL. For the 9i OCI driver, you can use either oci8 or oci.
"DSRA0080E: An exception was received by the data store adapter. See original exception message: ORA-00600" when connecting to or using an Oracle data source
A possible reason for this exception is that the version of the Oracle JDBC driver being used is older than the Oracle database. It is possible that more than one version of the Oracle JDBC driver is configured on the WebSphere Application Server.
Examine the version of the JDBC driver. Sometimes you can determine the version by looking at the class path to determine what directory the driver is in.
import java.sql.*; import oracle.jdbc.driver.*; class JDBCVersion { public static void main (String args[]) throws SQLException { // Load the Oracle JDBC driver DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); // Get a connection to a database Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@appaloosa:1521:app1","sys","change_on_install"); // Create Oracle DatabaseMetaData object DatabaseMetaData meta = conn.getMetaData(); // gets driver info: System.out.println("JDBC driver version is " + meta.getDriverVersion()); } }
If the driver and the database are at different versions, replace the JDBC driver with the correct version. If multiple drivers are configured, remove any that occur at the incorrect level.
DSRA8100E: Unable to get a {0} from the DataSource. Explanation: See the linkedException for more information.
When using an oracle thin driver, Oracle throws a "java.sql.SQLException: invalid arguments in call" error if no user name or password is specified when getting a connection. If you see this error while running WebSphere Application Server, the alias is not set.
To remove the exception, define the alias on the data source.
"Error while trying to retrieve text for error" error when connecting to an Oracle data source
The most likely cause of this error is that the Oracle 8i OCI driver is being used with an ORACLE_HOME property that is either not set or is set incorrectly.
To correct the error, examine the user profile that WebSphere Application Server is running under to verify that the $ORACLE_HOME environment variable is set correctly.
"java.lang.UnsatisfiedLinkError:" connecting to an Oracle data source
The environment variable LIBPATH might not be set or is set incorrectly, if your data source throws an UnsatisfiedLinkError error, and the full exception indicates that the problem is related to an Oracle module, as in the following examples.
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/WebSphere/AppServer/java/jre/bin/libocijdbc8.so: load ENOENT on shared library(s) /usr/WebSphere/AppServer/java/jre/bin/libocijdbc8.so libclntsh.a
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc9 (libocijdbc9.a or .so) in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java(Compiled Code)) at java.lang.Runtime.loadLibrary0(Runtime.java:780)
To correct the problem, examine the user profile under which the WebSphere Application Server is running to verify that the LIBPATH environment variable includes Oracle libraries. Scan for the lobocijdbc8.so file to find the right directory.
java.lang.NullPointerException referencing 8i classes, or " internal error: oracle.jdbc.oci8. OCIEnv" connecting to an Oracle data source
The problem might be that the 9i OCI driver is being used on an AIX 32-bit machine, the LIBPATH is set correctly, but the ORACLE_HOME environment variable is not set or is set incorrectly. You can encounter an exception similar to either of the following when your application attempts to connect to an Oracle data source:
Exception in thread "main" java.lang.NullPointerException at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:1743) at oracle.jdbc.oci8.OCIEnv.getEnvHandle(OCIEnv.java:69) at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:452) at oracle.jdbc.driver.OracleConnection. <init>(OracleConnection.java:287)
Exception in thread "main" java.sql.SQLException: internal error: oracle.jdbc.oci8. OCIEnv@568b1d21 at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:184) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:226) at oracle.jdbc.oci8.OCIEnv.getEnvHandle(OCIEnv.java:79)
To correct the problem, examine the user profile that WebSphere Application Server is running under to verify that it has the $ORACLE_HOME environment variable set correctly, and that the $LIBPATH includes $ORACLE_HOME/lib.
WSVR0016W: Classpath entry for the Oracle JDBC Thin Driver has an invalid variable
This error occurs when there is no environment variable defined for the property, ORACLE_JDBC_DRIVER_PATH.
Verify this problem in the administrative console. Go to Environment > Manage WebSphere Variables to verify whether the variable ORACLE_JDBC_DRIVER_PATH is defined.
To correct the problem, click New and define the variable. For example, name : ORACLE_JDBC_DRIVER_PATH , value : c:\oracle\jdbc\lib. Use a value that names the directory in your operating system that contains the ojdbc14.jar file (or the ojdbc14_g.jar file to enable Oracle trace).
Related tasks
Troubleshooting by task
Troubleshooting by component
Example: Accessing data using IBM extended APIs to share connections
between container-managed and bean-managed persistence beans
Related reference
Cannot access a data source
Problems accessing a DB2 database
Problems accessing a SQL server data source
Problems accessing a Cloudscape database
Problems accessing a Sybase data source
Extensions to data access APIs