when I am moving jck 1.5 code to jdk 1.7 platorm that time I am getting ClassCastException : when I am moving jdk 1.5 code to jdk 1.7 platform that time I am getting ClassCastException here in serializerFactory code ,can anyone plese suggest the solution .


synchronized (key) { 

                if (this.firstCall()) { [enter image description here][1]
                    _call.setEncodingStyle(null); 
                    int i = 0; 
                    while (i < this.cachedSerFactories.size()) { 
                        Class df; 
                        Class sf;                       
                        Class cls = (Class)this.cachedSerClasses.get(i); 
                        QName qName = (QName)this.cachedSerQNames.get(i); 
                        Object x = this.cachedSerFactories.get(i); 
                        if (x instanceof Class) { 
                            sf = (Class) this.cachedSerFactories.get(i); 
                            df = (Class)this.cachedDeserFactories.get(i); 
                         _call.registerTypeMapping(cls, qName, sf, df, false); 
 
                        } else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) {                               
sf = (SerializerFactory)this.cachedSerFactories.get(i); 
df = (DeserializerFactory)this.cachedDeserFactories.get(i);
_call.registerTypeMapping(cls, qName, (SerializerFactory)sf,(DeserializerFactory)df, false);

                        } 
                        ++i; 
                    } 
                } 
            }


  [1]: https://i.stack.imgur.com/o0hoI.jpg