jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • groovy
  • GROOVY-2399

Groovy does not run on IBM JRE6

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.5
  • Fix Version/s: 1.5.1
  • Component/s: None
  • Labels:
    None

Description

I tried to deploy a grails app on a tomcat running on the IBM JRE 6 which can be downloaded from here http://www-128.ibm.com/developerworks/java/jdk/linux/download.html

I instantly receive the following error. Any way to work around this issue?

java.lang.ClassCastException: java.lang.reflect.Method incompatible with java.lang.Comparable
at java.util.Arrays.binarySearch(Unknown Source)
at java.util.Arrays.binarySearch(Unknown Source)
at org.codehaus.groovy.reflection.CachedMethod.find(CachedMethod.java:59)
at groovy.lang.MetaClassImpl.applyPropertyDescriptors(MetaClassImpl.java:1759)
at groovy.lang.MetaClassImpl.setupProperties(MetaClassImpl.java:1529)
at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:2418)
at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:2398)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:99)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:63)
at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:27)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:198)
... 21 more

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    Groovy-2399.patch
    17/Dec/07 4:46 PM
    1 kB
    Danno Ferrin

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Paul King added a comment - 15/Dec/07 4:25 AM

Do you get the same error with even a trivial Groovy hello world example or only with Grails?

Show
Paul King added a comment - 15/Dec/07 4:25 AM Do you get the same error with even a trivial Groovy hello world example or only with Grails?
Hide
Permalink
johan1 added a comment - 15/Dec/07 5:39 AM

The same happens when I try to run the groovy console for example:

t343r:/opt/groovy-1.5.0/bin# ./groovyConsole
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:612)
at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:101)
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)
Caused by: java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.initialize(J9VMInternals.java:220)
at org.codehaus.groovy.runtime.Invoker.<init>(Invoker.java:38)
at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:44)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:198)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:472)
at groovy.ui.Console.main(Console.groovy:117)
... 6 more
Caused by: java.lang.ClassCastException: java.lang.reflect.Method incompatible with java.lang.Comparable
at java.util.Arrays.binarySearch(Unknown Source)
at java.util.Arrays.binarySearch(Unknown Source)
at org.codehaus.groovy.reflection.CachedMethod.find(CachedMethod.java:59)
at groovy.lang.MetaClassImpl.applyPropertyDescriptors(MetaClassImpl.java:1759)
at groovy.lang.MetaClassImpl.setupProperties(MetaClassImpl.java:1529)
at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:2418)
at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:2398)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:99)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:63)
at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:27)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:198)
... 12 more

Show
johan1 added a comment - 15/Dec/07 5:39 AM The same happens when I try to run the groovy console for example: t343r:/opt/groovy-1.5.0/bin# ./groovyConsole java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:612) at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:101) at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130) Caused by: java.lang.ExceptionInInitializerError at java.lang.J9VMInternals.initialize(J9VMInternals.java:220) at org.codehaus.groovy.runtime.Invoker.<init>(Invoker.java:38) at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:44) at java.lang.J9VMInternals.initializeImpl(Native Method) at java.lang.J9VMInternals.initialize(J9VMInternals.java:198) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:472) at groovy.ui.Console.main(Console.groovy:117) ... 6 more Caused by: java.lang.ClassCastException: java.lang.reflect.Method incompatible with java.lang.Comparable at java.util.Arrays.binarySearch(Unknown Source) at java.util.Arrays.binarySearch(Unknown Source) at org.codehaus.groovy.reflection.CachedMethod.find(CachedMethod.java:59) at groovy.lang.MetaClassImpl.applyPropertyDescriptors(MetaClassImpl.java:1759) at groovy.lang.MetaClassImpl.setupProperties(MetaClassImpl.java:1529) at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:2418) at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:2398) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:99) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:63) at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:27) at java.lang.J9VMInternals.initializeImpl(Native Method) at java.lang.J9VMInternals.initialize(J9VMInternals.java:198) ... 12 more
Hide
Permalink
Danno Ferrin added a comment - 17/Dec/07 4:42 PM

This appears to hinge on the following throws clause in Arrays.binarySearch(Object[] array, Object key)...

ClassCastException - if the search key in not comparable to the elements of the array.

Does this require for all i :

array[i].compareTo(key)
or for all i :
key.compareTo(array[i])
? It looks like Sun is calling the former, and IBM the latter. Since the key is a Method, it doesn't implement Comparable (whereas CachedMethod does). I think it may mean both, as the comparison must be commutative. Hence the IBM JDK is not in error in throwing the exception in my opinion.

My patch may cause a performance hit, but that may be eliminated by some cut and paste.

Show
Danno Ferrin added a comment - 17/Dec/07 4:42 PM This appears to hinge on the following throws clause in Arrays.binarySearch(Object[] array, Object key)... ClassCastException - if the search key in not comparable to the elements of the array. Does this require for all i :
array[i].compareTo(key)
or for all i :
key.compareTo(array[i])
? It looks like Sun is calling the former, and IBM the latter. Since the key is a Method, it doesn't implement Comparable (whereas CachedMethod does). I think it may mean both, as the comparison must be commutative. Hence the IBM JDK is not in error in throwing the exception in my opinion. My patch may cause a performance hit, but that may be eliminated by some cut and paste.
Hide
Permalink
Danno Ferrin added a comment - 17/Dec/07 4:46 PM

I may apply this tonight if I get time. First I need to boot into linux and verify it fixes the IBM JDK problem. IBM's JRE is not broadly availble for Windows.

Show
Danno Ferrin added a comment - 17/Dec/07 4:46 PM I may apply this tonight if I get time. First I need to boot into linux and verify it fixes the IBM JDK problem. IBM's JRE is not broadly availble for Windows.
Hide
Permalink
Danno Ferrin added a comment - 17/Dec/07 11:13 PM

My patch did the trick. Alex, since it's your optimization feel free to re-do if you don't like my solution.

Show
Danno Ferrin added a comment - 17/Dec/07 11:13 PM My patch did the trick. Alex, since it's your optimization feel free to re-do if you don't like my solution.

People

  • Assignee:
    Alex Tkachman
    Reporter:
    johan1
Vote (0)
Watch (0)

Dates

  • Created:
    14/Dec/07 7:36 PM
    Updated:
    23/Dec/07 12:25 PM
    Resolved:
    17/Dec/07 11:13 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.