groovy
  1. groovy
  2. GROOVY-4854

MyEnum.values() bombs out on AppEngine

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.8.0
    • Fix Version/s: 1.8.1, 1.9-beta-1
    • Component/s: None
    • Labels:
      None
    • Environment:
      AppEngine Java 1.5
    • Number of attachments :
      0

      Description

      Calling MyEnum.values() works great on the AppEngine local development server, but once this code runs in production you get:

      java.lang.IllegalAccessException: Reflection is not allowed on protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException
      	at com.google.appengine.runtime.Request.process-d87840548eba2c93(Request.java)
      	at java.lang.reflect.Method.invoke(Method.java:43)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1055)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:885)
      	at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:44)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
      	at MyEnum.values(Environment.groovy)
      	at MyEnum$values.call(Unknown Source)
      

        Activity

        Hide
        Axel Fontaine added a comment -

        Enum.valueOf(type, value) also fails catastrophically with

        java.lang.IllegalArgumentException: MyEnum is not an enum type
        at java.lang.Class.enumConstantDirectory(Class.java:2982)
        at java.lang.Enum.valueOf(Enum.java:209)

        Again, this only happens on the AppEngine production system.

        Show
        Axel Fontaine added a comment - Enum.valueOf(type, value) also fails catastrophically with java.lang.IllegalArgumentException: MyEnum is not an enum type at java.lang.Class.enumConstantDirectory(Class.java:2982) at java.lang.Enum.valueOf(Enum.java:209) Again, this only happens on the AppEngine production system.
        Hide
        blackdrag blackdrag added a comment -

        I guess that means, that if we do the clone, then we should do that by using a direct method call instead. If we don't use clone, then this is a AppEngine problem

        Show
        blackdrag blackdrag added a comment - I guess that means, that if we do the clone, then we should do that by using a direct method call instead. If we don't use clone, then this is a AppEngine problem
        Hide
        Axel Fontaine added a comment -

        Moving the enum to src/main/java works, so it is a Groovy issue.

        Show
        Axel Fontaine added a comment - Moving the enum to src/main/java works, so it is a Groovy issue.

          People

          • Assignee:
            Guillaume Laforge
            Reporter:
            Axel Fontaine
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: