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

Groovy console fails to launch if Jar built by Maven

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.0.9, 4.0.0
    • None
    • Groovy Console
    • None
    • Ubuntu 18.04/20.04, Debian 10
      OpenJDK 11.0.13
      Groovy 3.0.9/4.0.0
      Maven 3.6.0

    Description

      The same error like in GROOVY-8253 still exists for Groovy 3(or 4) and Java 11 if Jar with main method is build by Maven.

      Use to reproduce the attached project groovy-console-test.tgz
      Execute via:

      mvn package
      java -jar ./target/my-app-1.0-SNAPSHOT.jar
      

      The exception stacktrace:

      Exception in thread "main" groovy.lang.MissingMethodException: No signature of method: javax.swing.JMenu.setMnemonic() is applicable for argument types: (String) values: [F]
      Possible solutions: setMnemonic(char), setMnemonic(int), getMnemonic()
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:72)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:78)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:82)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:194)
      	at groovy.console.ui.view.BasicMenuBar$_run_closure1.doCall(BasicMenuBar.groovy:22)
      	at groovy.console.ui.view.BasicMenuBar$_run_closure1.doCall(BasicMenuBar.groovy)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
      	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:279)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1009)
      	at groovy.lang.Closure.call(Closure.java:418)
      	at groovy.lang.Closure.call(Closure.java:412)
      	at groovy.util.FactoryBuilderSupport.dispatchNodeCall(FactoryBuilderSupport.java:892)
      	at groovy.util.FactoryBuilderSupport.doInvokeMethod(FactoryBuilderSupport.java:784)
      	at groovy.util.FactoryBuilderSupport.invokeMethod(FactoryBuilderSupport.java:503)
      	at groovy.util.FactoryInterceptorMetaClass.invokeMethod(FactoryBuilderSupport.java:1342)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:75)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:50)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:85)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
      	at groovy.console.ui.view.BasicMenuBar.run(BasicMenuBar.groovy:21)
      	at groovy.util.FactoryBuilderSupport.build(FactoryBuilderSupport.java:1174)
      	at groovy.util.FactoryBuilderSupport.build(FactoryBuilderSupport.java:1157)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
      	at groovy.lang.MetaClassImpl.doInvokeMethod(MetaClassImpl.java:1369)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1103)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1009)
      	at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:610)
      	at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:593)
      	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:405)
      	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:328)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:63)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
      	at groovy.console.ui.Console$__clinit__closure30.doCall(Console.groovy:409)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
      	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:279)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1009)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
      	at groovy.console.ui.ConsoleView$_run_closure1.doCall(ConsoleView.groovy:65)
      	at groovy.console.ui.ConsoleView$_run_closure1.doCall(ConsoleView.groovy)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
      	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:279)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1009)
      	at groovy.lang.Closure.call(Closure.java:418)
      	at groovy.lang.Closure.call(Closure.java:412)
      	at groovy.util.FactoryBuilderSupport.dispatchNodeCall(FactoryBuilderSupport.java:892)
      	at groovy.util.FactoryBuilderSupport.doInvokeMethod(FactoryBuilderSupport.java:784)
      	at groovy.util.FactoryBuilderSupport.invokeMethod(FactoryBuilderSupport.java:503)
      	at groovy.util.FactoryInterceptorMetaClass.invokeMethod(FactoryBuilderSupport.java:1342)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:75)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:50)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:194)
      	at groovy.console.ui.ConsoleView.run(ConsoleView.groovy:62)
      	at groovy.util.FactoryBuilderSupport.build(FactoryBuilderSupport.java:1174)
      	at groovy.util.FactoryBuilderSupport.build(FactoryBuilderSupport.java:1157)
      	at groovy.util.FactoryBuilderSupport$build$4.call(Unknown Source)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:46)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
      	at groovy.console.ui.Console.run(Console.groovy:440)
      	at groovy.console.ui.Console$run$0.callCurrent(Unknown Source)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:50)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
      	at groovy.console.ui.Console.run(Console.groovy:414)
      	at com.mycompany.app.App.main(App.java:11)
      

      Attachments

        1. groovy-console-test.tgz
          1 kB
          Olga Lobanova

        Issue Links

          Activity

            People

              Unassigned Unassigned
              olalob Olga Lobanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: