ClassCastException very strange
Hello i make the following thinks on websphere 5.1 :
=========================================
INTERFACE
=========================================
public interface DetailCommandeInterface {
public HashMap getDetailCommandes(String[] numerosDossier);
}
=========================================
IMPLEMENTATION ( a singleton )
=========================================
public class DetailCommandeImpl implements DetailCommandeInterface
{
private static DetailCommandeImpl detailcmd;
private DetailCommandeImpl()
{
}
public static DetailCommandeImpl getInstance()
{
if (detailcmd == null)
detailcmd = new DetailCommandeImpl();
return detailcmd;
}
public HashMap getDetailCommandes(String[] numerosDossier) {
return new HashMap();
}
}
=========================================
I've got one ear.
One servlet, in one war of that ear do that on the init :
getServletContext().getContext(IExt.CTX_BOUTIQUE).setAttribute("detailCommande", DetailCommandeImpl.getInstance()) ;
A second servlet, in another war, does that :
DetailCommandeInterface interf = (DetailCommandeInterface)(getServletContext().getContext(IExt.CTX_BOUTIQUE).getAttribute("detailCommande"));
I get this error :
message: fr.laser.boutique.service.externe.impl.DetailCommandeImpl
classe: class java.lang.ClassCastException
Any ideas ?

