1) Check if the class loaders are the same by comparing the
cs.getArray(1) classloader and
oracle.sql.ARRAY.class.getClassLoader()If you do
equalsbetween the two classloaders, it should return false as it looks that the classloaders are different.
This problem has already been reported earlier in another forum at https://forums.oracle.com/message/9330314. Moving jars around in jboss will still result in same problems.
2) Find out the source jars from where the classes are getting loaded and remove the jar that you dont need. Find the jars for the two different classes by checking
a) If you can't get classes to be loaded as you expect, Specify the library in jboss server library.
b) The last solution to force classes to be loaded from a particular jar is by specifying the jar in the bootclasspath.
Does "I created a deployment for ojdbc14.jar" means, you copied this file to the deployments folder?
Then the module name for jboss-deployment-structure.xml is "deployment.ojdbc14.jar".
Then remove ojdbc14.jar from your war file.
Thank you for your help.I have check the class loaders ,they are not equals.The ojdbc14.jar has contained in two :the WEB_INF/lib in the war file ,and in the jboss for creating module of it to create a JDBC datasource.
When i remove the jar from my application , i get a ClassNotFound exception in place of the ClassCastException.
In case of ClassNotFoundException your dependency to the module is not correct.
What's the complete path? $JBOSS_HOME/modules/com/oracle/main containing module.xml and ojdbc14.jar?
Hello,my complete pathis:$JBOSS_HOME/modules/system/layers/base/com/oracle/main/.And my module.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.oracle">
<property name="jboss.api" value="unsupported"/>
<!-- Insert resources here -->
<module name="javax.servlet.api" optional="true"/>