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

Execution default of goal com.github.siom79.japicmp:japicmp-maven-plugin:0.11.0:cmp failed #303

Open
dbl001 opened this issue Nov 11, 2021 · 7 comments

Comments

@dbl001
Copy link

dbl001 commented Nov 11, 2021

I am trying to build Flink on OS X Monterey.

flink % java -version
openjdk version "17.0.1" 2021-10-19
OpenJDK Runtime Environment Temurin-17.0.1+12 (build 17.0.1+12)
OpenJDK 64-Bit Server VM Temurin-17.0.1+12 (build 17.0.1+12, mixed mode, sharing)
(base) davidlaxer@x86_64-apple-darwin13 flink % mvn -version
WARNING: Unknown module: ALL-UNNAME specified to --add-exports
Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)
Maven home: /opt/local/share/java/maven3
Java version: 17.0.1, vendor: Eclipse Adoptium, runtime: /Library/Java/JavaVirtualMachines/openjdk17-temurin/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "11.1", arch: "x86_64", family: "mac"

I got this error running

$ mvn install
...
Execution default of goal com.github.siom79.japicmp:japicmp-maven-plugin:0.11.0:cmp failed: Cannot invoke "java.lang.reflect.Method.invoke(Object, Object[])" because "com.sun.xml.bind.v2.runtime.reflect.opt.Injector.defineClass" is null 

Here are the pom.xml dependencies in 'flink-metrics-core:

	<dependency>
			<groupId>javax.xml.bind</groupId>
			<artifactId>jaxb-api</artifactId>
			<version>2.2.12</version>
		</dependency>
		<dependency>
			<groupId>com.sun.xml.bind</groupId>
			<artifactId>jaxb-impl</artifactId>
			<version>2.2.11</version>
		</dependency>
		<dependency>
			<groupId>com.github.siom79.japicmp</groupId>
			<artifactId>japicmp-maven-plugin</artifactId>
			<version>0.15.2</version>
		</dependency>

Any ideas?

@klaraward
Copy link

I see the same thing with JDK 17.

@martin-g
Copy link

martin-g commented Nov 15, 2021

goal com.github.siom79.japicmp:japicmp-maven-plugin:0.11.0:cmp

Why does it say 0.11.0 ? When your pom.xml says 0.15.2

@klaraward
Copy link

I get [ERROR] Failed to execute goal com.github.siom79.japicmp:japicmp-maven-plugin:0.15.4:cmp (default) on project XYZ: Execution default of goal com.github.siom79.japicmp:japicmp-maven-plugin:0.15.4:cmp failed: Cannot invoke "java.lang.reflect.Method.invoke(Object, Object[])" because "com.sun.xml.bind.v2.runtime.reflect.opt.Injector.defineClass" is null -> [Help 1]

@martin-g
Copy link

There are several closed issues related to JAXB.
You can check whether any of them solves your issue.
Or try to create a simple application demonstrating the problem, so others can try to debug it!

@dbl001
Copy link
Author

dbl001 commented Nov 15, 2021 via email

@klaraward
Copy link

klaraward commented Nov 15, 2021

For me it worked better with export MAVEN_OPTS="--add-opens=java.base/java.lang=ALL-UNNAMED" when using JDK 17.
(Still got an API incompatibility error though)

Actually, also moving to jaxb-runtime 2.3.5 in the dependencies for the japicmp plugin, like martin-g suggested (or the issues that was linked), did the trick for me.

@dbl001
Copy link
Author

dbl001 commented Nov 15, 2021 via email

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