-
1. Re: jboss eap 6.4 oracle.sql.ARRAY cannot be cast to oracle.sql.ARRAY
andey Jun 22, 2017 5:20 AM (in response to haitun68888)1) Check if the class loaders are the same by comparing the
cs.getArray(1) classloader and
oracle.sql.ARRAY.class.getClassLoader()
If you doequals
between 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
Possible Solutions:
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.
-
2. Re: jboss eap 6.4 oracle.sql.ARRAY cannot be cast to oracle.sql.ARRAY
lafr Jun 22, 2017 3:28 PM (in response to haitun68888)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.
-
3. Re: jboss eap 6.4 oracle.sql.ARRAY cannot be cast to oracle.sql.ARRAY
haitun68888 Jun 23, 2017 5:20 AM (in response to andey)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.
-
4. Re: jboss eap 6.4 oracle.sql.ARRAY cannot be cast to oracle.sql.ARRAY
lafr Jun 23, 2017 9:43 AM (in response to haitun68888)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?
Show module.xml.
-
5. Re: jboss eap 6.4 oracle.sql.ARRAY cannot be cast to oracle.sql.ARRAY
haitun68888 Jun 25, 2017 9:50 PM (in response to lafr)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">
<properties>
<property name="jboss.api" value="unsupported"/>
</properties>
<resources>
<resource-root path="ojdbc14.jar"/>
<!-- Insert resources here -->
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="javax.servlet.api" optional="true"/>
</dependencies>
</module>