org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'sun.awt.image.MultiResolutionCachedImage@28c15eb4' with class 'sun.awt.image.MultiResolutionCachedImage' to class 'java.awt.image.BufferedImage'

freeplane | turtlecoder | 5 months ago
  1. 0

    Cannot paste images in Free plane using insert inline images

    freeplane | 5 months ago | turtlecoder
    org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'sun.awt.image.MultiResolutionCachedImage@28c15eb4' with class 'sun.awt.image.MultiResolutionCachedImage' to class 'java.awt.image.BufferedImage'
  2. 0

    [GROOVY-5410] Groovy Generics Not Playing nice with java Proxies - java.lang.ClassCastException: $Proxy374 cannot be cast to ... - ASF JIRA

    codehaus.org | 1 year ago
    org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'UploadTicketCreator@5a411614' with class 'com.sun.proxy.$Proxy19' to class 'UploadTicketCreator'
  3. 0

    When running the following sample in Groovy Console, with "allow interruption" checked: {code} @Grab('com.netflix.rxjava:rxjava-groovy:0.18.1') import groovy.transform.CompileStatic import org.junit.Test import rx.Observable @CompileStatic class Test1 { @Test void test1() { Observable.from(["mark", "perry"]).subscribe({ println("item: $it") }) } } {code} I get the following stacktrace: {code} JUnit 4 Runner, Tests: 1, Failures: 1, Time: 8 Test Failure: test1(Test1) rx.exceptions.OnErrorNotImplementedException: Cannot cast object 'Test1@4b7d52f7' with class 'Test1' to class 'java.lang.Thread' at rx.Observable$26.onError(Observable.java:6015) at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:125) at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:94) at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:109) at rx.operators.OnSubscribeFromIterable.call(OnSubscribeFromIterable.java:43) at rx.operators.OnSubscribeFromIterable.call(OnSubscribeFromIterable.java:29) at rx.Observable.subscribe(Observable.java:6302) at rx.Observable.subscribe(Observable.java:6006) at Test1.test1(ConsoleScript35:13) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runners.Suite.runChild(Suite.java:127) at org.junit.runners.Suite.runChild(Suite.java:26) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at org.junit.runner.JUnitCore.run(JUnitCore.java:138) at org.junit.runner.JUnitCore.run(JUnitCore.java:128) at org.junit.runner.JUnitCore.runClasses(JUnitCore.java:73) at sun.reflect.GeneratedMethodAccessor304.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1318) at org.codehaus.groovy.runtime.InvokerHelper.invokeStaticMethod(InvokerHelper.java:927) at org.codehaus.groovy.vmplugin.v5.JUnit4Utils.realRunJUnit4Test(JUnit4Utils.java:84) at sun.reflect.GeneratedMethodAccessor303.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1318) at org.codehaus.groovy.runtime.InvokerHelper.invokeStaticMethod(InvokerHelper.java:927) at org.codehaus.groovy.runtime.InvokerHelper.invokeStaticMethod(InvokerHelper.java:77) at groovy.lang.GroovyShell.runJUnit4Test(GroovyShell.java:378) at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:281) at groovy.lang.GroovyShell.run(GroovyShell.java:502) at groovy.lang.GroovyShell.run(GroovyShell.java:481) at groovy.lang.GroovyShell.run(GroovyShell.java:164) at groovy.lang.GroovyShell$run$1.call(Unknown Source) at groovy.ui.Console$_runScriptImpl_closure17.doCall(Console.groovy:977) at groovy.ui.Console$_runScriptImpl_closure17.doCall(Console.groovy) at sun.reflect.GeneratedMethodAccessor288.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909) at groovy.lang.Closure.call(Closure.java:423) at groovy.lang.Closure.call(Closure.java:417) at groovy.lang.Closure.run(Closure.java:504) at java.lang.Thread.run(Thread.java:745) Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'Test1@4b7d52f7' with class 'Test1' to class 'java.lang.Thread' at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.continueCastOnSAM(DefaultTypeTransformation.java:392) at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.continueCastOnNumber(DefaultTypeTransformation.java:306) at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(DefaultTypeTransformation.java:227) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.castToType(ScriptBytecodeAdapter.java:599) at Test1$_test1_closure1.doCall(ConsoleScript35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909) at groovy.lang.Closure.call(Closure.java:423) at org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:51) at org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:81) at com.sun.proxy.$Proxy16.call(Unknown Source) at rx.Observable$26.onNext(Observable.java:6020) at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:102) ... 69 more Result: org.junit.runner.Result@5e359fba {code} Which seems to be a problem with thread interruption and static compilation.

    Apache's JIRA Issue Tracker | 3 years ago | Guillaume Delcroix
    rx.exceptions.OnErrorNotImplementedException: Cannot cast object 'Test1@4b7d52f7' with class 'Test1' to class 'java.lang.Thread'
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    .GroovyCastException Exception when using GrettyStartTask

    GitHub | 3 years ago | rainoko
    org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'org.akhikhl.gretty7.ScannerManager@45b109c6' with class 'org.akhikhl.gretty7.ScannerManager' to class 'org.akhikhl.gretty.ScannerManagerBase'
  6. 0

    Why is this Groovy code trying to cast?

    Stack Overflow | 3 years ago | tinny
    org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object <details of the list, omitted> with class 'java.util.ArrayList' to class 'gameMechanics.Hand' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: gameMechanics.Hand(java.lang.String,........

  1. serious2monkeys 3 times, last 2 weeks ago
  2. Cafecanudo 1 times, last 4 months ago
  3. mortalman7 1 times, last 4 months ago
8 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.codehaus.groovy.runtime.typehandling.GroovyCastException

    Cannot cast object 'sun.awt.image.MultiResolutionCachedImage@28c15eb4' with class 'sun.awt.image.MultiResolutionCachedImage' to class 'java.awt.image.BufferedImage'

    at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.continueCastOnSAM()
  2. Groovy
    ScriptBytecodeAdapter.castToType
    1. org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.continueCastOnSAM(DefaultTypeTransformation.java:392)
    2. org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.continueCastOnNumber(DefaultTypeTransformation.java:306)
    3. org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(DefaultTypeTransformation.java:227)
    4. org.codehaus.groovy.runtime.ScriptBytecodeAdapter.castToType(ScriptBytecodeAdapter.java:599)
    4 frames
  3. Unknown
    insertInlineImage$_run_closure7_closure12_closure15_closure27.doCall
    1. insertInlineImage$_run_closure7_closure12_closure15_closure27.doCall(insertInlineImage.groovy:278)
    1 frame
  4. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:498)
    4 frames
  5. Groovy
    ConversionHandler.invoke
    1. org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    2. groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    3. org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
    4. groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    5. groovy.lang.Closure.call(Closure.java:423)
    6. org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:51)
    7. org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:81)
    7 frames
  6. com.sun.proxy
    $Proxy14.actionPerformed
    1. com.sun.proxy.$Proxy14.actionPerformed(Unknown Source)
    1 frame
  7. Java RT
    Method.invoke
    1. javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    2. javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    3. javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    4. javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    5. javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    6. java.awt.Component.processMouseEvent(Component.java:6535)
    7. javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    8. java.awt.Component.processEvent(Component.java:6300)
    9. java.awt.Container.processEvent(Container.java:2236)
    10. java.awt.Component.dispatchEventImpl(Component.java:4891)
    11. java.awt.Container.dispatchEventImpl(Container.java:2294)
    12. java.awt.Component.dispatchEvent(Component.java:4713)
    13. java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    14. java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    15. java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    16. java.awt.Container.dispatchEventImpl(Container.java:2280)
    17. java.awt.Window.dispatchEventImpl(Window.java:2750)
    18. java.awt.Component.dispatchEvent(Component.java:4713)
    19. java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    20. java.awt.EventQueue.access$500(EventQueue.java:97)
    21. java.awt.EventQueue$3.run(EventQueue.java:709)
    22. java.awt.EventQueue$3.run(EventQueue.java:703)
    23. java.security.AccessController.doPrivileged(Native Method)
    24. java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    25. java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    26. java.awt.EventQueue$4.run(EventQueue.java:731)
    27. java.awt.EventQueue$4.run(EventQueue.java:729)
    28. java.security.AccessController.doPrivileged(Native Method)
    29. java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    30. java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    31. java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    32. java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    33. java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
    34. java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:184)
    35. java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:229)
    36. java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:227)
    37. java.security.AccessController.doPrivileged(Native Method)
    38. java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:227)
    39. java.awt.Dialog.show(Dialog.java:1084)
    40. java.awt.Component.show(Component.java:1673)
    41. java.awt.Component.setVisible(Component.java:1625)
    42. java.awt.Window.setVisible(Window.java:1014)
    43. java.awt.Dialog.setVisible(Dialog.java:1005)
    44. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    45. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    46. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    47. java.lang.reflect.Method.invoke(Method.java:498)
    47 frames
  8. Groovy
    ScriptBytecodeAdapter.setProperty
    1. org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    2. groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    3. groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:2526)
    4. groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:3462)
    5. org.codehaus.groovy.runtime.InvokerHelper.setProperty(InvokerHelper.java:195)
    6. org.codehaus.groovy.runtime.ScriptBytecodeAdapter.setProperty(ScriptBytecodeAdapter.java:480)
    6 frames
  9. Unknown
    insertInlineImage.run
    1. insertInlineImage.run(insertInlineImage.groovy:660)
    1 frame
  10. org.freeplane.plugin
    ExecuteScriptAction.actionPerformed
    1. org.freeplane.plugin.script.GroovyScript.execute(GroovyScript.java:133)
    2. org.freeplane.plugin.script.ExecuteScriptAction.actionPerformed(ExecuteScriptAction.java:92)
    2 frames
  11. Java RT
    SwingUtilities.notifyAction
    1. javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1663)
    1 frame
  12. org.freeplane.core
    ActionAcceleratorManager.processKeyBinding
    1. org.freeplane.core.ui.ActionAcceleratorManager.processKeyBinding(ActionAcceleratorManager.java:402)
    1 frame
  13. org.freeplane.main
    MModeControllerFactory$2.processKeyBinding
    1. org.freeplane.main.mindmapmode.MModeControllerFactory$2.processKeyBinding(MModeControllerFactory.java:278)
    1 frame
  14. org.freeplane.view
    UserInputListenerFactory$2.processKeyBinding
    1. org.freeplane.view.swing.ui.UserInputListenerFactory$2.processKeyBinding(UserInputListenerFactory.java:117)
    1 frame
  15. org.freeplane.core
    FreeplaneMenuBar.processKeyBinding
    1. org.freeplane.core.ui.components.FreeplaneMenuBar.processKeyBinding(FreeplaneMenuBar.java:91)
    1 frame
  16. org.freeplane.main
    ConnectedToMenuView.processKeyBinding
    1. org.freeplane.main.application.MenuKeyProcessor.processKeyBinding(MenuKeyProcessor.java:26)
    2. org.freeplane.main.application.ConnectedToMenuView.processKeyBinding(ConnectedToMenuView.java:41)
    2 frames
  17. Java RT
    EventDispatchThread.run
    1. javax.swing.JComponent.processKeyBindings(JComponent.java:2943)
    2. javax.swing.JComponent.processKeyEvent(JComponent.java:2845)
    3. java.awt.Component.processEvent(Component.java:6312)
    4. java.awt.Container.processEvent(Container.java:2236)
    5. java.awt.Component.dispatchEventImpl(Component.java:4891)
    6. java.awt.Container.dispatchEventImpl(Container.java:2294)
    7. java.awt.Component.dispatchEvent(Component.java:4713)
    8. java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
    9. java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:806)
    10. java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1074)
    11. java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:945)
    12. java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:771)
    13. java.awt.Component.dispatchEventImpl(Component.java:4762)
    14. java.awt.Container.dispatchEventImpl(Container.java:2294)
    15. java.awt.Window.dispatchEventImpl(Window.java:2750)
    16. java.awt.Component.dispatchEvent(Component.java:4713)
    17. java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    18. java.awt.EventQueue.access$500(EventQueue.java:97)
    19. java.awt.EventQueue$3.run(EventQueue.java:709)
    20. java.awt.EventQueue$3.run(EventQueue.java:703)
    21. java.security.AccessController.doPrivileged(Native Method)
    22. java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    23. java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    24. java.awt.EventQueue$4.run(EventQueue.java:731)
    25. java.awt.EventQueue$4.run(EventQueue.java:729)
    26. java.security.AccessController.doPrivileged(Native Method)
    27. java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    28. java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    29. java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    30. java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    31. java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    32. java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    33. java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    34. java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    34 frames