SureFire插件的问题:-“叉式虚拟机在没有说再见的情况下终止。虚拟机崩溃或系统。退出叫什么?“(复制)

时间:2021-09-27 05:08:02

This question already has an answer here:

这个问题已经有了答案:

While running of unit tests following exception occurs:

当运行单元测试时,出现以下异常:

org.apache.maven.lifecycle.LifecycleExecutionException: ExecutionException; nested exception is java.util.concurrent.ExecutionException: java.lang.RuntimeException: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

Any suggestions?

有什么建议吗?

5 个解决方案

#1


6  

Any suggestions?

有什么建议吗?

The exception's error message probably explains what is going on. One of your unit tests has either

异常的错误消息可能解释了正在发生的事情。您的一个单元测试有这两个

  • called System.exit(), or
  • 调用system . exit(),或
  • broken the unit test harness, or
  • 破坏单元测试套,或。
  • done something that has crashed the JVM in which it was running.
  • 做一些已经使它运行的JVM崩溃的事情。

We cannot tell you which it was.

我们不能告诉你是哪一个。

(I imagine that the problem is being reported because the maven JVM was expecting the child JVM to write the unit test results to its standard output. What it got back from the child was missing the message (or whatever) that said that the unit tests had finished. It is possible that the root cause might be different from the alternatives suggested, but I doubt it, and it is pointless speculating ...)

(我想象这个问题正在被报告,因为maven JVM期望子JVM将单元测试结果写入其标准输出。它从这个孩子那里得到的信息(或者其他什么)没有显示单元测试已经完成的消息。有可能根本的原因可能与所建议的不同,但我对此表示怀疑,这是毫无意义的推测……

There is possibly more information in the logfile for the offending unit test. Check that / them.

日志文件中可能有更多关于违规单元测试的信息。检查/他们。

#2


4  

I was facing the same issue while running maven goal "package". The issue was resolved when i executed the goal "clean" before executing "package"

在运行maven目标“包”时,我也遇到了同样的问题。当我在执行“包”之前执行“clean”目标时,问题得到了解决

#3


3  

I've had the same issue. Turned out I updated my libs without updating my java version, and I had a little too new servlet.jar. I found following message in the logs, prior to the 'forked VM bla exception':

我也有同样的问题。结果我更新了我的libs而没有更新我的java版本,而且我有一个新的servlet.jar。我在日志中找到以下信息,在“叉叉叉VM bla异常”之前:

Caused by: java.lang.UnsupportedClassVersionError: javax/servlet/ServletRequest : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getMethod0(Class.java:2670)
at java.lang.Class.getMethod(Class.java:1603)
at org.apache.maven.surefire.util.ReflectionUtils.tryGetMethod(ReflectionUtils.java:57)
at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.isSuiteOnly(JUnit3TestChecker.java:64)
at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.isValidJUnit3Test(JUnit3TestChecker.java:59)
at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.accept(JUnit3TestChecker.java:54)
at org.apache.maven.surefire.common.junit4.JUnit4TestChecker.accept(JUnit4TestChecker.java:51)
at org.apache.maven.surefire.util.DefaultScanResult.applyFilter(DefaultScanResult.java:97)
at org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:194)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:92)

Updating JVM helped.

更新JVM帮助。

#4


2  

I was having this same problem ONLY in jenkins as reported in the accepted answer and lost one hour to realize that the problem was that the jenkins job name had a space in it, this was making something (still don't know what) in the invocation of the surefire plugin go crazy since the job name is the folder inside the jenkins workspace where everything is.

我有这同样的问题只有在詹金斯报告在接受答案和失去一个小时必须意识到问题是詹金斯工作名称空间,这让(还不知道)的调用成功的插件疯狂工作以来的名字是詹金斯工作空间内的文件夹都在哪里。

So, to be clear, jenkins has nothing to do with the problem, I only saw it in jenkins because only there I had a space in my path

很明显,詹金斯与这个问题无关,我只在詹金斯身上看到,因为只有在我的道路上有一个空间。

I hope this helps someone else. This was under surefire 2.14.1 and 2.16.

我希望这能帮助别人。这是2。14.1和2。16。

#5


0  

This may have to do with Administrator rights. I was facing the same issue when running the build mvn clean install from Cygwin.

这可能与管理员权限有关。我在运行Cygwin的build mvn clean安装时也遇到了同样的问题。

Now everytime for build I start cygwin as "Run as administrator" and the problem is solved.

现在每次构建时,我都以“作为管理员运行”的方式启动cygwin,问题就解决了。

#1


6  

Any suggestions?

有什么建议吗?

The exception's error message probably explains what is going on. One of your unit tests has either

异常的错误消息可能解释了正在发生的事情。您的一个单元测试有这两个

  • called System.exit(), or
  • 调用system . exit(),或
  • broken the unit test harness, or
  • 破坏单元测试套,或。
  • done something that has crashed the JVM in which it was running.
  • 做一些已经使它运行的JVM崩溃的事情。

We cannot tell you which it was.

我们不能告诉你是哪一个。

(I imagine that the problem is being reported because the maven JVM was expecting the child JVM to write the unit test results to its standard output. What it got back from the child was missing the message (or whatever) that said that the unit tests had finished. It is possible that the root cause might be different from the alternatives suggested, but I doubt it, and it is pointless speculating ...)

(我想象这个问题正在被报告,因为maven JVM期望子JVM将单元测试结果写入其标准输出。它从这个孩子那里得到的信息(或者其他什么)没有显示单元测试已经完成的消息。有可能根本的原因可能与所建议的不同,但我对此表示怀疑,这是毫无意义的推测……

There is possibly more information in the logfile for the offending unit test. Check that / them.

日志文件中可能有更多关于违规单元测试的信息。检查/他们。

#2


4  

I was facing the same issue while running maven goal "package". The issue was resolved when i executed the goal "clean" before executing "package"

在运行maven目标“包”时,我也遇到了同样的问题。当我在执行“包”之前执行“clean”目标时,问题得到了解决

#3


3  

I've had the same issue. Turned out I updated my libs without updating my java version, and I had a little too new servlet.jar. I found following message in the logs, prior to the 'forked VM bla exception':

我也有同样的问题。结果我更新了我的libs而没有更新我的java版本,而且我有一个新的servlet.jar。我在日志中找到以下信息,在“叉叉叉VM bla异常”之前:

Caused by: java.lang.UnsupportedClassVersionError: javax/servlet/ServletRequest : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getMethod0(Class.java:2670)
at java.lang.Class.getMethod(Class.java:1603)
at org.apache.maven.surefire.util.ReflectionUtils.tryGetMethod(ReflectionUtils.java:57)
at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.isSuiteOnly(JUnit3TestChecker.java:64)
at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.isValidJUnit3Test(JUnit3TestChecker.java:59)
at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.accept(JUnit3TestChecker.java:54)
at org.apache.maven.surefire.common.junit4.JUnit4TestChecker.accept(JUnit4TestChecker.java:51)
at org.apache.maven.surefire.util.DefaultScanResult.applyFilter(DefaultScanResult.java:97)
at org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:194)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:92)

Updating JVM helped.

更新JVM帮助。

#4


2  

I was having this same problem ONLY in jenkins as reported in the accepted answer and lost one hour to realize that the problem was that the jenkins job name had a space in it, this was making something (still don't know what) in the invocation of the surefire plugin go crazy since the job name is the folder inside the jenkins workspace where everything is.

我有这同样的问题只有在詹金斯报告在接受答案和失去一个小时必须意识到问题是詹金斯工作名称空间,这让(还不知道)的调用成功的插件疯狂工作以来的名字是詹金斯工作空间内的文件夹都在哪里。

So, to be clear, jenkins has nothing to do with the problem, I only saw it in jenkins because only there I had a space in my path

很明显,詹金斯与这个问题无关,我只在詹金斯身上看到,因为只有在我的道路上有一个空间。

I hope this helps someone else. This was under surefire 2.14.1 and 2.16.

我希望这能帮助别人。这是2。14.1和2。16。

#5


0  

This may have to do with Administrator rights. I was facing the same issue when running the build mvn clean install from Cygwin.

这可能与管理员权限有关。我在运行Cygwin的build mvn clean安装时也遇到了同样的问题。

Now everytime for build I start cygwin as "Run as administrator" and the problem is solved.

现在每次构建时,我都以“作为管理员运行”的方式启动cygwin,问题就解决了。