Hi Guillaume,

Guillaume Lecanu schrieb:
> Is anybody can help me about this change between 6.0rc to 6.1 please ?
> 
> 2007/5/30, Guillaume Lecanu <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>:
> [ERROR] 15858 pool-3-thread-1:( RTMPHandler.onInvoke ) Error connecting
> java.lang.ClassCastException: java.util.LinkedHashMap
[...]
> Hashtable publishers  = new Hashtable();
> app.setAttribute("publishers", publishers);
> publishers = (Hashtable)app.getAttribute("publishers");

you should always use the generic classes like "Hash" or "List" when
getting attributes from a Red5 object. The attributes are serialized
similar to how AMF0 objects are handled, so for these types, the exact
class is lost.

Thus, a better approach would be:
----- snip -----
Hashtable publishers  = new Hashtable();
app.setAttribute("publishers", publishers);
Map publishers2 = app.getMapAttribute("publishers");
Map publishers3 = (Map) app.getAttribute("publishers");
----- snap -----

Hope that helps,
  Joachim

BTW: This has been since the first version of the persistence code, so
I can't imagine how the "Hashtable" code worked before... Maps were
always loaded as "HashMap" or "LinkedHashMap".

_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to