-
1. Re: Using JBoss cache to replicate object between machines
ben.wang May 14, 2006 9:52 PM (in response to gshriki)Has your Node class been instrumented already, e.g., running thru aopc? Since it is Serializable, it still can be used by putObject, but PojoCache won't intercept it if it is not instrumented beforehand.
To test your enviornment, you can also run thru the examples that came with JBossCache making sure those PojoCache (aop) examples work first. -
2. Re: Using JBoss cache to replicate object between machines
gshriki May 17, 2006 9:21 AM (in response to gshriki)Hi,
First, I would like to thank you for the answer.
I'm trying to declare the object with annotation:@org.jboss.cache.aop.annotation.InstanceOfPojoCacheable public class Node implements Serializable { ...
But I still haven't figured out how can I instrument the class using the load-time method... How do I use the special class loader mentioned in the documentation?
Thanks! -
3. Re: Using JBoss cache to replicate object between machines
gshriki May 17, 2006 10:10 AM (in response to gshriki)BTW - when I'm trying to remove the implements Serializable on the Node declaration, I get:
java.lang.IllegalArgumentException: TreeCacheAop.putObject(): Object type is neither aspectized nor Serializable nor an array of primitives. Object class name is Node
Any idea why?
Gilad -
4. Re: Using JBoss cache to replicate object between machines
ben.wang May 17, 2006 9:16 PM (in response to gshriki)Yes, the IllegalArgumentException indicates that your POJO is not instrumented properly.
Under the distro example, there are examples for load-time and compile-time options. So please run it through first and I think you will get the idea. -
5. Re: Using JBoss cache to replicate object between machines
gshriki May 18, 2006 9:52 AM (in response to gshriki)Hi,
I'm trying to run the examples, distributed with the JBossCache, within Eclipse, but it looks like I'm missing something. I keep getting the following exception..."java.lang.IllegalArgumentException: TreeCacheAop.putObject(): Object type is neither aspectized nor Serializable nor an array of primitives. Object class name is examples.Student"
Anything I need to do, except from simply loading the source into the Eclipse?
Thanks!
Gilad -
6. Re: Using JBoss cache to replicate object between machines
ben.wang May 18, 2006 9:47 PM (in response to gshriki)Did you get it to run under commnad line first? If yo want to run it under Eclipse, you will need to either 1) use the aop classloader (see the ant target), or 2) use aopc first to instrument the pojo (also ant target).
-
7. Re: Using JBoss cache to replicate object between machines
gshriki May 21, 2006 6:52 AM (in response to gshriki)Hi,
OK. After running the class loader:java org.jboss.aop.hook.GenerateInstrumentedClassLoader /opt/JBC1/bin/classloader/
I've tried to run my Main class:java -Xbootclasspath/p:/opt/JBC1/bin/classloader -Djboss.aop.path=/opt/JBC1/bin/META-INF/jboss-aodp.xml Main
I got the following error:Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/aop/AspectManager at java.lang.ClassLoader.defineClass(ClassLoader.java) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
Any idea why?
BTW - I found the same problem in
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=62831&view=previous
But there's no answer.
Thanks.