Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0m2
    • Fix Version/s: 2.0.0RC1
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      In the following code:

      package pack2;
      
      def sub = new GroovySubClass()
      print sub.val()
      
      class GroovySubClass extends GroovyClass {
      	
      	public int val() {
      		return 0;
      	}
      }
      

      In file 2:

      package pack2;
      
      class GroovyClass { }
      

      I run as a script and I get the following exception:

      Caught: java.lang.LinkageError: loader constraints violated when linking groovy/lang/MetaClass class
      	at pack2.ScriptTesting.class$(ScriptTesting.groovy)
      	at pack2.ScriptTesting.$get$$class$pack2$GroovySubClass(ScriptTesting.groovy)
      	at pack2.ScriptTesting.run(ScriptTesting.groovy:5)
      

      This works fine when run as a Groovy or Java App. I wonder if I need to add the project onto the classpath.

        Activity

        Hide
        Andrew Eisenberg added a comment -

        Interestingly, when I delete the .class files from the bin directory corresponding to all groovy files being used in the execution of the program (but class files from Java files must remain), the program can run.

        So, class files coming from groovy files (excepting the target script, which seems to be ignored) must be excluded from the execution.

        How to make this happen? Any way around that?

        Show
        Andrew Eisenberg added a comment - Interestingly, when I delete the .class files from the bin directory corresponding to all groovy files being used in the execution of the program (but class files from Java files must remain), the program can run. So, class files coming from groovy files (excepting the target script, which seems to be ignored) must be excluded from the execution. How to make this happen? Any way around that?
        Hide
        Andrew Eisenberg added a comment -

        I think the fix to GRECLIPSE-560 will also fix this problem.

        Show
        Andrew Eisenberg added a comment - I think the fix to GRECLIPSE-560 will also fix this problem.
        Hide
        Andrew Eisenberg added a comment -

        Fixed.

        Show
        Andrew Eisenberg added a comment - Fixed.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: