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

Build with jdk17 fails #307

Closed
snuyanzin opened this issue Dec 3, 2021 · 3 comments
Closed

Build with jdk17 fails #307

snuyanzin opened this issue Dec 3, 2021 · 3 comments

Comments

@snuyanzin
Copy link

Probably the reason is that since jdk 17 --illegal-access does not make any case as mentioned at https://openjdk.java.net/jeps/403
Build fails with

[ERROR] Tests run: 7, Failures: 0, Errors: 7, Skipped: 0, Time elapsed: 0.069 s <<< FAILURE! - in japicmp.maven.SkipModuleStrategyTest
[ERROR] testModuleIsNotIncludedAndNoIncludesDefined(japicmp.maven.SkipModuleStrategyTest)  Time elapsed: 0.065 s  <<< ERROR!
java.lang.ExceptionInInitializerError
	at japicmp.maven.SkipModuleStrategyTest.createMavenParameters(SkipModuleStrategyTest.java:96)
	at japicmp.maven.SkipModuleStrategyTest.testModuleIsNotIncludedAndNoIncludesDefined(SkipModuleStrategyTest.java:78)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @5f8754e
	at japicmp.maven.SkipModuleStrategyTest.createMavenParameters(SkipModuleStrategyTest.java:96)
	at japicmp.maven.SkipModuleStrategyTest.testModuleIsNotIncludedAndNoIncludesDefined(SkipModuleStrategyTest.java:78)
@siom79
Copy link
Owner

siom79 commented Jan 30, 2022

The problem is that mockito currently does not support jdk17: mockito/mockito#2212

Can be solved by upgrading to latest mockito version.

But javassist's CtClass.toClass() cannot be called with jdk17: jboss-javassist/javassist#400
Currently this issue is not fixed.

siom79 added a commit that referenced this issue Jan 30, 2022
siom79 added a commit that referenced this issue Jan 30, 2022
@chibash
Copy link

chibash commented Apr 30, 2022

I suppose that this issue can be fixed by changing mockito so that mockito will call CtClass.toClass(Class) or CtClass.toClass(Lookup), etc. Please see http://www.javassist.org/html/javassist/CtClass.html#toClass()

@cstamas
Copy link
Contributor

cstamas commented Jun 27, 2022

This issue seems fixed, am building project with Java 17 all right:

[cstamas@urnebes japicmp (master)]$ mvn -V clean install
Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: /home/cstamas/.sdkman/candidates/maven/current
Java version: 17.0.3, vendor: Eclipse Adoptium, runtime: /home/cstamas/.sdkman/candidates/java/17.0.3-tem
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.18.6-200.fc36.x86_64", arch: "amd64", family: "unix"
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for japicmp-base 0.15.8-SNAPSHOT:
[INFO] 
[INFO] japicmp-base ....................................... SUCCESS [  0.504 s]
[INFO] japicmp ............................................ SUCCESS [  8.736 s]
[INFO] japicmp-testbase ................................... SUCCESS [  0.008 s]
[INFO] japicmp-test-v1 .................................... SUCCESS [  0.229 s]
[INFO] japicmp-maven-plugin ............................... SUCCESS [  4.143 s]
[INFO] japicmp-test-v2 .................................... SUCCESS [  1.518 s]
[INFO] japicmp-test2-v1 ................................... SUCCESS [  0.035 s]
[INFO] japicmp-test2-v2 ................................... SUCCESS [  0.041 s]
[INFO] japicmp-test ....................................... SUCCESS [  4.041 s]
[INFO] japicmp-test-maven-plugin .......................... SUCCESS [  4.158 s]
[INFO] japicmp-test-maven-plugin-guava .................... SUCCESS [  0.589 s]
[INFO] japicmp-test-maven-plugin-japicmp .................. SUCCESS [  0.189 s]
[INFO] japicmp-test-service-impl-base ..................... SUCCESS [  0.007 s]
[INFO] japicmp-test-service-v1 ............................ SUCCESS [  0.041 s]
[INFO] japicmp-test-service-v2 ............................ SUCCESS [  0.035 s]
[INFO] japicmp-test-service-impl-v1 ....................... SUCCESS [  0.040 s]
[INFO] japicmp-test-service-impl-v2 ....................... SUCCESS [  0.040 s]
[INFO] japicmp-test-service-test .......................... SUCCESS [  0.709 s]
[INFO] japicmp-test-maven-plugin-classifier ............... SUCCESS [  0.464 s]
[INFO] japicmp-test-maven-plugin-pom-module ............... SUCCESS [  0.020 s]
[INFO] japicmp-test-vx-client ............................. SUCCESS [  0.326 s]
[INFO] japicmp-test-maven-plugin-ignoremissingartifact .... SUCCESS [  0.117 s]
[INFO] japicmp-test-maven-plugin-packaging ................ SUCCESS [  0.347 s]
[INFO] japicmp-testbundle-v1 .............................. SUCCESS [  0.540 s]
[INFO] japicmp-testbundle-v2 .............................. SUCCESS [  0.054 s]
[INFO] japicmp-testbundle ................................. SUCCESS [  1.087 s]
[INFO] japicmp-test-maven-plugin-userproperty ............. SUCCESS [  0.453 s]
[INFO] japicmp-test-maven-plugin-post-analysis-script-artifact SUCCESS [  0.020 s]
[INFO] japicmp-test-maven-plugin-post-analysis-script-artifact-test SUCCESS [  0.880 s]
[INFO] japicmp-ant-task ................................... SUCCESS [  2.469 s]
[INFO] japicmp-test-ant-task .............................. SUCCESS [  0.837 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  33.428 s
[INFO] Finished at: 2022-06-27T11:49:41+02:00
[INFO] ------------------------------------------------------------------------
[cstamas@urnebes japicmp (master)]$ 

@siom79 siom79 closed this as completed Sep 24, 2022
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

Successfully merging a pull request may close this issue.

4 participants