Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1867

java.lang.ClassCastException: gjdk.org.codehaus.groovy.tools.RootLoader_GroovyReflector

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.1-beta-1
    • 1.1-beta-2
    • None
    • None
    • Linux, Fedora

    Description

      given the file betabug.groovy:

      def rloader = new javax.xml.namespace.QName("","").getClass().getClassLoader()
      java.lang.Package[] pkgs = rloader.getPackages()

      running the following shell script

      export JAVA_HOME=/home/nate/java/jdk1.6.0
      export GROOVY_HOME=/home/nate/java/groovy/groovy-1.1-BETA-1
      export CLASSPATH=/home/nate/java/groovy/groovy-1.1-BETA-1/lib/groovy-1.1-BETA-1.jar

      PATH=$PATH:$GROOVY_HOME/bin

      /home/nate/java/groovy/groovy-1.1-BETA-1/bin/groovy -d /home/nate/CVSROOT/indivo-script/betabug.groovy

      get the following exception:

      Caught: java.lang.ClassCastException: gjdk.org.codehaus.groovy.tools.RootLoader_GroovyReflector cannot be cast to org.codehaus.groovy.runtime.Reflector
      java.lang.ClassCastException: gjdk.org.codehaus.groovy.tools.RootLoader_GroovyReflector cannot be cast to org.codehaus.groovy.runtime.Reflector
      at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.loadReflector(MetaClassRegistryImpl.java:281)
      at groovy.lang.MetaClassImpl.generateReflector(MetaClassImpl.java:2143)
      at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:2025)
      at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:142)
      at org.codehaus.groovy.runtime.Invoker.invokePojoMethod(Invoker.java:132)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:106)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:111)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:187)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(ScriptBytecodeAdapter.java:211)
      at betabug.run(betabug.groovy:2)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:71)
      at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:694)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:616)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:506)
      at org.codehaus.groovy.runtime.Invoker.invokePogoMethod(Invoker.java:144)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:110)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:111)
      at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.java:406)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:71)
      at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:694)
      at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:721)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:100)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:111)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:187)
      at betabug.main(betabug.groovy)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:71)
      at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:694)
      at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:721)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:100)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:111)
      at groovy.lang.GroovyShell.runMainOrTestOrRunnable(GroovyShell.java:270)
      at groovy.lang.GroovyShell.run(GroovyShell.java:244)
      at groovy.lang.GroovyShell.run(GroovyShell.java:173)
      at groovy.ui.GroovyMain.processOnce(GroovyMain.java:484)
      at groovy.ui.GroovyMain.run(GroovyMain.java:294)
      at groovy.ui.GroovyMain.process(GroovyMain.java:280)
      at groovy.ui.GroovyMain.processArgs(GroovyMain.java:140)
      at groovy.ui.GroovyMain.main(GroovyMain.java:121)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:131)
      at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:160)

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            natefin Nathan Finstein
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: