[prev in list] [next in list] [prev in thread] [next in thread] 

List:       groovy-user
Subject:    Re: [groovy-user] GroovyCastException: Differences between Java 1.6 and Java 1.7
From:       Jochen Theodorou <blackdrag () gmx ! org>
Date:       2014-01-29 18:14:42
Message-ID: 52E94512.1090004 () gmx ! org
[Download RAW message or body]

Am 29.01.2014 18:34, schrieb Robert Stagner:
[...]
> *Linux (Linux 3.2.0-58-generic-pae #88-Ubuntu SMP Tue Dec 3 18:00:02 UTC
> 2013 i686 i686 i386 GNU/Linux)*
>
> -------------------------------------------------------
>   T E S T S
> -------------------------------------------------------
> Running cucumber.RunMyCucumberITCase
>
> Call testing ...  method from class cucumber.support.env BEFORE hook
>
> Hello from class cucumber.steps.BasicArithmeticSteps BEFORE hook
> class loader is an instance of class
> groovy.lang.GroovyClassLoader$InnerLoader called
> groovy.lang.GroovyClassLoader$InnerLoader@c78e9b
[...]
> <bootstrap loader>
>
> class loader is an instance of class
> groovy.lang.GroovyClassLoader$InnerLoader called
> groovy.lang.GroovyClassLoader$InnerLoader@c78e9b
[...]
> <bootstrap loader>

this tells me not only that the loaders are equal, but also that you 
most likely do not execute a precompiled script, but from source.

[...]
> Hello from class cucumber.steps.BasicArithmeticSteps BEFORE hook
> class loader is an instance of class
> groovy.lang.GroovyClassLoader$InnerLoader called
> groovy.lang.GroovyClassLoader$InnerLoader@86482ca
[...]
> <bootstrap loader>

again from source

> class loader is an instance of class sun.misc.Launcher$AppClassLoader
> called sun.misc.Launcher$AppClassLoader@41556f4c
> class loader is an instance of class sun.misc.Launcher$ExtClassLoader
> called sun.misc.Launcher$ExtClassLoader@4ffe0816
> <bootstrap loader>

and this one means it is precompiled. CucumberWithGroovyWorld is known 
in BasicArithmeticSteps because the class is in the AppClassLoader. But 
delegate is compiled from source.  It is unlikely this happens as an 
automatic compilation, because in that case CucumberWithGroovyWorld 
would have been taken from Launcher$AppClassLoader. Now I don't know how 
you execute this stuff, but somewhere you force this class being used.

Options are to me, that you either remove the precompiled class from the 
classpath and have it runtime compiled like on your linux box, or you 
find where the source is forced to be compiled (most probably 
GroovyClassLoader#parseClass in your code somewhere) and remove that. 
GroovyClassLoader#parseClass will ignore the class loading constraints 
in that regard, that it will produce a class, for the source you give 
in. Only after compilation it could tell that the type is already 
available, but it will not do so.

bye blackdrag


-- 
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog: http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit http://groovy-lang.org


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic