This document was generated from CDN thread
Created by: Frank Uzzolino on 28-10-2008 06:49:00 PM
Hello,
I have class defined that stores information about the call. It is a custom, independent (i.e. non-Audium) class. From an element that extends DecisionElementBase, I can put an instance of that object into the session (.setSessionData()), and from another element that also extends DecisionElementBase, I can successfully retrieve that object from the session (.getSessionData()).
Now, when I'm inside a dynamic configuration class (VoiceElementInterface), I can call data.getSessionData(...), but cannot cast it back to the real class.
Let's say the class is com.mycompany.MyClass.
Breaking down the code into pieces, I have:
Object o = data.getSessionData("myData");
// A test here shows 'o' is NOT null
// This println prints 'com.mycompany.MyClass'
System.out.println(o.getClass().getName());
// This line throws a ClassCastException.
MyClass mc = (MyClass) o;
MyClass does extend Object.
Is there any reason why the above code works fine in custom elements, but not in a dynamic configuration class?
Thanks,
-Frank
Subject: Re: Using Complex Objects from Session in Dynamic Configurations
Replied by: Matt K. on 30-10-2008 06:33:06 PM
You need to run updateApp script after running updateCommonClasses script, if your jar or class files are shared across all applications. If this resolves your issue, it means Cisco has yet to fix this bug.
Regards,
Matt