ClassNotFoundException when accessing a WebSphere Application Server data source within an application
 Technote (FAQ)
 
Problem
When connecting to a data source from an application within WebSphere® Application Server 4.0.x, a ClassNotFoundException might be issued.

The message is:
ClassNotFoundException: com.ibm.db2.jdbc.DB2ConnectionPoolDataSource, or if the database is not DB2®, the class not found will the implementation class for the JDBC™ driver being used to connect to that database (for example, oracle.jdbc.pool.OracleConnectionPoolDataSource or com.sybase.jdbc2.jdbc.SybConnectionPoolDataSource). However, the "Test Connection" button in the administrative console will run successfully for that data source.
 
Cause
The JDBC driver implementation class is not being loaded by WebSphere.
 
Solution
If the same database is used for the administrative repository, this problem does not occur. If another database is used for the repository, the JAR or ZIP file containing the implementation class for the JDBC driver must be placed in one of two places:
  1. The WebSphere home/lib/ext directory
  2. The Dws.ext.dirs parameter in admin.config

After doing this, restart WebSphere. Now the class is loaded by WebSphere and the problem does not occur.
 
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > DB Connections/Connection Pooling
Operating system(s): HP-UX
Software version: 4.0
Software edition:
Reference #: 1066351
IBM Group: Software Group
Modified date: Aug 30, 2004