treecacheaop jboss deployment
seanblood Jul 6, 2005 6:35 AMHi,
TreeCacheAop seems perfect to handle distribution for our application, I'm trying to put together a demo ear deployment to JBOSS 4.0.2 with a webwork war deployment chatting to a dao thats accessing the TreeCacheAOP. I couldn't get the aspects instrumenting at loadtime went through all the docs but nothing worked. So i've settled on a compile time aspect build. Thats all fine. The problem is i deploy the ear, i put a couple of objects into the cache, it works fine on one node, i try to fire up another instance of jboss and a when i try to acess the cache on the other node I get
java.lang.IllegalArgumentException: java.io.InvalidClassException: org.jboss.cache.GlobalTransaction; local class incompatible: stream classdesc serialVersionUID = 4866921742522915574, local class se
ialVersionUID = 8011434781266976149
at org.jgroups.Message.getObject(Message.java:224)
at org.jgroups.blocks.RpcDispatcher.handle(RpcDispatcher.java:203)
I haven't been able to find an example ear deployment of TreeCacheAOP that shares a cache between 2 nodes something like that might be helpful.
I'm not even sure if i'm accessing the Cache correctly in Jboss must it be configured as an MBean service and must i be looking up the Mbea service to access the cache.
currently using the example standalone method for accessing the cache from the Dao bundled in the war deployment
TreeCacheAop cache;
String key = "/aop/person";
public PersonDao() throws Exception{
try {
cache = new TreeCacheAop();
PropertyConfigurator config = new PropertyConfigurator();
config.configure(cache, "META-INF/replSync-service.xml"); // read in generic replSync xml
cache.startService();
} catch (Exception e) {
e.printStackTrace();
}
}
public void createPerson(String name, int age)
{
Person p = new Person();
p.setName(name);
p.setAge(age);
p.setAddress(new Address());
try {
cache.putObject(key + "/" + p.getName(), p);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public void removePerson(String name)
{
try {
cache.removeObject(key + name);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
public Object getPerson(String name)
{
try {
return (Person) cache.getObject(key + "/" + name);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
I'm completely stuck any help at all would be greatly appreciated