I have written a custom RequestWrapper to add cookies in to the request
@Override
public Cookie[] getCookies()
{
Cookie c=new Cookie("iPlanetDirectoryPro", "macleanpinto");
Cookie c1=new Cookie("iPlanetDirectoryPro1", "macleanpinto1");
Collection<Cookie> result = new ArrayList<Cookie>(2);
result.add(c);
result.add(c1);
return (Cookie[]) result.toArray();
}
The above code at Return throws java.lang.ClassCastException. I am not able to be figure out why it does. Since i have created collection of cookies and i am trying return array list of cookies.
Thanks