Hi Ben,
To sort out my problems I've gone back to a simple example. I'm still using the
server/client framework, but am now using the Person / Student / Address class
examples that come with the "standAloneAop" directory to populate my Server's cache
with.
I'm using the aop compiler to compile the classes using the following lines in the
jboss-aop.xml file:
prepare expr="all(Student)"
prepare expr="all(Person)"
prepare expr="all(Address)"
(xml code around the lines has been omitted)
My server and client compile and run without any problems. My client replicates the
servers cache upon startup successfully.
However, when I add a constructor to the "Student" class (which is derived from the
"Person" class) and this constructor declares a parameter (theCourse), as below:
public class Student extends Person
{
private String year;
public String getYear() { return year; }
public void setYear(String year) { this.year = year; }
public Student(String theCourse)
{
}
....
}
my Client does not replicate the Server's cache upon startup. This is the same
behaviour I saw with my own classes in the first posting.
The logging at the client side for a getObject() followed by a query (getName() and
getAddress()) on the successful replication looks something like:
102172 [main] TRACE org.jboss.cache.aop.TreeCacheAop - calling method _get
102172 [main] DEBUG org.jboss.cache.aop.TreeCacheAop - get(, "/a/b/obj1", AOPInstance,
"false")
102172 [main] TRACE org.jboss.cache.aop.TreeCacheAop - calling method _get
102172 [main] DEBUG org.jboss.cache.aop.TreeCacheAop - get(, "/a/b/obj1", AOPInstance,
"false")
102172 [main] TRACE org.jboss.cache.aop.TreeCacheAop - calling method _get
102172 [main] DEBUG org.jboss.cache.aop.TreeCacheAop - get(, "/a/b/obj1", name, "true")
102172 [main] TRACE org.jboss.cache.aop.TreeCacheAop - calling method _get
102172 [main] DEBUG org.jboss.cache.aop.TreeCacheAop - get(, "/a/b/obj1", AOPInstance,
"false")
102172 [main] TRACE org.jboss.cache.aop.TreeCacheAop - calling method _get
102172 [main] DEBUG org.jboss.cache.aop.TreeCacheAop - get(, "/a/b/obj1", name, "true")
whereas when the constructor has a parameter, the logging for the getObject() and
queries appears as:
12250 [main] TRACE org.jboss.cache.aop.TreeCacheAop - calling method _get
12250 [main] DEBUG org.jboss.cache.aop.TreeCacheAop - get(, "/a/b/obj1", AOPInstance,
"false")
12264 [main] TRACE org.jboss.cache.aop.TreeCacheAop - calling method _get
12265 [main] DEBUG org.jboss.cache.aop.TreeCacheAop - get(, "/a/b/obj1",
jboss:internal:class, "false")
and an Exception is throw as a result of the getObject() call.
Why is having a parameter in the constructor a problem?
Is this a limitation with AOP or have I missed something (in my jboss-aop.xml file or
somewhere else). Note that having a constructor without the parameter works fine, even
with data members in the constructor body being initialised to some value.
Many thanks for your help,
Regards
Ken
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3848398#3848398
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3848398
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development