Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-26127

Fix JDK ClassPathURLCheck error in Surefire

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Tests

      Description

      [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 /opt/jenkins/workspace/Deploy/IT-nuxeo-master-build/nuxeo/addons/nuxeo-javaagent/main && /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Xmx1g -Dfile.encoding=UTF-8 -XX:-OmitStackTraceInFastThrow -jar /opt/jenkins/workspace/Deploy/IT-nuxeo-master-build/nuxeo/addons/nuxeo-javaagent/main/target/surefire/surefirebooter384172606102026307.jar /opt/jenkins/workspace/Deploy/IT-nuxeo-master-build/nuxeo/addons/nuxeo-javaagent/main/target/surefire 2018-11-05T01-39-40_643-jvmRun1 surefire608878797530929563tmp surefire_42928238865868516857tmp
      [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:671)
      [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
      [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:278)
      [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:244)
      [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1194)
      [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1022)
      [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:868)
      [ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
      [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      [ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      [ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      [ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
      [ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
      [ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
      [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
      [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      jenkins@itslave01:~$ java --version
      Unrecognized option: --version
      Error: Could not create the Java Virtual Machine.
      Error: A fatal exception has occurred. Program will exit.
      jenkins@itslave01:~$ java -version
      java version "1.8.0_181"
      Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
      
      Improved Validation of Class-Path Attribute in JAR File Manifest
      > The JAR file specification states that URLs in the Class-Path manifest attribute must be relative, though this has not been enforced. To better conform to the JAR specification, absolute URLs (those that include a scheme) are now ignored. For JAR files not loaded from the file system, Class-Path entries navigating to a parent directory (using "../") are also ignored.
      > Applications depending on a JAR file loaded from an absolute URL element specified in Class-Path attribute may encounter a ClassNotFoundException. The historical behavior can be restored by setting a new system property,  jdk.net.URLClassPath.disableClassPathURLCheck to true. Debugging info for Class-Path entries that are ignored can be printed to stderr by setting -Djdk.net.URLClassPath.disableClassPathURLCheck=debug.

      The issue comes from 8u181-b13-2 (that applies patches from 8u191-b12 security update)
      See
      https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911742
      https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911925
      https://issues.apache.org/jira/browse/SUREFIRE-1588

      It was a "bug" on OpenJDK to change the behavior but the warning is relevant.
      It is a Surefire bug to make use of absolute paths.

      Workaround is to use -Djdk.net.URLClassPath.disableClassPathURLCheck=true like in NXCONNECT-2034
      A fix will likely come with the next JDK upgrade.
      A fix is expected in a future Surefire upgrade.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jcarsique Julien Carsique
                Reporter:
                jcarsique Julien Carsique
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: