Spock with JDK 1.8 and non-interface types

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Spock with JDK 1.8 and non-interface types

Vetle Leinonen-Roeim
Hi,

Trying to build a project with JDK 1.8, with "-target 1.8", and running into some issues. Specifically, there seems to be a problem with JDK 1.8 and CGLIB:
java.lang.IllegalArgumentException: null
        at net.sf.cglib.proxy.BridgeMethodResolver.resolveAll(BridgeMethodResolver.java:61)
        at net.sf.cglib.proxy.Enhancer.emitMethods(Enhancer.java:911)
        at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:498)
        at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
        at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
        at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
        at org.spockframework.mock.runtime.ProxyBasedMockFactory$CglibMockFactory.createMock(ProxyBasedMockFactory.java:91)

Removing the CGLIB dependency gives me this error:
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class x.y.Z. Mocking of non-interface types requires the CGLIB library. Please put cglib-nodep-2.2 or higher on the class path. 

It would seem that CGLIB is not compatible with JDK 1.8.

Has anyone run into this problem?
Any ideas on how to solve it without rewriting to use interfaces?

Regards,
Vetle

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Spock with JDK 1.8 and non-interface types

Vetle Leinonen-Roeim
Ok, so to answer my own question, it seems that Java 8 support in cglib has been added, but a version that includes it has not yet been released.

On Wednesday, August 13, 2014 12:24:36 PM UTC+2, Vetle Leinonen-Roeim wrote:
Hi,

Trying to build a project with JDK 1.8, with "-target 1.8", and running into some issues. Specifically, there seems to be a problem with JDK 1.8 and CGLIB:
java.lang.IllegalArgumentException: null
        at net.sf.cglib.proxy.BridgeMethodResolver.resolveAll(BridgeMethodResolver.java:61)
        at net.sf.cglib.proxy.Enhancer.emitMethods(Enhancer.java:911)
        at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:498)
        at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
        at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
        at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
        at org.spockframework.mock.runtime.ProxyBasedMockFactory$CglibMockFactory.createMock(ProxyBasedMockFactory.java:91)

Removing the CGLIB dependency gives me this error:
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class x.y.Z. Mocking of non-interface types requires the CGLIB library. Please put cglib-nodep-2.2 or higher on the class path. 

It would seem that CGLIB is not compatible with JDK 1.8.

Has anyone run into this problem?
Any ideas on how to solve it without rewriting to use interfaces?

Regards,
Vetle

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Spock with JDK 1.8 and non-interface types

Peter Niederwieser
Administrator
I already pinged the CGLIB folks and asked them to cut a release, but didn't get a response. I also tried to switch to ByteBuddy, but that turned out to be too complicated. At this point I’m still hoping for a new CGLIB release.

Cheers,
Peter

On 13 Aug 2014, at 05:33, Vetle Leinonen-Roeim <[hidden email]> wrote:

Ok, so to answer my own question, it seems that Java 8 support in cglib has been added, but a version that includes it has not yet been released.

On Wednesday, August 13, 2014 12:24:36 PM UTC+2, Vetle Leinonen-Roeim wrote:
Hi,

Trying to build a project with JDK 1.8, with "-target 1.8", and running into some issues. Specifically, there seems to be a problem with JDK 1.8 and CGLIB:
java.lang.IllegalArgumentException: null
        at net.sf.cglib.proxy.BridgeMethodResolver.resolveAll(BridgeMethodResolver.java:61)
        at net.sf.cglib.proxy.Enhancer.emitMethods(Enhancer.java:911)
        at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:498)
        at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
        at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
        at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
        at org.spockframework.mock.runtime.ProxyBasedMockFactory$CglibMockFactory.createMock(ProxyBasedMockFactory.java:91)

Removing the CGLIB dependency gives me this error:
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class x.y.Z. Mocking of non-interface types requires the CGLIB library. Please put cglib-nodep-2.2 or higher on the class path. 

It would seem that CGLIB is not compatible with JDK 1.8.

Has anyone run into this problem?
Any ideas on how to solve it without rewriting to use interfaces?

Regards,
Vetle

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Spock with JDK 1.8 and non-interface types

Vetle Leinonen-Roeim
Ok, thanks. Crossing my fingers!

On Wednesday, August 13, 2014 5:59:55 PM UTC+2, Peter Niederwieser wrote:
I already pinged the CGLIB folks and asked them to cut a release, but didn't get a response. I also tried to switch to ByteBuddy, but that turned out to be too complicated. At this point I’m still hoping for a new CGLIB release.

Cheers,
Peter

On 13 Aug 2014, at 05:33, Vetle Leinonen-Roeim <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ydhW5u744WEJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">vet...@...> wrote:

Ok, so to answer my own question, it seems that Java 8 support in cglib has been added, but a version that includes it has not yet been released.

On Wednesday, August 13, 2014 12:24:36 PM UTC+2, Vetle Leinonen-Roeim wrote:
Hi,

Trying to build a project with JDK 1.8, with "-target 1.8", and running into some issues. Specifically, there seems to be a problem with JDK 1.8 and CGLIB:
java.lang.IllegalArgumentException: null
        at net.sf.cglib.proxy.BridgeMethodResolver.resolveAll(BridgeMethodResolver.java:61)
        at net.sf.cglib.proxy.Enhancer.emitMethods(Enhancer.java:911)
        at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:498)
        at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
        at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
        at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
        at org.spockframework.mock.runtime.ProxyBasedMockFactory$CglibMockFactory.createMock(ProxyBasedMockFactory.java:91)

Removing the CGLIB dependency gives me this error:
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class x.y.Z. Mocking of non-interface types requires the CGLIB library. Please put cglib-nodep-2.2 or higher on the class path. 

It would seem that CGLIB is not compatible with JDK 1.8.

Has anyone run into this problem?
Any ideas on how to solve it without rewriting to use interfaces?

Regards,
Vetle

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ydhW5u744WEJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">spockframewor...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ydhW5u744WEJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">spockfr...@googlegroups.com.
Visit this group at <a href="http://groups.google.com/group/spockframework" target="_blank" onmousedown="this.href='http://groups.google.com/group/spockframework';return true;" onclick="this.href='http://groups.google.com/group/spockframework';return true;">http://groups.google.com/group/spockframework.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Spock with JDK 1.8 and non-interface types

Daniel Scott
Did you get any further with this? The latest version of CGLIB is 3.1 (Dec 2013), and I'm still getting the same errors.

I'm guessing I can work around it by only mocking interfaces? This would be a fairly large code change for me though.

Dan

On Thursday, 14 August 2014 18:56:54 UTC+1, Vetle Leinonen-Roeim wrote:
Ok, thanks. Crossing my fingers!

On Wednesday, August 13, 2014 5:59:55 PM UTC+2, Peter Niederwieser wrote:
I already pinged the CGLIB folks and asked them to cut a release, but didn't get a response. I also tried to switch to ByteBuddy, but that turned out to be too complicated. At this point I’m still hoping for a new CGLIB release.

Cheers,
Peter

On 13 Aug 2014, at 05:33, Vetle Leinonen-Roeim <[hidden email]> wrote:

Ok, so to answer my own question, it seems that Java 8 support in cglib has been added, but a version that includes it has not yet been released.

On Wednesday, August 13, 2014 12:24:36 PM UTC+2, Vetle Leinonen-Roeim wrote:
Hi,

Trying to build a project with JDK 1.8, with "-target 1.8", and running into some issues. Specifically, there seems to be a problem with JDK 1.8 and CGLIB:
java.lang.IllegalArgumentException: null
        at net.sf.cglib.proxy.BridgeMethodResolver.resolveAll(BridgeMethodResolver.java:61)
        at net.sf.cglib.proxy.Enhancer.emitMethods(Enhancer.java:911)
        at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:498)
        at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
        at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
        at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
        at org.spockframework.mock.runtime.ProxyBasedMockFactory$CglibMockFactory.createMock(ProxyBasedMockFactory.java:91)

Removing the CGLIB dependency gives me this error:
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class x.y.Z. Mocking of non-interface types requires the CGLIB library. Please put cglib-nodep-2.2 or higher on the class path. 

It would seem that CGLIB is not compatible with JDK 1.8.

Has anyone run into this problem?
Any ideas on how to solve it without rewriting to use interfaces?

Regards,
Vetle

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spockframewor...@googlegroups.com.
To post to this group, send email to [hidden email].
Visit this group at <a href="http://groups.google.com/group/spockframework" target="_blank" onmousedown="this.href='http://groups.google.com/group/spockframework';return true;" onclick="this.href='http://groups.google.com/group/spockframework';return true;">http://groups.google.com/group/spockframework.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Spock with JDK 1.8 and non-interface types

Peter Niederwieser
Administrator
From what I can tell, CGLIB is neglecting this problem and still hasn't put out a new release. I've made some attempts to switch out CGLIB for ByteBuddy, but this turned out to be more complicated then expected. So unfortunately, I can't offer a solution at this time. Any help on this would be appreciated.

It's correct that CGLIB is only used when class are mocked. For mocking interfaces, plain Java dynamic proxies are used, which don't have this problem.

Cheers,
Peter

Am Dienstag, 4. November 2014 22:27:50 UTC+1 schrieb Daniel Scott:
Did you get any further with this? The latest version of CGLIB is 3.1 (Dec 2013), and I'm still getting the same errors.

I'm guessing I can work around it by only mocking interfaces? This would be a fairly large code change for me though.

Dan

On Thursday, 14 August 2014 18:56:54 UTC+1, Vetle Leinonen-Roeim wrote:
Ok, thanks. Crossing my fingers!

On Wednesday, August 13, 2014 5:59:55 PM UTC+2, Peter Niederwieser wrote:
I already pinged the CGLIB folks and asked them to cut a release, but didn't get a response. I also tried to switch to ByteBuddy, but that turned out to be too complicated. At this point I’m still hoping for a new CGLIB release.

Cheers,
Peter

On 13 Aug 2014, at 05:33, Vetle Leinonen-Roeim <[hidden email]> wrote:

Ok, so to answer my own question, it seems that Java 8 support in cglib has been added, but a version that includes it has not yet been released.

On Wednesday, August 13, 2014 12:24:36 PM UTC+2, Vetle Leinonen-Roeim wrote:
Hi,

Trying to build a project with JDK 1.8, with "-target 1.8", and running into some issues. Specifically, there seems to be a problem with JDK 1.8 and CGLIB:
java.lang.IllegalArgumentException: null
        at net.sf.cglib.proxy.BridgeMethodResolver.resolveAll(BridgeMethodResolver.java:61)
        at net.sf.cglib.proxy.Enhancer.emitMethods(Enhancer.java:911)
        at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:498)
        at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
        at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
        at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
        at org.spockframework.mock.runtime.ProxyBasedMockFactory$CglibMockFactory.createMock(ProxyBasedMockFactory.java:91)

Removing the CGLIB dependency gives me this error:
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class x.y.Z. Mocking of non-interface types requires the CGLIB library. Please put cglib-nodep-2.2 or higher on the class path. 

It would seem that CGLIB is not compatible with JDK 1.8.

Has anyone run into this problem?
Any ideas on how to solve it without rewriting to use interfaces?

Regards,
Vetle

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spockframewor...@googlegroups.com.
To post to this group, send email to [hidden email].
Visit this group at <a href="http://groups.google.com/group/spockframework" target="_blank" onmousedown="this.href='http://groups.google.com/group/spockframework';return true;" onclick="this.href='http://groups.google.com/group/spockframework';return true;">http://groups.google.com/group/spockframework.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Spock with JDK 1.8 and non-interface types

Oscar Bernal
Hi Peter. Have you tried compiling Spock against their code in the master branch and have you confirmed the issue is solved by doing so? I built their code myself and tried using the 3.2.0-SNAPSHOT dependency in my project, however I got a few NoClassDefFoundError exceptions when running the tests. Expected since Spock is built against an earlier version of cglib.

However if you have already tried their latest code which supposedly fixes this and have confirmed that takes care of this issue, maybe we can all put some pressure here on the issue https://github.com/cglib/cglib/issues/8 and get them to make a release.

Sorry if you have already tested and it's an obvious question, but I just don't want to get a vague response like "please file a bug" when all we need is a release. We too are on Java8 and having quite a few problems with this.

Thanks!

Oscar

On Wednesday, November 5, 2014 10:20:04 AM UTC-2, Peter Niederwieser wrote:
From what I can tell, CGLIB is neglecting this problem and still hasn't put out a new release. I've made some attempts to switch out CGLIB for ByteBuddy, but this turned out to be more complicated then expected. So unfortunately, I can't offer a solution at this time. Any help on this would be appreciated.

It's correct that CGLIB is only used when class are mocked. For mocking interfaces, plain Java dynamic proxies are used, which don't have this problem.

Cheers,
Peter

Am Dienstag, 4. November 2014 22:27:50 UTC+1 schrieb Daniel Scott:
Did you get any further with this? The latest version of CGLIB is 3.1 (Dec 2013), and I'm still getting the same errors.

I'm guessing I can work around it by only mocking interfaces? This would be a fairly large code change for me though.

Dan

On Thursday, 14 August 2014 18:56:54 UTC+1, Vetle Leinonen-Roeim wrote:
Ok, thanks. Crossing my fingers!

On Wednesday, August 13, 2014 5:59:55 PM UTC+2, Peter Niederwieser wrote:
I already pinged the CGLIB folks and asked them to cut a release, but didn't get a response. I also tried to switch to ByteBuddy, but that turned out to be too complicated. At this point I’m still hoping for a new CGLIB release.

Cheers,
Peter

On 13 Aug 2014, at 05:33, Vetle Leinonen-Roeim <[hidden email]> wrote:

Ok, so to answer my own question, it seems that Java 8 support in cglib has been added, but a version that includes it has not yet been released.

On Wednesday, August 13, 2014 12:24:36 PM UTC+2, Vetle Leinonen-Roeim wrote:
Hi,

Trying to build a project with JDK 1.8, with "-target 1.8", and running into some issues. Specifically, there seems to be a problem with JDK 1.8 and CGLIB:
java.lang.IllegalArgumentException: null
        at net.sf.cglib.proxy.BridgeMethodResolver.resolveAll(BridgeMethodResolver.java:61)
        at net.sf.cglib.proxy.Enhancer.emitMethods(Enhancer.java:911)
        at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:498)
        at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
        at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
        at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
        at org.spockframework.mock.runtime.ProxyBasedMockFactory$CglibMockFactory.createMock(ProxyBasedMockFactory.java:91)

Removing the CGLIB dependency gives me this error:
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class x.y.Z. Mocking of non-interface types requires the CGLIB library. Please put cglib-nodep-2.2 or higher on the class path. 

It would seem that CGLIB is not compatible with JDK 1.8.

Has anyone run into this problem?
Any ideas on how to solve it without rewriting to use interfaces?

Regards,
Vetle

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spockframewor...@googlegroups.com.
To post to this group, send email to [hidden email].
Visit this group at <a href="http://groups.google.com/group/spockframework" target="_blank" onmousedown="this.href='http://groups.google.com/group/spockframework';return true;" onclick="this.href='http://groups.google.com/group/spockframework';return true;">http://groups.google.com/group/spockframework.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Spock with JDK 1.8 and non-interface types

Peter Niederwieser
Administrator
I'm pretty sure I tried it, but having somebody double-check would be very welcome.

Cheers,
Peter

Am Donnerstag, 11. Dezember 2014 14:23:45 UTC+1 schrieb Oscar Bernal:
Hi Peter. Have you tried compiling Spock against their code in the master branch and have you confirmed the issue is solved by doing so? I built their code myself and tried using the 3.2.0-SNAPSHOT dependency in my project, however I got a few NoClassDefFoundError exceptions when running the tests. Expected since Spock is built against an earlier version of cglib.

However if you have already tried their latest code which supposedly fixes this and have confirmed that takes care of this issue, maybe we can all put some pressure here on the issue <a href="https://github.com/cglib/cglib/issues/8" target="_blank" onmousedown="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Fcglib%2Fcglib%2Fissues%2F8\46sa\75D\46sntz\0751\46usg\75AFQjCNEueeSDFEuBuRizNENK-A-Ppb41mA';return true;" onclick="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Fcglib%2Fcglib%2Fissues%2F8\46sa\75D\46sntz\0751\46usg\75AFQjCNEueeSDFEuBuRizNENK-A-Ppb41mA';return true;">https://github.com/cglib/cglib/issues/8 and get them to make a release.

Sorry if you have already tested and it's an obvious question, but I just don't want to get a vague response like "please file a bug" when all we need is a release. We too are on Java8 and having quite a few problems with this.

Thanks!

Oscar

On Wednesday, November 5, 2014 10:20:04 AM UTC-2, Peter Niederwieser wrote:
From what I can tell, CGLIB is neglecting this problem and still hasn't put out a new release. I've made some attempts to switch out CGLIB for ByteBuddy, but this turned out to be more complicated then expected. So unfortunately, I can't offer a solution at this time. Any help on this would be appreciated.

It's correct that CGLIB is only used when class are mocked. For mocking interfaces, plain Java dynamic proxies are used, which don't have this problem.

Cheers,
Peter

Am Dienstag, 4. November 2014 22:27:50 UTC+1 schrieb Daniel Scott:
Did you get any further with this? The latest version of CGLIB is 3.1 (Dec 2013), and I'm still getting the same errors.

I'm guessing I can work around it by only mocking interfaces? This would be a fairly large code change for me though.

Dan

On Thursday, 14 August 2014 18:56:54 UTC+1, Vetle Leinonen-Roeim wrote:
Ok, thanks. Crossing my fingers!

On Wednesday, August 13, 2014 5:59:55 PM UTC+2, Peter Niederwieser wrote:
I already pinged the CGLIB folks and asked them to cut a release, but didn't get a response. I also tried to switch to ByteBuddy, but that turned out to be too complicated. At this point I’m still hoping for a new CGLIB release.

Cheers,
Peter

On 13 Aug 2014, at 05:33, Vetle Leinonen-Roeim <[hidden email]> wrote:

Ok, so to answer my own question, it seems that Java 8 support in cglib has been added, but a version that includes it has not yet been released.

On Wednesday, August 13, 2014 12:24:36 PM UTC+2, Vetle Leinonen-Roeim wrote:
Hi,

Trying to build a project with JDK 1.8, with "-target 1.8", and running into some issues. Specifically, there seems to be a problem with JDK 1.8 and CGLIB:
java.lang.IllegalArgumentException: null
        at net.sf.cglib.proxy.BridgeMethodResolver.resolveAll(BridgeMethodResolver.java:61)
        at net.sf.cglib.proxy.Enhancer.emitMethods(Enhancer.java:911)
        at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:498)
        at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
        at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
        at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
        at org.spockframework.mock.runtime.ProxyBasedMockFactory$CglibMockFactory.createMock(ProxyBasedMockFactory.java:91)

Removing the CGLIB dependency gives me this error:
org.spockframework.mock.CannotCreateMockException: Cannot create mock for class x.y.Z. Mocking of non-interface types requires the CGLIB library. Please put cglib-nodep-2.2 or higher on the class path. 

It would seem that CGLIB is not compatible with JDK 1.8.

Has anyone run into this problem?
Any ideas on how to solve it without rewriting to use interfaces?

Regards,
Vetle

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spockframewor...@googlegroups.com.
To post to this group, send email to [hidden email].
Visit this group at <a href="http://groups.google.com/group/spockframework" target="_blank" onmousedown="this.href='http://groups.google.com/group/spockframework';return true;" onclick="this.href='http://groups.google.com/group/spockframework';return true;">http://groups.google.com/group/spockframework.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Spock with JDK 1.8 and non-interface types

Oscar Bernal
Ok, I'll give it a shot and come back with results. 

Thanks!

Oscar

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Spock with JDK 1.8 and non-interface types

Odin Hole Standal
Any traction on this issue? We're seeing the same kinds of issues, hope this gets fixed soon.

/Odin

On Thursday, December 18, 2014 at 2:13:58 PM UTC+1, Oscar Bernal wrote:
Ok, I'll give it a shot and come back with results. 

Thanks!

Oscar

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Spock with JDK 1.8 and non-interface types

Cameron Fieber
I think I worked around this by forcing my cglib dependency to the latest (cglib:cglib:3.1 not cglib:cglib-nodep:3.1) and then forcing asm to the latest (org.ow2.asm:asm-all:5.0.3 + exclude asm:*)



On Tuesday, January 13, 2015 at 7:06:39 AM UTC-8, Odin Hole Standal wrote:
Any traction on this issue? We're seeing the same kinds of issues, hope this gets fixed soon.

/Odin

On Thursday, December 18, 2014 at 2:13:58 PM UTC+1, Oscar Bernal wrote:
Ok, I'll give it a shot and come back with results. 

Thanks!

Oscar

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Spock with JDK 1.8 and non-interface types

joschneider
+1 on Cameron's solution which works for Spock.  Groovy map and closure coercion is still broken for the same reason up to at least groovy 2.3.9 unfortunately.


On Friday, February 6, 2015 at 12:23:20 PM UTC-8, Cameron Fieber wrote:
I think I worked around this by forcing my cglib dependency to the latest (cglib:cglib:3.1 not cglib:cglib-nodep:3.1) and then forcing asm to the latest (org.ow2.asm:asm-all:5.0.3 + exclude asm:*)



On Tuesday, January 13, 2015 at 7:06:39 AM UTC-8, Odin Hole Standal wrote:
Any traction on this issue? We're seeing the same kinds of issues, hope this gets fixed soon.

/Odin

On Thursday, December 18, 2014 at 2:13:58 PM UTC+1, Oscar Bernal wrote:
Ok, I'll give it a shot and come back with results. 

Thanks!

Oscar

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Spock with JDK 1.8 and non-interface types

Peter Niederwieser
Administrator
See `spock-specs/specs.gradle` for how I solved the problem for Spock's own Java 8 build. Effectively it comes down to using a prerelease version of CGLIB 3.2, which is now very easy thanks to the awesome 

https://jitpack.io.

Cheers, Peter

Am Dienstag, 17. Februar 2015 00:49:39 UTC+1 schrieb [hidden email]:
+1 on Cameron's solution which works for Spock.  Groovy map and closure coercion is still broken for the same reason up to at least groovy 2.3.9 unfortunately.


On Friday, February 6, 2015 at 12:23:20 PM UTC-8, Cameron Fieber wrote:
I think I worked around this by forcing my cglib dependency to the latest (cglib:cglib:3.1 not cglib:cglib-nodep:3.1) and then forcing asm to the latest (org.ow2.asm:asm-all:5.0.3 + exclude asm:*)



On Tuesday, January 13, 2015 at 7:06:39 AM UTC-8, Odin Hole Standal wrote:
Any traction on this issue? We're seeing the same kinds of issues, hope this gets fixed soon.

/Odin

On Thursday, December 18, 2014 at 2:13:58 PM UTC+1, Oscar Bernal wrote:
Ok, I'll give it a shot and come back with results. 

Thanks!

Oscar

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Spock with JDK 1.8 and non-interface types

Kevin Wittek
When using the latest GIT revision, I get the following error in my Spring project using Spock:


java.lang.NoClassDefFoundError: Could not initialize class org.spockframework.mock.runtime.ProxyBasedMockFactory$CglibMockFactory$ConstructorFriendlyEnhancer
at org.spockframework.mock.runtime.ProxyBasedMockFactory$CglibMockFactory.createMock(ProxyBasedMockFactory.java:80)

Am Dienstag, 3. März 2015 03:41:38 UTC+1 schrieb Peter Niederwieser:
See `spock-specs/specs.gradle` for how I solved the problem for Spock's own Java 8 build. Effectively it comes down to using a prerelease version of CGLIB 3.2, which is now very easy thanks to the awesome 

<a href="https://jitpack.io" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\75https%3A%2F%2Fjitpack.io\46sa\75D\46sntz\0751\46usg\75AFQjCNFUqgqfnUwsYlul8-BYKtlrPvAs3A';return true;" onclick="this.href='https://www.google.com/url?q\75https%3A%2F%2Fjitpack.io\46sa\75D\46sntz\0751\46usg\75AFQjCNFUqgqfnUwsYlul8-BYKtlrPvAs3A';return true;">https://jitpack.io.

Cheers, Peter

Am Dienstag, 17. Februar 2015 00:49:39 UTC+1 schrieb [hidden email]:
+1 on Cameron's solution which works for Spock.  Groovy map and closure coercion is still broken for the same reason up to at least groovy 2.3.9 unfortunately.


On Friday, February 6, 2015 at 12:23:20 PM UTC-8, Cameron Fieber wrote:
I think I worked around this by forcing my cglib dependency to the latest (cglib:cglib:3.1 not cglib:cglib-nodep:3.1) and then forcing asm to the latest (org.ow2.asm:asm-all:5.0.3 + exclude asm:*)



On Tuesday, January 13, 2015 at 7:06:39 AM UTC-8, Odin Hole Standal wrote:
Any traction on this issue? We're seeing the same kinds of issues, hope this gets fixed soon.

/Odin

On Thursday, December 18, 2014 at 2:13:58 PM UTC+1, Oscar Bernal wrote:
Ok, I'll give it a shot and come back with results. 

Thanks!

Oscar

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Spock with JDK 1.8 and non-interface types

Leonard Brünings
Hi Kevin, it should work with the current master.

On Tuesday, June 2, 2015 at 12:27:35 PM UTC+2, Kevin Wittek wrote:
When using the latest GIT revision, I get the following error in my Spring project using Spock:


java.lang.NoClassDefFoundError: Could not initialize class org.spockframework.mock.runtime.ProxyBasedMockFactory$CglibMockFactory$ConstructorFriendlyEnhancer
at org.spockframework.mock.runtime.ProxyBasedMockFactory$CglibMockFactory.createMock(ProxyBasedMockFactory.java:80)

Am Dienstag, 3. März 2015 03:41:38 UTC+1 schrieb Peter Niederwieser:
See `spock-specs/specs.gradle` for how I solved the problem for Spock's own Java 8 build. Effectively it comes down to using a prerelease version of CGLIB 3.2, which is now very easy thanks to the awesome 

<a href="https://jitpack.io" rel="nofollow" target="_blank" onmousedown="this.href='https://www.google.com/url?q\75https%3A%2F%2Fjitpack.io\46sa\75D\46sntz\0751\46usg\75AFQjCNFUqgqfnUwsYlul8-BYKtlrPvAs3A';return true;" onclick="this.href='https://www.google.com/url?q\75https%3A%2F%2Fjitpack.io\46sa\75D\46sntz\0751\46usg\75AFQjCNFUqgqfnUwsYlul8-BYKtlrPvAs3A';return true;">https://jitpack.io.

Cheers, Peter

Am Dienstag, 17. Februar 2015 00:49:39 UTC+1 schrieb [hidden email]:
+1 on Cameron's solution which works for Spock.  Groovy map and closure coercion is still broken for the same reason up to at least groovy 2.3.9 unfortunately.


On Friday, February 6, 2015 at 12:23:20 PM UTC-8, Cameron Fieber wrote:
I think I worked around this by forcing my cglib dependency to the latest (cglib:cglib:3.1 not cglib:cglib-nodep:3.1) and then forcing asm to the latest (org.ow2.asm:asm-all:5.0.3 + exclude asm:*)



On Tuesday, January 13, 2015 at 7:06:39 AM UTC-8, Odin Hole Standal wrote:
Any traction on this issue? We're seeing the same kinds of issues, hope this gets fixed soon.

/Odin

On Thursday, December 18, 2014 at 2:13:58 PM UTC+1, Oscar Bernal wrote:
Ok, I'll give it a shot and come back with results. 

Thanks!

Oscar

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Spock with JDK 1.8 and non-interface types

Sairam Rekapalli
I'm usng cglib-nodep:3.2.0 and is on the classpath, java 8 & spock 1.0-grovy-2.4 and I receive this error:

Cannot create mock for class . Mocking of non-interface types requires the CGLIB library. Please put cglib-nodep-2.2 or higher on the class path.

what version of cglib has the fix ?

Appreciate any input.

Thanks.


On Thursday, June 11, 2015 at 3:28:18 PM UTC-5, Leonard Brünings wrote:
Hi Kevin, it should work with the current master.

On Tuesday, June 2, 2015 at 12:27:35 PM UTC+2, Kevin Wittek wrote:
When using the latest GIT revision, I get the following error in my Spring project using Spock:


java.lang.NoClassDefFoundError: Could not initialize class org.spockframework.mock.runtime.ProxyBasedMockFactory$CglibMockFactory$ConstructorFriendlyEnhancer
at org.spockframework.mock.runtime.ProxyBasedMockFactory$CglibMockFactory.createMock(ProxyBasedMockFactory.java:80)

Am Dienstag, 3. März 2015 03:41:38 UTC+1 schrieb Peter Niederwieser:
See `spock-specs/specs.gradle` for how I solved the problem for Spock's own Java 8 build. Effectively it comes down to using a prerelease version of CGLIB 3.2, which is now very easy thanks to the awesome 

<a href="https://jitpack.io" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fjitpack.io\46sa\75D\46sntz\0751\46usg\75AFQjCNFUqgqfnUwsYlul8-BYKtlrPvAs3A&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fjitpack.io\46sa\75D\46sntz\0751\46usg\75AFQjCNFUqgqfnUwsYlul8-BYKtlrPvAs3A&#39;;return true;">https://jitpack.io.

Cheers, Peter

Am Dienstag, 17. Februar 2015 00:49:39 UTC+1 schrieb [hidden email]:
+1 on Cameron's solution which works for Spock.  Groovy map and closure coercion is still broken for the same reason up to at least groovy 2.3.9 unfortunately.


On Friday, February 6, 2015 at 12:23:20 PM UTC-8, Cameron Fieber wrote:
I think I worked around this by forcing my cglib dependency to the latest (cglib:cglib:3.1 not cglib:cglib-nodep:3.1) and then forcing asm to the latest (org.ow2.asm:asm-all:5.0.3 + exclude asm:*)



On Tuesday, January 13, 2015 at 7:06:39 AM UTC-8, Odin Hole Standal wrote:
Any traction on this issue? We're seeing the same kinds of issues, hope this gets fixed soon.

/Odin

On Thursday, December 18, 2014 at 2:13:58 PM UTC+1, Oscar Bernal wrote:
Ok, I'll give it a shot and come back with results. 

Thanks!

Oscar

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Spock with JDK 1.8 and non-interface types

John Allen
So just a reply for the latest status.

Both RELEASE and LATEST versions work.  Hurray!

<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>RELEASE</version>
</dependency>

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Loading...