“Forked Java VM exited abnormally” error from junit tests

前端 未结 17 1657
[愿得一人]
[愿得一人] 2020-12-08 18:22

I have a java junit test that passes when run alone on a development machine. We also have a hudson job which runs all the tests, invoked via ant, on a Mac OS X 10.4 node wi

相关标签:
17条回答
  • 2020-12-08 19:10

    I faced similar issue while running the tests on Jenkins, same tests were passing locally.

    I was able resolve the issue by setting log level to WARN

    0 讨论(0)
  • 2020-12-08 19:10

    I added TestNG library to the Test Libraries and it fixed the issue.

    0 讨论(0)
  • 2020-12-08 19:18

    Is the VM crashing ? Can you find a dump file (called hs_err_pid*.log) ? If that's the case, the dump file will give you clues to why this is crashing out.

    0 讨论(0)
  • 2020-12-08 19:21

    I had the exact same thing a while back. The problem is that System.exit() is being called somewhere. It can be difficult to find though, as the call could come from either your code or one of the libraries you use.

    0 讨论(0)
  • 2020-12-08 19:22

    I had this problem and it turns out that the process was actually calling System.exit(). However there was also a bug in Ant where this was showing up sometimes. I think Ant 1.7.1 has the bug fixed. So make sure you are running that version.

    0 讨论(0)
  • 2020-12-08 19:22

    I had this issue too. Changing the junit task from:

    <batchtest fork="yes" ... /> 
    

    to

    <batchtest fork="no" ... /> 
    

    fixed it for me. I don't fully understand this area of ant though or why doing this would fix it. In my scenario it was an error in "BeforeFirstTest" and I think it barfs because of two ant files in my classpath (which is probably what I ought to fix)

    I think the issue is with one of the versions of ant: http://track.pmease.com/browse/QB-500;jsessionid=C1CF6999CBBDB5097A9CFCF4A11AF6C0?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

    ETA: I think batchtest="no" actually changes the classpath and hence results in exclusion of my offending ant jar.

    0 讨论(0)
提交回复
热议问题