i am implementing caching solution in ibm integration bus
using java
inside the message flows and the logic is implemented like the following :
I built the base
class
:Deparment
:public class Department implements Serializable { // the members with setters and getters }
I built a
Wrapper class
that defines anArrayList<Department>
public class CachedDepartment implements Serializable { private ArrayList departments; // with setters and getters .... }
I created class that implements the
cache
solution toset
newvalue
and toget
thevalue
to set
:
MbGlobalMap globalMap = MbGlobalMap.getGlobalMap(globalMapName);
globalMap.put(key, value);
to get
:
CachedDepartment cacheddept = null;
MbGlobalMap globalMap = MbGlobalMap.getGlobalMap(globalMapName);
cacheddept = (CachedDepartment) globalMap.get(key);
i created
jar
file and put it onclassLoader
directory and its run when settingcache
, the problem is when running the get functionality.java.lang.ClassCastException: cache.entities.CachedDepartment incompatible with cache.entities.CachedDepartment
I read this link ClassCastException when casting to the same class but still i don't know how to solve it in IBM Integration bus
that run on JDK 1.7
any ideas ???