title: ClassCastException: Can't cast oracle.sql.ARRAY to oracle.sql.ARRAY in JBoss 7.1.1.Final
body: <p>DemoApp is spring integration project deployed in jboss 7.1.1.Final</p>
  
  <p>The result returned from a stored procedure contains object of oracle.sql.ARRAY (object referring ojdbc jar of jboss module)</p>
  
  <p>And I tried converting to oracle.sql.ARRAY which throwing exception </p>
  
  <p>Code:</p>
  
  <pre><code>URL resultJarLocation= resultMap.get("returnObj").getClass().getProtectionDomain().getCodeSource().getLocation();
  URL appJarLocation = oracle.sql.ARRAY.class.getProtectionDomain().getCodeSource().getLocation();
  System.out.println("resultJarLocation : " + resultJarLocation);
  System.out.println("appJarLocation : " + appJarLocation);
  
  oracle.sql.ARRAY returnObj=(oracle.sql.ARRAY)resultMap.get("returnObj");
  </code></pre>
  
  <p>EXCEPTION:</p>
  
  <pre><code>org.springframework.messaging.MessageHandlingException: java.lang.ClassCastException: oracle.sql.ARRAY  cannot be cast to oracle.sql.ARRAY
  </code></pre>
  
  <p>The application ARRAY class is referring ojdbc jar in the deployed application.
  where as result set ARRAY class referreing ojdbc jar jboss module
  Sys Output:</p>
  
  <pre><code>resultJarLocation : jar:file:/&lt;JBOSS_HOME&gt;/modules/com/oracle/ojdbc6/main/ojdbc6.jar
  appJarLocation : vfs:/&lt;JBOSS_HOME&gt;/bin/content/DemoApp.war/WEB-INF/lib/ojdbc6.jar
  </code></pre>