Take the 2-minute tour ×

I've try to expose to the client(gwt) an aspectJ method through gwt-rpc, but the gwt client can't find the method defined in an aspect. The class that i expose implements IsSerializable and only it's method are visible to the client interface...the method added by their aspect contrariwise no. How i can fix this? thanks in advice.

p.s. i post a little example for more clarity:

this is the class...

public class Example implements IsSerializable{

   private String name;

   public setName(String name){

and this is the aspect...

privileged aspect Example_x{

   public int Example.getVersion() {
      return this.version;

The Example.getVersion() method is unavailable on the client side.


share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

This won't work, as GWT needs access to the source of any Java class that is exposed to the client side. This is necessary to compile them from Java to Javascript. If you modify your classes using AspectJ, the added methods will not be visible to the GWT compiler and therefore not to the client.

I'd say AspectJ is simply the wrong tool for this task. If you want to add some methods to existing classes you could write a (possibly generic) container class that contains an instance of Example as well as the version information from Example_x.

share|improve this answer
add comment

Your Answer


