cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
160
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: Emre Gurhan ISIK on 03-08-2009 08:47:15 AM
Hi everyone,
 
A weird thing happens in our project about writing custom java objects to session data. AFAIK, we can not read and write our custom java objects to session, application or global data unless we put those classes under Cisco\CVP\VXMLServer\common\classes folder. However, a colleague of me said that he can do such a thing. He is now using his own class to hold data in session data. After that, I've tried the same thing but when I deploy the application, it gives me casting error:
java.lang.ClassCastException: com.gt.ivr.common.entity.CardAppResEntity incompatible with com.gt.ivr.common.entity.CardAppResEntity
As you know, there is a script named updateCommonClasses in Cisco\CVP\VXMLServer\admin folder. When I run that script, my code starts to work.
When I redeploy my application, it starts to give casting error again. By the way, I am writing List of my custom java objects like List<CardAppResEntity>. And my colleague is using his object in the same manner but without any problem.
 
So I have 2 questions:
1) What does updateCommonClasses script do exactly?
2) Is it really possible to use custom classes to store data in session data without putting them under common\classes folder?
 
Thanks in advance.
 
Emre

Subject: RE: Java Objects in SessionData and UpdateCommonClasses script
Replied by: Ranjana Narayan on 07-08-2009 08:18:18 AM
Emre,
 
You asked :
 

So I have 2 questions:
1) What does updateCommonClasses script do exactly?
2) Is it really possible to use custom classes to store data in session data without putting them under common\classes folder?
 

 
1. updateCommonClasses script when executed, reloads all the classes/jar files present in <CVP_HOME>/common/, whether these classes were changed or not. It affects all the applications which use objects of the class present in this filedirectory.
2. You will have to place .class or .jar files of the sessiondata object in common/classes folder to avoid getting ClassCastException. Only placing the class/jar in the application folder is not enough.
 
Hope this helps,
Ranjana

Subject: RE: Java Objects in SessionData and UpdateCommonClasses script
Replied by: Emre Gurhan ISIK on 07-08-2009 10:48:33 AM
Hi Ranjana,
 
Thanks for your answer. But this raises another question in our head. Does using our own custom Java objects in session data generate problems in CVP reporting? I've read an email from you to my colleague about this issue.
 
Here below I attached your mail about the issue:
 
"The problem I suspected might still be applicable here. The error might not just be caused by the element previous to the 'errored' element, but also someother element in the callflow prior to reaching the 'errored element'. I not 100% sure that I can rule out this cause.
 
We have seen cases, wherein the callflow is perfect wrt activity logs but the DB(rep server) doesn't get updated because one of the elements in the callflow tried to update elementdata/sessiondata with an unknown datatype object. Though there might not be errors listed in the logs, the db update fails. Request you to please run through your custom elements, to see if you are setting any session/elementdata that is not of primitive type String. As you know the DB (rep server) updates are primarily String columned data.
 
What I see from your explanation is that  callflows through Audio_PaymentTypeH has DB errors but not when it flows thru Audio_PaymentTypeK. Is  Audio_PaymentTypeH a custom element? then my guess is this might have some set session/elementdata of non-strings. Please check and confirm.
Regarding Decision_PaymentType element, you check the sessiondata again to make decision, can you verify that the sessiondata that was used here is a valid object when it has been set earlier sometime in the callflow."

Subject: RE: Java Objects in SessionData and UpdateCommonClasses script
Replied by: Emre Gurhan ISIK on 09-08-2009 02:24:43 PM
Hi,
 
I want to add some other issues I found through my trials.
 
If we create a common class and add it under common\classes folder, we can use it in our application without getting any ClassCastExceptions. However, it affects CVP reports because when I trace a call in CVP Reporitng Database I see that the exitstate column of VXMLElement table remains null for each element which starts just from writing that custom java object to session data.
In our application we create a context object and store it in global data with a key of call unique id. So each call has its own context object in global data. In this context object we have a hasmap in which we can set or get java objects. To solve the reporting problem I've explained above, I change my decision element codes to write our custom objects to context (and so global data) and not to decision data. Surprisingly, by doing this our reporting problem resolves. It is weird beause we are still using our custom java object but the only difference is we don't write it directly to session data. Instead, we add it to an hashmap which is created in another custom java object (context) of us and which is stored in global data.
 
Another thing about using custom java objects:
I deleted an object class under common\classes and tried my application. It seems ok in decision elements. I mean we can set and get it from session data from DecisionData. But when we reach to an dynamic configuration class, we get error. It seems that, we can not use it from ElementAPI.
 
For the two cases I've explained above, do you have any comments?
 
Thanks in advance.
 
Emre

Subject: RE: Java Objects in SessionData and UpdateCommonClasses script
Replied by: Ranjana Narayan on 10-08-2009 08:41:09 AM
Emre,
 
When developing CVP application on callstudio, and deploying the same on the VXML server, custom java objects which are to be stored in the session/elementdata has to be placed in common/lib folder to overcome the ClassCastException, and this is a known issue and a workaround for the same.

How java objects in sessiondata affects the CVP Reporting DB, is only my guess. CVP reporting server has multiple tables capturing the callflow details of the application. Few such tables that interests us are the VXMlSessionVariable which stores the sessiondata variables name/value pair and the VXMLElementDetails which stores the elementdata. I belive this is where the conflict arise, since the table definition has the columns as String datatype, while the custom java object is of unknown datatype. It might be during this that the updates in the DB fail.

I am no expert in CVP Reporting Database (as this has nothing to do with CVP API), though this is where I suspected that your earlier problem with null values in the DB were caused by setting unknown datatypes into sessiondata.

You mention that updating your application to write the custom objects into a hashmap stored in globaldata instead of sessiondata did the trick, which makes me believe that my above understanding might still stand.

Hope this helps,
Ranjana.

Subject: Re: New Message from Ranjana Narayan in Customer Voice Portal (CVP) - Gener
Replied by: Janine Graves on 10-08-2009 05:27:16 PM
I don't think Global Data is sent to the Reporting Server, is it? So,
you could probably store it as any Java Object if it's in Global (or
Application) data.



Cisco Developer Community Forums wrote:
> Ranjana Narayan has created a new message in the forum "General
> Discussion - All Versions":
>
> --------------------------------------------------------------
> Emre,
> Â
> When developing CVP application on callstudio, and deploying the same
> on the VXML server, custom java objects which are to be stored in the
> session/elementdata has to be placed in common/lib folder to overcome
> the ClassCastException, and this is a known issue and a workaround for
> the same.
>
> How java objects in sessiondata affects the CVP Reporting DB, is only
> my guess. CVP reporting server has multiple tables capturing the
> callflow details of the application. Few such tables that interests us
> are the VXMlSessionVariable which stores the sessiondata variables
> name/value pair and the VXMLElementDetails which stores the
> elementdata. I belive this is where the conflict arise, since the
> table definition has the columns as String datatype, while the custom
> java object is of unknown datatype. It might be during this that the
> updates in the DB fail.
>
> I am no expert in CVP Reporting Database (as this has nothing to do
> with CVP API), though this is where I suspected that your earlier
> problem with null values in the DB were caused by setting unknown
> datatypes into sessiondata.
>
> You mention that updating your application to write the custom objects
> into a hashmap stored in globaldata instead of sessiondata did the
> trick, which makes me believe that my above understanding might still
> stand.
>
> Hope this helps,
> Ranjana.
> --
> To respond to this post, please click the following link:
>
> <http://developer.cisco.com/web/cvp/forums/-/message_boards/message/1537318>
>
> or simply reply to this email.
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links