You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by russellr <Ru...@auspost.com.au> on 2017/05/16 02:55:26 UTC
Version Hell
I have a vast quantity of tests for a website which worked fine until I
upgrade angularjs. Now they work intermittently.
The particular problem is with Geb's isDisplayed function.
If I upgrade Geb, then I have to upgrade Groovy. I either get
StackOverflowError or ShortTypeHandling errors.
Here are the relevant versions that *used* to work:
<cucumber-jvm.version>1.1.5</cucumber-jvm.version>
<gherkin.version>2.12.2</gherkin.version>
<groovy.version>2.1.6</groovy.version>
<geb.version>0.9.2</geb.version>
<selenium.version>2.38.0</selenium.version>
If I upgrade Geb to 1.1.1, I get:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError:
org/codehaus/groovy/runtime/typehandling/ShortTypeHandling
If I *then* upgrade Groovy to 2.4.11 or later I get:
java.lang.StackOverflowError
at java.lang.ThreadLocal.get(ThreadLocal.java:143)
at
java.util.concurrent.locks.ReentrantReadWriteLock$Sync.tryReleaseShared(ReentrantReadWriteLock.java:426)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.releaseShared(AbstractQueuedSynchronizer.java:1340)
at
java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.unlock(ReentrantReadWriteLock.java:883)
at
groovy.lang.ExpandoMetaClass.checkInitalised(ExpandoMetaClass.java:837)
The StackOverflowError appears to be triggered by a simple "Given":
Given(~'I am on the reference page for (.+)') { String path ->
}
I've removed the body to confirm that it's actuall just the Given that's
causing the problem.
Where to now?
--
View this message in context: http://groovy.329449.n5.nabble.com/Version-Hell-tp5741010.html
Sent from the Groovy Users mailing list archive at Nabble.com.
Re: Version Hell
Posted by russellr <Ru...@auspost.com.au>.
Thanks for your reply.
It turns out my original problem was actually a bug in my angular code (a
race condition), so the tests were actually picking up that problem.
I'm back to using the original versions for now.
However, I would like to upgrade the versions, if possible, in any case.
Version 2.4.7 still produces the StackOverflowError.
Here's a longer stack trace from version 2.4.7 (the complete one goes on for
1000's of lines, so I think it must be an infinite recursion process that's
going on):
java.lang.StackOverflowError
at
org.codehaus.groovy.runtime.MetaClassHelper.getClassWithNullAndWrapper(MetaClassHelper.java:870)
at
org.codehaus.groovy.runtime.MetaClassHelper.sameClasses(MetaClassHelper.java:862)
at
groovy.lang.MetaClassImpl.getNormalMethodWithCaching(MetaClassImpl.java:1369)
at
groovy.lang.MetaClassImpl.getMethodWithCaching(MetaClassImpl.java:1292)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1062)
at
groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1125)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812)
at
org.codehaus.groovy.runtime.metaclass.OwnedMetaClass.invokeMethod(OwnedMetaClass.java:100)
at geb.Browser.invokeMethod(Browser.groovy)
at
org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:48)
at
org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.callCurrent(PogoInterceptableSite.java:58)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
at geb.Browser.getPage(Browser.groovy:90)
at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at
org.codehaus.groovy.runtime.metaclass.MixinInstanceMetaMethod.invoke(MixinInstanceMetaMethod.java:56)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at
groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1125)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812)
at
org.codehaus.groovy.runtime.metaclass.OwnedMetaClass.invokeMethod(OwnedMetaClass.java:100)
at geb.Browser.invokeMethod(Browser.groovy)
at
org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:48)
at
org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.callCurrent(PogoInterceptableSite.java:58)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:158)
at geb.Browser.methodMissing(Browser.groovy:209)
at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at
org.codehaus.groovy.runtime.metaclass.MixinInstanceMetaMethod.invoke(MixinInstanceMetaMethod.java:56)
at
groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:941)
at
groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1264)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
at
groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1125)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812)
at
org.codehaus.groovy.runtime.metaclass.OwnedMetaClass.invokeMethod(OwnedMetaClass.java:100)
at geb.Browser.invokeMethod(Browser.groovy)
at
org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:48)
at
org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.callCurrent(PogoInterceptableSite.java:58)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
at geb.Browser.createPage(Browser.groovy:854)
at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at
org.codehaus.groovy.runtime.metaclass.MixinInstanceMetaMethod.invoke(MixinInstanceMetaMethod.java:56)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at
groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1125)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812)
at
org.codehaus.groovy.runtime.metaclass.OwnedMetaClass.invokeMethod(OwnedMetaClass.java:100)
at geb.Browser.invokeMethod(Browser.groovy)
at
org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:48)
at
org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.callCurrent(PogoInterceptableSite.java:58)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
at geb.Browser.getPage(Browser.groovy:90)
at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at
org.codehaus.groovy.runtime.metaclass.MixinInstanceMetaMethod.invoke(MixinInstanceMetaMethod.java:56)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at
groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1125)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812)
at
org.codehaus.groovy.runtime.metaclass.OwnedMetaClass.invokeMethod(OwnedMetaClass.java:100)
at geb.Browser.invokeMethod(Browser.groovy)
at
org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:48)
at
org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.callCurrent(PogoInterceptableSite.java:58)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:158)
at geb.Browser.methodMissing(Browser.groovy:209)
at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at
org.codehaus.groovy.runtime.metaclass.MixinInstanceMetaMethod.invoke(MixinInstanceMetaMethod.java:56)
at
groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:941)
at
groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1264)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
at
groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1125)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812)
at
org.codehaus.groovy.runtime.metaclass.OwnedMetaClass.invokeMethod(OwnedMetaClass.java:100)
at geb.Browser.invokeMethod(Browser.groovy)
--
View this message in context: http://groovy.329449.n5.nabble.com/Version-Hell-tp5741010p5741013.html
Sent from the Groovy Users mailing list archive at Nabble.com.
Re: Version Hell
Posted by Jochen Theodorou <bl...@gmx.org>.
On 16.05.2017 04:55, russellr wrote:
[...]
> Here are the relevant versions that *used* to work:
> <cucumber-jvm.version>1.1.5</cucumber-jvm.version>
> <gherkin.version>2.12.2</gherkin.version>
> <groovy.version>2.1.6</groovy.version>
> <geb.version>0.9.2</geb.version>
> <selenium.version>2.38.0</selenium.version>
>
> If I upgrade Geb to 1.1.1, I get:
>
> java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.NoClassDefFoundError:
> org/codehaus/groovy/runtime/typehandling/ShortTypeHandling
yes, this came later in, with bytecode directly referencing the class.
> If I *then* upgrade Groovy to 2.4.11 or later I get:
>
> java.lang.StackOverflowError
> at java.lang.ThreadLocal.get(ThreadLocal.java:143)
> at
> java.util.concurrent.locks.ReentrantReadWriteLock$Sync.tryReleaseShared(ReentrantReadWriteLock.java:426)
> at
> java.util.concurrent.locks.AbstractQueuedSynchronizer.releaseShared(AbstractQueuedSynchronizer.java:1340)
> at
> java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.unlock(ReentrantReadWriteLock.java:883)
> at
> groovy.lang.ExpandoMetaClass.checkInitalised(ExpandoMetaClass.java:837)
>
> The StackOverflowError appears to be triggered by a simple "Given":
> Given(~'I am on the reference page for (.+)') { String path ->
> }
how about the suggested Groovy 2.4.7? To make something out of the
Stackoverflow error, I would need a bit more fodder.
bye Jochen