title: java.lang.ClassCastException: oracle.sql.ARRAY cannot be cast to oracle.sql.ARRAY
body: <p>I have created a stored procedure in Oracle with tabletype parameter like bellow</p>
  
  <pre><code>  create or replace PROCEDURE CREATENEWPrj
  (
            Name IN VARCHAR2,
            countryVal IN VARCHAR2,
            outingDetailsInfo IN  TBLSHIPPINGINFO
  )
  AS
   ......
    .....
  </code></pre>
  
  <p>Trying to call procedure from my java code like bellow</p>
  
  <pre><code>        Gson gson=new Gson();
  
          Type listType = new TypeToken&lt;List&lt;ShippingInfo&gt;&gt;(){}.getType();
          List&lt;ShippingInfo&gt; shippingInfo= gson.fromJson(requestObj.getString("shipping"),listType);
  
          try
          {
              call = app.databaseHelper.preparedCall("CREATENEWPrj(?,?,?)");
              call.setString(1,requestObj.getString("Name"));
              call.setString(2,requestObj.getString("countryVal"));
  
              Driver myDriver = new oracle.jdbc.driver.OracleDriver();
              DriverManager.registerDriver( myDriver );
  
              Connection conn = DriverManager.getConnection(URL, USER, PASS);
  
  
  
              STRUCT[] structs = new STRUCT[shippingInfo.size()];
              StructDescriptor structDescriptor =
                      StructDescriptor.createDescriptor("SHIPPINGINFO",conn);
  
              for (int i = 0; i &lt; shippingInfo.size(); ++i) {
  
                  ShippingInfo str =
                          shippingInfo.get(i);
                  Object[] objects = new Object[] { str.getCarrierId(),str.getRouteId()};
  
                  STRUCT struct =new STRUCT(structDescriptor, conn, objects);
                  structs[i] = struct;
              }
              ArrayDescriptor arrayDescriptor =ArrayDescriptor.createDescriptor("TBLSHIPPINGINFO",conn);
  
              ARRAY arraypass = new ARRAY(arrayDescriptor, conn, structs);
  
              call.setArray(3,  arraypass);
  
              call.execute();
      }
  </code></pre>
  
  <p>But Getting Exception <code>"java.lang.ClassCastException: oracle.sql.ARRAY cannot be cast to oracle.sql.ARRAY"</code> from `call.setArray(24,  arraypass);</p>
  
  <p>oracle.sql.ARRAY.class.getProtectionDomain().getCodeSource().getLocation()
  and 
  arraypass.getClass().getProtectionDomain().getCodeSource().getLocation()
  Both are equal</p>
  
  <p>Checked "oracle.sql.ARRAY.class.getClassLoader().equals(array_pass.getClass().getClassLo‌​ader());" ,its also returning True</p>
  
  <p>Please guide me to solve this issue.</p>