GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-664

XMLRPCServerProxy module not working (problem: Duplicate Groovy Libraries on classpath)

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0Release
    • Fix Version/s: 2.0.1Release
    • Component/s: None
    • Labels:
      None
    • Environment:
      Ubuntu Linux, Java 6, Eclipse 3.5, XML-RPC module 0.7 from mvn repo
    • Number of attachments :
      0

      Description

      The XMLRPCServerProxy seems not to be working. Whenever one tries to call any remote method, it fails with a MissingPropertyException.

      However, if I try to call serverProxy.invokeMethod directly, it works.

      So, the following fails:

      def server = new XMLRPCServerProxy('http://localhost:8069/xmlrpc/common')
      def uid = server.login('terp', 'admin', 'admin')

      while the following works:

      def server = new XMLRPCServerProxy('http://localhost:8069/xmlrpc/common')
      def uid = server.invokeMethod('login', ['terp', 'admin', 'admin'])

        Activity

        Hide
        Cloves Almeida added a comment -

        I've found that in org.codehaus.groovy.runtime.callsite.CallSiteArray:145, even though XMLRPCServerProxy implements the GroovyObject interface, the "receiver instanceof GroovyObject" evaluation returns false! That's beyond my understanding!

        Show
        Cloves Almeida added a comment - I've found that in org.codehaus.groovy.runtime.callsite.CallSiteArray:145, even though XMLRPCServerProxy implements the GroovyObject interface, the "receiver instanceof GroovyObject" evaluation returns false! That's beyond my understanding!
        Hide
        Cloves Almeida added a comment -

        Hum... Found out that it only happens inside Eclipse, with Eclipse Groovy Plugin libs as GROOVY_HOME (v2.0.0 here). If I use the downloaded libs, it works as expected.

        Pretty weird, but not critical.

        Sorry for the false alarm.

        Show
        Cloves Almeida added a comment - Hum... Found out that it only happens inside Eclipse, with Eclipse Groovy Plugin libs as GROOVY_HOME (v2.0.0 here). If I use the downloaded libs, it works as expected. Pretty weird, but not critical. Sorry for the false alarm.
        Hide
        Roshan Dawrani added a comment -

        Since it is happening only within eclipse and not otherwise, how about moving the issue to greclipse project and have someone look into it?

        Show
        Roshan Dawrani added a comment - Since it is happening only within eclipse and not otherwise, how about moving the issue to greclipse project and have someone look into it?
        Hide
        blackdrag blackdrag added a comment -

        Cloves if "foo instanceof GroovyObject" fails even though foo is such an instance then this is clearly a case of class duplication. A class is defined by name and class laoder. So it is perfectly possible to have two different GroovyObject. The GroovyObject this test was made against is from the runtime, since the class the test is in, is part of the runtime. But I suspect the foo coming from outside and being loaded by a different Groovy runtime, which of course then has a different GroovyObject. Most probably one is included in eclipse and the other one is provide by yourself

        Show
        blackdrag blackdrag added a comment - Cloves if "foo instanceof GroovyObject" fails even though foo is such an instance then this is clearly a case of class duplication. A class is defined by name and class laoder. So it is perfectly possible to have two different GroovyObject. The GroovyObject this test was made against is from the runtime, since the class the test is in, is part of the runtime. But I suspect the foo coming from outside and being loaded by a different Groovy runtime, which of course then has a different GroovyObject. Most probably one is included in eclipse and the other one is provide by yourself
        Hide
        Cloves Almeida added a comment - - edited

        I've suspected this was the case. It's a conflict between the Groovy Plugin libs and the Groovy libs provided by the Maven Plugin. Removing the Groovy Eclipse provided libs from the classpath (it also need to be removed from the "Run as Script" Configuration) solves the issue. The "Run as Groovy Script" action, by default, setup a groovy.home system properties that probably bootstrap Groovy from a different classloader than the one used to run the script.

        Maybe a warning about such in the Groovy Eclipse Plugin documentation should be made to help others troubleshoot this hard to debug behavior. Classloading issues are always a PITA.

        Show
        Cloves Almeida added a comment - - edited I've suspected this was the case. It's a conflict between the Groovy Plugin libs and the Groovy libs provided by the Maven Plugin. Removing the Groovy Eclipse provided libs from the classpath (it also need to be removed from the "Run as Script" Configuration) solves the issue. The "Run as Groovy Script" action, by default, setup a groovy.home system properties that probably bootstrap Groovy from a different classloader than the one used to run the script. Maybe a warning about such in the Groovy Eclipse Plugin documentation should be made to help others troubleshoot this hard to debug behavior. Classloading issues are always a PITA.
        Hide
        Andrew Eisenberg added a comment -

        In the next week or so, I will be releasing m2eclipse integration with Groovy-Eclipse that will solve the problem you are describing.

        Also, an entry in the FAQ would be useful. I'll keep this bug open until I get a chance to update the FAQ.

        Show
        Andrew Eisenberg added a comment - In the next week or so, I will be releasing m2eclipse integration with Groovy-Eclipse that will solve the problem you are describing. Also, an entry in the FAQ would be useful. I'll keep this bug open until I get a chance to update the FAQ.
        Show
        Andrew Eisenberg added a comment - Done. FAQ is updated: http://docs.codehaus.org/display/GROOVY/Eclipse+Plugin+2.0.0+FAQ#EclipsePlugin2.0.0FAQ-Q.IamgettingaMissingPropertyExceptionwhenrunninginsideofEclipse%2CbutnotwhenIrunoutside.Whatgives%3F Also, changed title to reflect the real problem.

          People

          • Assignee:
            Andrew Eisenberg
            Reporter:
            Cloves Almeida
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: