This usually occurs when you have either multiple oracle jar files (for example one in the server/lib directory and one in your EAR/WAR). Can you verify that you only have one copy of the driver?
The other reason is that you are attempting to use the DS outside of JBoss (ie remote client). Can you post your *-ds.xml file?
I verified there is no conflict in classloading the driver, I have one driver(10g) in the application lib.
This is my ds.xml, Thanks!
<!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
<!-- Checks the Oracle error codes and messages for fatal errors -->
<!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
When you say application lib, I assume you mean your deployment archive right, or do you mean in your server/lib directory? The reason I ask is that there are significant Classloader issues when attempting to include your JDBC driver inside of your EAR/WAR etc.
In the WEB-INF/LIB of the war file, the SERVER(Default)/LIB has no driver.
Yep. There's the issue.
We discourage putting the driver in the EAR/WAR/lib directory for this very reason. Unfortunately, the JDBC DriverManager, as well as most XADataSource implementations have significant classloader caching/loading issues that make inclusion of the drivers in the deployment modules difficult.
Similarly, because WAR files have their own classloading architecture, independent of the JBoss ClassLoader, you are seeing a ClassClassException. Easiest thing to do is put the JDBC jar file in your server/lib directory.
Sorry to be a pain, so far, no luck, even with the driver on the server/lib and no driver in the deployment file, same CastException. Could it be a bug in 10g driver ?
Please respond whenever you have time. Appreciated!