-
1. Re: Error on replicating cache entry
belaban Jul 15, 2004 4:26 PM (in response to mikefinn)- Do you have the relevant classes available in your EAR ?
- Can you verify that the following should work: (1) put the jboss-cache.jar in jboss-xxx/server/xxx/lib and the XML file for the cache (e.g. tree-service.xml) in server/xxx/deploy. Then deploy your EAR and run your app again. The error should disappear.
- If you want everything in your EAR, you may have to create correct dependencies, e.g. between the SAR and the JAR which contains the offending classes.
Bela -
2. Re: Error on replicating cache entry
ben.wang Jul 16, 2004 8:34 AM (in response to mikefinn)I have discovered this problem recently. If you have a "scoped" application (jar, ear, or war), that implies different context class loaders. In this case, you will need to use the jboss utility class wrapper org.jboss.invocation.MarshalledValue to wrap your serializable object first before putting it into the cache.
Here is a snippet:
MyPOJO pojo = new MyPOJO();
MarshalledValue mv = new MarshalledValue(pojo);
cache.put("/ben", mv);
Then to retrieve:
MasahlledValue mv = (MarshalledValue)cache.get("/ben");
MyPOJO pojo = (MyPOJO)mv.get();
Let me know if this doesn't work for you.
-Ben -
3. Re: Error on replicating cache entry
belaban Jul 16, 2004 8:53 AM (in response to mikefinn)This should work for now. However, I'm going to add the mechanism used by MarshalledValue to JGroups itself, so this isn't needed. This will probably be in JBoss 3.2.6, I'm going to upgrade JGroups used by JBoss soon.
Bela