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

Tests fail with module resolution exception #267

Open
mkoncek opened this issue Jan 6, 2023 · 2 comments · May be fixed by #292
Open

Tests fail with module resolution exception #267

mkoncek opened this issue Jan 6, 2023 · 2 comments · May be fixed by #292
Labels

Comments

@mkoncek
Copy link

mkoncek commented Jan 6, 2023

Running mvn install -Ptest on a Fedora Linux machine gives me an error:

...
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ jakarta.xml.bind-api-test ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[ERROR] Error occurred during initialization of boot layer
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[WARNING] Corrupted STDOUT by directly writing to native stream in forked JVM 1. See FAQ web page and the dump file /usr/local/src/jaxb-api/jaxb-api-test/target/surefire-reports/2023-01-06T15-13-49_450-jvmRun1.dumpstream
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Jakarta XML Binding 4.0.1-SNAPSHOT:
[INFO] 
[INFO] Jakarta XML Binding ................................ SUCCESS [  0.359 s]
[INFO] Jakarta XML Binding API ............................ SUCCESS [  4.306 s]
[INFO] jakarta.xml.bind-api-test .......................... FAILURE [  0.694 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.477 s
[INFO] Finished at: 2023-01-06T15:13:50+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project jakarta.xml.bind-api-test: There are test failures.
[ERROR] 
[ERROR] Please refer to /usr/local/src/jaxb-api/jaxb-api-test/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was /bin/sh -c cd /usr/local/src/jaxb-api/jaxb-api-test && /usr/lib/jvm/java-17-openjdk-17.0.5.0.8-1.fc37.x86_64/bin/java --module-path /usr/local/src/jaxb-api/jaxb-api-test/target/modules/jakarta.activation-api-2.1.0.jar:/usr/local/src/jaxb-api/jaxb-api-test/target/modules/jakarta.xml.bind-api-4.0.1-SNAPSHOT.jar @/usr/local/src/jaxb-api/jaxb-api-test/target/surefire/surefireargs13679832087099846308 /usr/local/src/jaxb-api/jaxb-api-test/target/surefire 2023-01-06T15-13-49_450-jvmRun1 surefire893231820864732273tmp surefire_09336034615654302060tmp
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 1
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was /bin/sh -c cd /usr/local/src/jaxb-api/jaxb-api-test && /usr/lib/jvm/java-17-openjdk-17.0.5.0.8-1.fc37.x86_64/bin/java --module-path /usr/local/src/jaxb-api/jaxb-api-test/target/modules/jakarta.activation-api-2.1.0.jar:/usr/local/src/jaxb-api/jaxb-api-test/target/modules/jakarta.xml.bind-api-4.0.1-SNAPSHOT.jar @/usr/local/src/jaxb-api/jaxb-api-test/target/surefire/surefireargs13679832087099846308 /usr/local/src/jaxb-api/jaxb-api-test/target/surefire 2023-01-06T15-13-49_450-jvmRun1 surefire893231820864732273tmp surefire_09336034615654302060tmp
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 1
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:748)
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:305)
[ERROR]         at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:265)
[ERROR]         at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1314)
[ERROR]         at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1159)
[ERROR]         at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:932)
[ERROR]         at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:301)
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:211)
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:165)
[ERROR]         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:157)
[ERROR]         at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:121)
[ERROR]         at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR]         at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR]         at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:127)
[ERROR]         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:294)
[ERROR]         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR]         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR]         at org.apache.maven.cli.MavenCli.execute(MavenCli.java:960)
[ERROR]         at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:293)
[ERROR]         at org.apache.maven.cli.MavenCli.main(MavenCli.java:196)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[ERROR]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR]         at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :jakarta.xml.bind-api-test

Removing module-info.java files from jaxb-api-test module makes the tests execute successfully.

@antoniosanct
Copy link
Contributor

antoniosanct commented Nov 12, 2023

mvn -e -X -P test clean verify

[DEBUG] Fork Channel [1] connected to the client.
[ERROR] Error occurred during initialization of boot layer
[DEBUG] java.lang.module.ResolutionException: Module jakarta.xml.bind.tests contains package jakarta.xml.bind, module jakarta.xml.bind exports package jakarta.xml.bind to jakarta.xml.bind.tests
[DEBUG] Closing the fork 1 after not saying Good Bye.

Test classes are sharing package name, and I think that is occurring this:
https://stackoverflow.com/a/46278159/2190857

Regards,
Antonio.

@antoniosanct
Copy link
Contributor

@lukasj Deleting module-info.java files in jaxb-api-test fix the JVM crash. Is it neccessary to maintain these files in Java 11+?

Regards,
Antonio.

antoniosanct added a commit to antoniosanct/jaxb-api that referenced this issue Feb 16, 2024
Signed-off-by: Antonio Santos Izaguirre <[email protected]>
@lukasj lukasj linked a pull request Feb 18, 2024 that will close this issue
@lukasj lukasj added the 4.1 label Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants