The problem:
There is an error in org.jboss.aop.ClassAdvisor.dynamicInvoke(...) that prohibits AOP remoting from working properly when client requests contain parameters in their method calls.
Method calls without parameters work just fine.


An example:
Imagine we have the POJO (the Item class) below residing on the JBoss server. The class is instrumented via AOP to be available remotely.
public class Item{
public String someMethod(){ ... }
public String someMethod( String aParameter ){ ... }
}


On the client side, imagine we have obtained a reference to the remote object (through a proxy). The following method will work just fine:
String result = itemProxy.someMethod();
Where as this will fail with an "IllegalArgumentException: Wrong number of arguments":
String result = itemProxy.someMethod( "Hello" );


The solution:
I have located the problem to be in the ClassAdvisor.dynamicInvoke( Object target, Invocation invocation ) method.
If you insert the following line, it works perfectly:
nextInvocation.arguments = methodInvocation.arguments;


The above line should be inserted, for example, just before these lines:
nextInvocation.contextResolver = methodMetaData;
nextInvocation.classResolver = defaultMetaData;
nextInvocation.targetObject = target;
nextInvocation.method = advisedMethod;
nextInvocation.methodHash = methodInvocation.methodHash;

Shall I open a bug report on this issue? Or just let one of you add this line at your leisure?

Kind regards
Eske Sort



-------------------------------------------------------
This SF.net email is sponsored by OSDN's Audience Survey.
Help shape OSDN's sites and tell us what you think. Take this
five minute survey and you could win a $250 Gift Certificate.
http://www.wrgsurveys.com/2003/osdntech03.php?site=8
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to