1
votes

JBoss EAP 6.4 standalone server

Application deployed as a war file throws a runtime exception

java.lang.ClassCastException: oracle.sql.ARRAY cannot be cast to oracle.sql.ARRAY

at line

ARRAY a = (ARRAY) cs.getArray(1);

JDBC libary included is ojdbc14.jar (WEB_INF/lib). All libraries are included in the war file and there are no "global" libaries setup on the server. I have verified no other jdbc libraries are included anywhere in the app.

In order to create a JDBC datasource, i created a deployment for ojdbc14.jar. This is the only possible source of conflict i can think of. When i remove the ojdbc14.jar from the war file, i get a ClassNotFound exception in place of the ClassCastException.

Every other part of the app works fine except this line. How do i debug this any further?

I have try something ,but not work:

(1)add a jboss-deployment-structure.xml into web-inf/.

<?xml version="1.0" encoding="UTF-8"?> 
<jboss-deployment-structure> 
<deployment> 
<dependencies> 
<module name="com.oracle" slot="main"/> 
</dependencies> 
</deployment> 
</jboss-deployment-structure>

not work and the war dont write the log too.

1

1 Answers

0
votes

This error occurs when you have two copies of the class packaged.

Based on your description, one copy is in the deployment for the Oracle driver. The second copy is in the application.

Remove it from application and instead of deploying oracle jar in deployment directory, create module of it.