You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Gerd Aschemann (JIRA)" <ji...@apache.org> on 2015/10/22 09:46:27 UTC

[jira] [Commented] (GROOVY-7613) Grape fails to load Groovy Extensions

    [ https://issues.apache.org/jira/browse/GROOVY-7613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14968724#comment-14968724 ] 

Gerd Aschemann commented on GROOVY-7613:
----------------------------------------

Ran into the same problem and yes, an exclude solves it:
{code}
@GrabExclude('org.codehaus.groovy:groovy-all')
{code}

Nevertheless I would like to see the issue solved since I would not like to care about the transitive dependencies of a used artifact. 

> Grape fails to load Groovy Extensions
> -------------------------------------
>
>                 Key: GROOVY-7613
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7613
>             Project: Groovy
>          Issue Type: Bug
>          Components: Grape
>    Affects Versions: 2.1.5, 2.4.1, 2.4.4
>         Environment: OS X 10.10.5
>            Reporter: Chris Earle
>            Assignee: Paul King
>
> https://github.com/elastic/elasticsearch-groovy/issues/29
> *The problem is that it has Groovy itself as a dependency, so using GrabExclude avoids the dependency and therefore the issue.*
> A user of mine ran into an issue while trying to use Grape to load a recent version of the elasticsearch-groovy jar. I was able to reproduce in different versions of Groovy.
> {code}
> @Grapes(
>      @Grab(group='org.elasticsearch', module='elasticsearch-groovy', version='1.7.1')
> )
> import java.lang.String
> {code}
> Literally that code when launched via:
> {code}
> $ groovy file.groovy
> Caught: BUG! exception in phase 'conversion' in source unit '/Users/pickypg/Dev/es/es-groovy/tmp/elasticsearch.groovy' # Licensed to the Apache Software Foundation (ASF) under one or more
> BUG! exception in phase 'conversion' in source unit '/Users/pickypg/Dev/es/es-groovy/tmp/elasticsearch.groovy' # Licensed to the Apache Software Foundation (ASF) under one or more
> Caused by: java.lang.ClassNotFoundException: # Licensed to the Apache Software Foundation (ASF) under one or more
> {code}
> Using this code:
> {code}
> import groovy.grape.Grape
> try {
>   Grape.grab(group: 'org.elasticsearch', module: 'elasticsearch-groovy', version: '1.7.1')
> }
> catch (Throwable t) {
>   t.printStackTrace()
> }
> {code}
> This creates a surprising stacktrace:
> {code}
> java.lang.ClassNotFoundException: # Licensed to the Apache Software Foundation (ASF) under one or more
> 	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> 	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:677)
> 	at groovy.lang.GroovyClassLoader$InnerLoader.loadClass(GroovyClassLoader.java:425)
> 	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:787)
> 	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:775)
> 	at groovy.lang.GroovyClassLoader$loadClass.call(Unknown Source)
> 	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
> 	at groovy.grape.GrapeIvy$_processRunners_closure4.doCall(GrapeIvy.groovy:340)
> 	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:497)
> 	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
> 	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
> 	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
> 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
> 	at groovy.lang.Closure.call(Closure.java:426)
> 	at groovy.lang.Closure.call(Closure.java:442)
> 	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)
> 	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)
> 	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2056)
> 	at org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source)
> 	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
> 	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
> 	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
> 	at groovy.grape.GrapeIvy.processRunners(GrapeIvy.groovy:339)
> 	at groovy.grape.GrapeIvy$processRunners$3.callCurrent(Unknown Source)
> 	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:182)
> 	at groovy.grape.GrapeIvy.processOtherServices(GrapeIvy.groovy:324)
> 	at groovy.grape.GrapeIvy$processOtherServices$2.callCurrent(Unknown Source)
> 	at groovy.grape.GrapeIvy.grab(GrapeIvy.groovy:265)
> 	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:497)
> 	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:169)
> 	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
> 	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
> 	at groovy.grape.GrapeIvy.grab(GrapeIvy.groovy:239)
> 	at groovy.grape.Grape.grab(Grape.java:151)
> 	at groovy.grape.Grape$grab.call(Unknown Source)
> 	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
> 	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
> 	at elasticsearch.run(elasticsearch.groovy:4)
> 	at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:263)
> 	at groovy.lang.GroovyShell.run(GroovyShell.java:524)
> 	at groovy.lang.GroovyShell.run(GroovyShell.java:513)
> 	at groovy.ui.GroovyMain.processOnce(GroovyMain.java:652)
> 	at groovy.ui.GroovyMain.run(GroovyMain.java:384)
> 	at groovy.ui.GroovyMain.process(GroovyMain.java:370)
> 	at groovy.ui.GroovyMain.processArgs(GroovyMain.java:129)
> 	at groovy.ui.GroovyMain.main(GroovyMain.java:109)
> 	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:497)
> 	at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:109)
> 	at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:131)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)