WebSphere 4.0.x: Test connection fails because of class not found errors
 Technote (FAQ)
 
Problem
The WebSphere Application Server 4.0.x test connection function runs as part of the administrative server. If a datasource is setup for an Application Server, this does not mean all the needed JDBC™ driver classes are present for the administrative server JVM™ to also establish a connection to the database.
 
Solution
Use the Test Connection button to test that a datasource is set up successfully. This is done from the administrative console. Because the console, and subsequently the Test Connection function, interact directly with the administrative server, it is necessary to configure the required libraries in admin.config. Use the com.ibm.ejs.sm.admiserver.classpath property to point to the specific driver libraries required to establish the connection to the application database. If the admin.config does not specify the libraries needed for the datasource test, or if the libraries specified are of an older version then the database, the Test Connection fails with an error similar to this example of the failure message:


[7/28/03 17:32:27:953 PDT] e2f206d ExceptionUtil X CNTR0020E:
Non-application exception occurred while processing method
testConnection on bean BeanId(admin#repository.jar#JDBCDriver,
1059438621277): java.rmi.ServerException: RemoteException occurred in
server thread; nested exception is:
java.rmi.RemoteException: ; nested exception is:
java.lang.UnsatisfiedLinkError: Can't find library ocijdbc9
(libocijdbc9.a or .so) in java.library.path
java.library.path=/apps/WebSphere/AppServer4.0.4/java/jre/bin:/apps/WebS
phere/AppServer4.0.4/java/jre/bin/classic:/apps/WebSphere/AppServer4.0.4
//lib/odbc/lib:/u01/db2data/db2wps1//sqllib/java12:/u01/db2data/db2wps1/
/sqllib/lib:/apps/WebSphere/AppServer4.0.4//bin:/apps/WebSphere/AppServe
r4.0.4//lib:/u01/app/oracle/product/8.1.7/lib:/u01/db2data/db2wps1/sqlli
b/lib:/usr/lib

In this example, the library ocijdbc9 was available to the Application Server, but was not included in any classpath available to the administrative server.

To correct this problem, the jar containing the ocijdbc9 driver is added to the administrative server's classpath in admin.config. Subsequently, the Test Connection button can find the proper classes needed and can successfully connect to the database.

 
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Java 2 Connectivity (J2C)
Operating system(s): HP-UX
Software version: 4.0
Software edition:
Reference #: 1117011
IBM Group: Software Group
Modified date: Jul 1, 2004