Problem with xfire plugin

classic Classic list List threaded Threaded
2 messages Options
Edu
Reply | Threaded
Open this post in threaded view
|

Problem with xfire plugin

Edu
Hi! 

I write this mail because I was having a problem with the xfire plugin, I'm using version 0.8.1.

The problem... I was trying to consume a service using soapui, and it throwed a NullPointerException, I checked it out and it said it was because the name "this$dist$invoke$2" was invalid, along with others.

What I did was to add this line to my service:

static exclude = ['this$dist$set$2','this$dist$get$2','this$dist$invoke$2']

And after that everything worked, but I think it might be necessary to always ignore this methods,  I think this could be achieved in class: *org.grails.xfire.XFireGrailsAnnotations*

changing method:

    private boolean shouldBeExcluded(String methodName) {
        if(methodName.startsWith("super$")) return true;
        String excludeMethods[] = {
                "getMetaClass","setMetaClass",
                "getProperty", "setProperty",
                "invokeMethod", "isTransactional",
                "getTransactional", "setTransactional",
                "getMetaMethods", "setMetaMethods"};
        for (int i = 0; i < excludeMethods.length; i++) {
            if(methodName.equals(excludeMethods[i])) return true;
        }
        return false;
    }

to
    private boolean shouldBeExcluded(String methodName) {
        if(methodName.startsWith("super$")) return true;
        *if(methodName.startsWith("this$")) return true;*
        String excludeMethods[] = {
                "getMetaClass","setMetaClass",
                "getProperty", "setProperty",
                "invokeMethod", "isTransactional",
                "getTransactional", "setTransactional",
                "getMetaMethods", "setMetaMethods"};
        for (int i = 0; i < excludeMethods.length; i++) {
            if(methodName.equals(excludeMethods[i])) return true;
        }
        return false;
    }

I hope this helps someone who is also having problems with those methods.





Reply | Threaded
Open this post in threaded view
|

Re: Problem with xfire plugin

Chanwit Kaewkasi
Hi,

Thank you for the fix.

Chanwit

On Sun, Dec 26, 2010 at 23:22, Edu <[hidden email]> wrote:
Hi! 

I write this mail because I was having a problem with the xfire plugin, I'm using version 0.8.1.

The problem... I was trying to consume a service using soapui, and it throwed a NullPointerException, I checked it out and it said it was because the name "this$dist$invoke$2" was invalid, along with others.

What I did was to add this line to my service:

static exclude = ['this$dist$set$2','this$dist$get$2','this$dist$invoke$2']

And after that everything worked, but I think it might be necessary to always ignore this methods,  I think this could be achieved in class: *org.grails.xfire.XFireGrailsAnnotations*

changing method:

    private boolean shouldBeExcluded(String methodName) {
        if(methodName.startsWith("super$")) return true;
        String excludeMethods[] = {
                "getMetaClass","setMetaClass",
                "getProperty", "setProperty",
                "invokeMethod", "isTransactional",
                "getTransactional", "setTransactional",
                "getMetaMethods", "setMetaMethods"};
        for (int i = 0; i < excludeMethods.length; i++) {
            if(methodName.equals(excludeMethods[i])) return true;
        }
        return false;
    }

to
    private boolean shouldBeExcluded(String methodName) {
        if(methodName.startsWith("super$")) return true;
        *if(methodName.startsWith("this$")) return true;*
        String excludeMethods[] = {
                "getMetaClass","setMetaClass",
                "getProperty", "setProperty",
                "invokeMethod", "isTransactional",
                "getTransactional", "setTransactional",
                "getMetaMethods", "setMetaMethods"};
        for (int i = 0; i < excludeMethods.length; i++) {
            if(methodName.equals(excludeMethods[i])) return true;
        }
        return false;
    }

I hope this helps someone who is also having problems with those methods.








--
Dr Chanwit Kaewkasi, Lecturer    
School of Computer Engineering,  
Suranaree University of Technology
Nakhon Ratchasima, Thailand 30000