Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1392

Running Failsafe results in crash on java 9-ea, missing class JAXBException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.20
    • None
    • Maven Failsafe Plugin
    • None
    • Maven 3.5.0
      Build 9-ea+173
      OS: Solus, 4.9.32-31.lts

    Description

      When running maven-failsafe-plugin 2.20 with Java 9 on one of my projects, it results in the following error:

      [INFO] --- maven-failsafe-plugin:2.20:integration-test (integration-test) @ scb-java-client ---
      [WARNING] Error injecting: org.apache.maven.plugin.failsafe.IntegrationTestMojo
      java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
      	at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
      	at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3105)
      	at java.base/java.lang.Class.getDeclaredConstructors(Class.java:2333)
      	at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
      	at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:99)
      	at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:658)
      	at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:882)
      	at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:805)
      	at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:282)
      	at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:214)
      	at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:1006)
      	at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1038)
      	at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1001)
      	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
      	at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
      	at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
      	at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)
      	at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:65)
      	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
      	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
      	at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
      	at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63)
      	at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
      	at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
      	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
      	at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
      	at org.eclipse.sisu.inject.Guice4$1.get(Guice4.java:162)
      	at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
      	at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
      	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
      	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
      	at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:519)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:121)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
      	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
      	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
      	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
      	at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
      	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
      	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
      	... 54 more
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 24.901 s
      [INFO] Finished at: 2017-07-17T11:46:08+02:00
      [INFO] Final Memory: 26M/86M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.20:integration-test (integration-test) on project scb-java-client: Execution integration-test of goal org.apache.maven.plugins:maven-failsafe-plugin:2.20:integration-test failed: A required class was missing while executing org.apache.maven.plugins:maven-failsafe-plugin:2.20:integration-test: javax/xml/bind/JAXBException
      [ERROR] -----------------------------------------------------
      [ERROR] realm =    plugin>org.apache.maven.plugins:maven-failsafe-plugin:2.20
      [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
      [ERROR] urls[0] = file:/home/daniel/.m2/repository/org/apache/maven/plugins/maven-failsafe-plugin/2.20/maven-failsafe-plugin-2.20.jar
      [ERROR] urls[1] = file:/home/daniel/.m2/repository/org/apache/maven/surefire/maven-surefire-common/2.20/maven-surefire-common-2.20.jar
      [ERROR] urls[2] = file:/home/daniel/.m2/repository/org/apache/maven/surefire/surefire-booter/2.20/surefire-booter-2.20.jar
      [ERROR] urls[3] = file:/home/daniel/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar
      [ERROR] urls[4] = file:/home/daniel/.m2/repository/junit/junit/4.12/junit-4.12.jar
      [ERROR] urls[5] = file:/home/daniel/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
      [ERROR] urls[6] = file:/home/daniel/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
      [ERROR] urls[7] = file:/home/daniel/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar
      [ERROR] urls[8] = file:/home/daniel/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar
      [ERROR] urls[9] = file:/home/daniel/.m2/repository/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.jar
      [ERROR] urls[10] = file:/home/daniel/.m2/repository/org/apache/maven/reporting/maven-reporting-api/3.0/maven-reporting-api-3.0.jar
      [ERROR] urls[11] = file:/home/daniel/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
      [ERROR] urls[12] = file:/home/daniel/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
      [ERROR] urls[13] = file:/home/daniel/.m2/repository/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar
      [ERROR] urls[14] = file:/home/daniel/.m2/repository/org/apache/maven/surefire/surefire-api/2.20/surefire-api-2.20.jar
      [ERROR] urls[15] = file:/home/daniel/.m2/repository/org/apache/maven/surefire/surefire-logger-api/2.20/surefire-logger-api-2.20.jar
      [ERROR] urls[16] = file:/home/daniel/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.3/maven-plugin-annotations-3.3.jar
      [ERROR] Number of foreign imports: 1
      [ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
      [ERROR] 
      [ERROR] -----------------------------------------------------
      [ERROR] : javax.xml.bind.JAXBException
      [ERROR] -> [Help 1]
      

      This is most probably due to the inclusion of JAXB.java and FailsafeSummaryXmlUtils.java (and maybe others, those are the ones I found), since downgrading to 2.19.1 resolves this. I'm not entirely familiar with Jigsaw but this is most probably due to missing module-info files, as the package java.xml.bind is not included per default anymore.

      Attachments

        Issue Links

          Activity

            People

              tibordigana Tibor Digana
              dannil Daniel Nilsson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: