Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 9 and shading cglib #968

Closed
sormuras opened this issue Apr 5, 2017 · 6 comments
Closed

Java 9 and shading cglib #968

sormuras opened this issue Apr 5, 2017 · 6 comments

Comments

@sormuras
Copy link
Contributor

sormuras commented Apr 5, 2017

Summary

The JUnit 5 team is test-driving on Java 9 the coming days (and weeks).

Our current build fails because of a "NoClassDefFoundError" pointing to the shaded cglib in AssertJ 3.6.2.

We had a similar problem with the Gradle Shadow Plugin using an out-dated ASM version to move/shade entities. It was related to https://bugs.openjdk.java.net/browse/JDK-8174868

Log

  JUnit Jupiter:ExceptionHandlingTests:checkedExceptionInTestMethodIsRegistered()
    MethodSource [className = 'org.junit.jupiter.engine.ExceptionHandlingTests', methodName = 'checkedExceptionInTestMethodIsRegistered', methodParameterTypes = '']
    => java.lang.NoClassDefFoundError: Could not initialize class org.assertj.core.internal.cglib.proxy.Enhancer

https://travis-ci.org/junit-team/junit5/builds/219055181#L952

Solution?

Update Shade plugin you use to shade cglib and asm?

I'll try to generate a better stacktrace to pin-point the underlying error causing initialization of class org.assertj.core.internal.cglib.proxy.Enhancer to fail.

@joel-costigliola
Copy link
Member

@sormuras thanks for reporting this, @PascalSchumacher has spiked using Java 9 in AssertJ, he might have more feedback than me on the subject.
We have upgraded in master cglib to 3.2.5 and asm to 5.2 which I believe are the latest versions, @sormuras would you mind giving a try with it (you need to build AssertJ, a simple mvn install should be enough to do so).
@PascalSchumacher can you help @sormuras ?

@joel-costigliola
Copy link
Member

BTW, we are planning to release the next version of AssertJ 3.7.0 at the end of the month.

@sormuras
Copy link
Contributor Author

sormuras commented Apr 5, 2017

Used jitpack.io to build your core "master-SNAPSHOT" artifact. Let's see what happens: https://travis-ci.org/junit-team/junit5/builds/219085282

3.7.0 soon sounds great!

Edit: The cglib/AssertJ erros are gone with https://travis-ci.org/junit-team/junit5/builds/219085282#L900 -- moving on to the next ... issues.

@PascalSchumacher
Copy link
Member

I think it has the same cause (cglib/cglib#94) as #927 which was fixed by updating to cglib 3.2.5.

@joel-costigliola
Copy link
Member

I guess we can close this one then, @sormuras ?

@sormuras
Copy link
Contributor Author

sormuras commented Apr 6, 2017

Sure. Looking forward to switch the dependency to AssertJ 3.7.0, soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants