GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-622

Exception in thread "main" java.lang.NoSuchMethodError: generated when any .groovy compilation is attempted

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0.0Release
    • Fix Version/s: 2.1.0Release
    • Component/s: Compiler Integration
    • Labels:
      None
    • Number of attachments :
      0

      Description

      My .groovy src were executing well when suddenly everthing fails to compile.

      A simple example that I was compiling is:

      package snippets.groovy.closure.params

      class DefaultValueCall
      {
      public static void main( args)
      {
      def adder =

      { x, y=5 -> return x+y }

      assert adder(4, 3) == 7
      assert adder.call(7) == 12

      }

      }

      The console output was:

      ============================
      Exception in thread "main" java.lang.NoSuchMethodError: org.codehaus.groovy.runtime.GroovyCategorySupport.getCategoryNameUsage(Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicInteger;
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.<init>(AbstractCallSite.java:46)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.<init>(CallSiteArray.java:35)
      at snippets.groovy.closure.params.DefaultValueCall.$createCallSiteArray(DefaultValueCall.groovy)
      at snippets.groovy.closure.params.DefaultValueCall.$getCallSiteArray(DefaultValueCall.groovy)
      at snippets.groovy.closure.params.DefaultValueCall.main(DefaultValueCall.groovy)

      ============================
      The eclipse error log showed:

      ====================================
      eclipse.buildId=M20090917-0800
      java.version=1.6.0_17
      java.vendor=Sun Microsystems Inc.
      BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
      Framework arguments: -product org.eclipse.epp.package.modeling.product
      Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.modeling.product

      Error
      Wed Jan 13 17:57:48 EST 2010
      Groovy bug when compiling.

      BUG! exception in phase 'semantic analysis' in source unit '/examples.lib.xml/src-groovy/examples/lib/xml/groovy/xstream/serialization/NestedBeans.groovy' commencingResolution failed: no declaration found for class examples.xml.xstream.groovy.demos.serialization.NestedBeans
      at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:969)
      at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:579)
      at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:555)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:532)
      at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.processToPhase(GroovyCompilationUnitDeclaration.java:160)
      at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.generateCode(GroovyCompilationUnitDeclaration.java:1194)
      at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:846)
      at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:137)
      at java.lang.Thread.run(Unknown Source)
      Caused by: org.codehaus.jdt.groovy.internal.compiler.ast.GroovyEclipseBug: commencingResolution failed: no declaration found for class examples.xml.xstream.groovy.demos.serialization.NestedBeans
      at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.commencingResolution(JDTResolver.java:510)
      at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1201)
      at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:177)
      at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.startResolving(JDTResolver.java:566)
      at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:688)
      at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:960)
      ... 8 more

      ========================================

      I am using the latest Groovy from Groovy: SpringSource at http://dist.springsource.org/milestone/GRECLIPSE/e3.5/

        Activity

        Hide
        Roshan Dawrani added a comment -

        A GRECLIPSE issue?

        Show
        Roshan Dawrani added a comment - A GRECLIPSE issue?
        Hide
        blackdrag blackdrag added a comment -

        unclear if it is because of the eclipse plugin. Puzzling is me that 1.7.0 is used even tough the plugin does not support it yet. org.codehaus.jdt.groovy.internal.compiler.ast.GroovyEclipseBug shows clearly that the plugin is used for compilation. What I can take of the message is that '/examples.lib.xml/src-groovy/examples/lib/xml/groovy/xstream/serialization/NestedBeans.groovy' contains no class examples.xml.xstream.groovy.demos.serialization.NestedBeans. I can also see that path and package are not fitting each other. AFAIK the normal groovy compiler has no problem with this stuff. It will create a dummy ClassNode and later check if all those dummies have been resolved.

        Show
        blackdrag blackdrag added a comment - unclear if it is because of the eclipse plugin. Puzzling is me that 1.7.0 is used even tough the plugin does not support it yet. org.codehaus.jdt.groovy.internal.compiler.ast.GroovyEclipseBug shows clearly that the plugin is used for compilation. What I can take of the message is that '/examples.lib.xml/src-groovy/examples/lib/xml/groovy/xstream/serialization/NestedBeans.groovy' contains no class examples.xml.xstream.groovy.demos.serialization.NestedBeans. I can also see that path and package are not fitting each other. AFAIK the normal groovy compiler has no problem with this stuff. It will create a dummy ClassNode and later check if all those dummies have been resolved.
        Hide
        blackdrag blackdrag added a comment -

        I moved the bug to GRECLIPSE because it might be such a bug. If that is wrong, just mocing back to Groovy is no problem.

        Show
        blackdrag blackdrag added a comment - I moved the bug to GRECLIPSE because it might be such a bug. If that is wrong, just mocing back to Groovy is no problem.
        Hide
        Andy Clement added a comment -

        I think Roshan/Jochen are right, a groovy eclipse issue. (Oh, and the eclipse plugin does support 1.7.0 final)

        Show
        Andy Clement added a comment - I think Roshan/Jochen are right, a groovy eclipse issue. (Oh, and the eclipse plugin does support 1.7.0 final)
        Hide
        Andy Clement added a comment -

        I cannot seem to recreate this. please can you provide more info about the NestedBeans.groovy type - a quick google didn't find it for me although I assume it is a library class. As Jochen comments - does the package declaration in NestBeans.groovy actually match where it is on the disk? I'm sure that is related to this issue but it just won't fail for me.

        You also said:

        > My .groovy src were executing well when suddenly everthing fails to compile.

        And you did nothing that may have introduced the problem? Add a new library dependency? update the groovy eclipse plugin?

        Show
        Andy Clement added a comment - I cannot seem to recreate this. please can you provide more info about the NestedBeans.groovy type - a quick google didn't find it for me although I assume it is a library class. As Jochen comments - does the package declaration in NestBeans.groovy actually match where it is on the disk? I'm sure that is related to this issue but it just won't fail for me. You also said: > My .groovy src were executing well when suddenly everthing fails to compile. And you did nothing that may have introduced the problem? Add a new library dependency? update the groovy eclipse plugin?
        Hide
        Andy Clement added a comment -

        is this still a problem? Groovy-eclipse is now on groovy 1.7.2, which may address it.

        Show
        Andy Clement added a comment - is this still a problem? Groovy-eclipse is now on groovy 1.7.2, which may address it.
        Hide
        Andrew Eisenberg added a comment -

        Have not heard back from original reporter of bug and cannot be reproduced. Closing.

        Please re-open if you continue to experience the problem.

        Show
        Andrew Eisenberg added a comment - Have not heard back from original reporter of bug and cannot be reproduced. Closing. Please re-open if you continue to experience the problem.

          People

          • Assignee:
            Unassigned
            Reporter:
            St Clair S Clarke
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: