I am trying to call a stored proc having table type IN and OUT parameter using jdbc.

When I tried as a standalone program I am not having any issues. Once I deployed the code in Tomcat, the below esxception is thrown

java.lang.ClassCastException: $Proxy0 cannot be cast to oracle.jdbc.OracleConnection
at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:160)
at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:128)

on executing this line of code,

Upon analysis I found that the connection object I get here is of type,oracle.jdbc.driver.T4CConnection. But as per the code it expects a oracle.jdbc.OracleConnection.
I tried adding the ojdbc6.jar in tomcat/lib/common folder as suggested in few forums but did not help.