"java.lang.ClassCastException: com.ibm.ejs.cm.JDBC1PhaseRF" when looking up an Oracle data source and casting it as javax.sql.DataSource in WebSphere 4.0.x
 Technote (FAQ)
 
Problem
Using WebSphere Application Server 4.0.x, when doing a Java Naming and Directory Interface™ (JNDI) lookup of an Oracle® data source and casting it as javax.sql.DataSource like this:

ds =(javax.sql.DataSource)ctx.lookup("jdbc/DataSourceName");

"ClassCastException: com.ibm.ejs.cm.JDBC1PhaseRF" is thrown.
 
Cause
This problem is caused by the classes12.zip file existing in the ear file directory under WebSphere/AppServer/installedApps. The problem might also occur if any other JDBC™, SQL, or connection pooling classes (such as WebSphere's cm.jar, j2ee.jar or another JDBC driver) are included in the ear file.
 
Solution
To resolve the problem:
  1. Remove classes12.zip from the ear file and place it somewhere else in the directory structure.
  2. Ensure that the JDBC Provider definition is configured with the correct location of classes12.zip.
  3. Restart the application. The problem should no longer occur.
 
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Classloader
Operating system(s): HP-UX
Software version: 4.0
Software edition:
Reference #: 1053529
IBM Group: Software Group
Modified date: Mar 5, 2004