How to fix dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. while using maven surefire plugin 3.0.0-M4
Asked Answered
I

6

7

I got the below error while executing the command mvn clean test. Even though I changed the versions of the surefire plugin but still I'm facing the same error.

Error Log:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M4:test (default-test) on pr
oject info: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\Sheik Mohammed\eclipse-workspace\info\target\surefire-reports for the individua
l test results.
**Error 1:**
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
**Error 2:**
[ERROR] ExecutionException The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
**Error 3:**
[ERROR] Command was cmd.exe /X /C ""C:\Program Files\Java\jdk1.8.0_311\jre\bin\java" "-javaagent:C:\Users\Sheik
Mohammed\.m2\repository/org/aspectj/aspectjweaver/1.8.10/aspectjweaver-1.8.10.jar" "    -Dcucumber.options=--plu
gin io.qameta.allure.cucumber4jvm.AllureCucumber4Jvm"   --add-modules java.base ${argLine} -Xmx1024m -XX:MaxPerm
Size=256m org.apache.maven.surefire.booter.ForkedBooter "C:\Users\Sheik Mohammed\AppData\Local\Temp\surefire8647
270359642587079" 2022-02-27T09-33-26_575-jvmRun1 surefire8833373504517140594tmp surefire_08041519546226636871tmp
"
**Error 4:**
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 1
[ERROR] **org.apache.maven.surefire.booter.SurefireBooterForkException: ExecutionException The forked VM terminate
d without properly saying goodbye. VM crash or System.exit called?**
[ERROR] Command was cmd.exe /X /C ""C:\Program Files\Java\jdk1.8.0_311\jre\bin\java" "-javaagent:C:\Users\Sheik
Mohammed\.m2\repository/org/aspectj/aspectjweaver/1.8.10/aspectjweaver-1.8.10.jar" "    -Dcucumber.options=--plu
gin io.qameta.allure.cucumber4jvm.AllureCucumber4Jvm"   --add-modules java.base ${argLine} -Xmx1024m -XX:MaxPerm
Size=256m org.apache.maven.surefire.booter.ForkedBooter "C:\Users\Sheik Mohammed\AppData\Local\Temp\surefire8647
270359642587079" 2022-02-27T09-33-26_575-jvmRun1 surefire8833373504517140594tmp surefire_08041519546226636871tmp
"
[ERROR] Error occurred in starting fork, check output in log

pom.xml

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <aspectj.version>1.8.10</aspectj.version>
     <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

    <build>
    <plugins>
        <plugin>       
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.0.0-M4</version>
                   
            <configuration>
                <useSystemClassLoader>false</useSystemClassLoader>
                <forkedProcessExitTimeoutInSeconds>120</forkedProcessExitTimeoutInSeconds>
                <forkCount>3</forkCount>
                <reuseForks>true</reuseForks>    
                <argLine>
                    -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                    -Dcucumber.options="--plugin io.qameta.allure.cucumber4jvm.AllureCucumber4Jvm"
                    --add-modules java.base ${argLine} -Xmx1024m -XX:MaxPermSize=256m
                </argLine>
              
                <systemPropertyVariables>
                    <allure.results.directory>${project.build.directory}/allure-results</allure.results.directory>
                    <allure.link.issue.pattern>https://example.org/browse/{}</allure.link.issue.pattern>
                    <allure.link.tms.pattern>https://example.org/browse/{}</allure.link.tms.pattern>
                </systemPropertyVariables>
            </configuration>
            
            <dependencies>
                <!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
                <dependency>
                <groupId>org.aspectj</groupId>
                    <artifactId>aspectjweaver</artifactId>
                    <version>${aspectj.version}</version>

                </dependency>
                
            </dependencies>
        </plugin>
    </plugins>
  </build>

  <dependencies>
  
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
    </dependency>
    
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-java</artifactId>
      <version>3.141.59</version>
      <scope>compile</scope>
    </dependency>
    
    <dependency>
      <groupId>io.github.bonigarcia</groupId>
      <artifactId>webdrivermanager</artifactId>
      <version>4.2.2</version>
      <scope>compile</scope>
    </dependency>
    
    <dependency>
      <groupId>tech.grasshopper</groupId>
      <artifactId>extentreports-cucumber6-adapter</artifactId>
      <version>2.6.0</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>pdfbox2-layout</artifactId>
          <groupId>com.github.ralfstuckert.pdfbox-layout</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    
    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>6.14.3</version>
      <scope>test</scope>
    </dependency>
    
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.7.25</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.poi</groupId>
      <artifactId>poi</artifactId>
      <version>4.1.2</version>
      <scope>compile</scope>
    </dependency>
    
    <dependency>
      <groupId>org.apache.poi</groupId>
      <artifactId>poi-ooxml</artifactId>
      <version>4.1.2</version>
      <scope>compile</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
    <dependency>
    <groupId>io.cucumber</groupId>
    <artifactId>cucumber-java</artifactId>
    <version>4.8.1</version>
    </dependency>
    
    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-testng -->
    <dependency>
    <groupId>io.cucumber</groupId>
    <artifactId>cucumber-testng</artifactId>
    <version>4.8.1</version>
    </dependency>
    
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>6.9.0</version>
        <scope>test</scope>
    </dependency>
    
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-core</artifactId>
        <version>1.2.5</version>
    </dependency>
        
    <!-- https://mvnrepository.com/artifact/io.qameta.allure/allure-cucumber4-jvm -->
    <dependency>
    <groupId>io.qameta.allure</groupId>
    <artifactId>allure-cucumber4-jvm</artifactId>
    <version>2.13.3</version>
    </dependency>
    
    <!-- https://mvnrepository.com/artifact/io.qameta.allure/allure-maven -->
    <dependency>
    <groupId>io.qameta.allure</groupId>
    <artifactId>allure-maven</artifactId>
    <version>2.10.0</version>
    </dependency> 
    
     <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-testng</artifactId>
            <version>2.13.0</version>
     </dependency>
     
    <!-- <dependency>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire</artifactId>
     <version>3.0.0-M4</version>
     <type>pom</type>
     </dependency>-->
       
  </dependencies>
Indigestible answered 27/2, 2022 at 5:39 Comment(0)
C
17

You can try this: Add this code in the plugins section of your pom.xml

<plugin>  
    <groupId>org.apache.maven.plugins</groupId>  
    <artifactId>maven-surefire-plugin</artifactId>  
    <version>2.22.2</version>  
    <configuration>  
    <skipTests>true</skipTests>  
    </configuration>  
</plugin>  

You can see this link https://programmerah.com/solved-there-are-test-failures-please-refer-to-djava_studyspringbootspringboot-sugon-3targetsurefire-reports-for-the-individual-test-results-28892/

Chemosmosis answered 29/5, 2022 at 9:46 Comment(2)
The issue is that maven couldn't start the test runner forked JVM. And this answer tells to downgrade surefire-plugin version and to skip all tests. I'm sure that not running tests at all does avoid the issue, but it really defeats the purpose. As far as I can see what would be required is to investigate exactly what it says. Look at the failure for the fork startup, which means looking at those dump files, looking at the args being given, and probably also running it all in debug mode from Maven. – Forebode
take a look at this: issues.apache.org/jira/browse/SUREFIRE-1588 I'm having the same problem. And looks like it is not solved yet – Internalize
H
4

Solution 1: I encountered an error due to a failed unit test. To resolve this error, please review the failed unit test and ensure that it passes successfully, as fixing the test will bypass the error.

If you are experiencing an error in your Spring Boot application due to a failed unit test, the best approach is to identify and fix the issue causing the test failure.

Identify the failed unit test

Solution 2: If you are facing an error due to a failed unit test and you have this configuration in your pom.xml file to skip the test.

Add the plugin in your maven pom.xml

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <skipTests>true</skipTests>
            </configuration>
        </plugin>

I hope this helps! Let me know if you have any questions or if there's anything else I can assist you with.

Happy coding! πŸ‘¨β€πŸ’»

Hurtless answered 18/6, 2023 at 5:32 Comment(0)
F
1
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<skip>true</skip>
 </configuration>
</plugin>
Florey answered 16/7, 2022 at 12:17 Comment(3)
Remember that Stack Overflow isn't just intended to solve the immediate problem, but also to help future readers find solutions to similar problems, which requires understanding the underlying code. This is especially important for members of our community who are beginners, and not familiar with the syntax. Given that, can you edit your answer to include an explanation of what you're doing and why you believe it is the best approach? – Furze
Notably, what's the difference between <skip /> and <skipTests />, as used in @Leni Coulibaly's answer? – Furze
By setting <skipTests>true</skipTests>, the plugin will skip executing any tests. – Hurtless
V
1

I had this error and it happened because of a failed unit test. So, you just need to check the failed unit test and make it pass to bypass this error.

Vraisemblance answered 1/11, 2022 at 12:0 Comment(0)
G
0

Try this command:

mvn clean install -Dlogging.root=[filepath]\logs
Example
mvn clean install -Dlogging.root=C:\git_repo\payment-service\logs

Note: it won't skip any test cases.

Gaza answered 2/2 at 16:40 Comment(0)
A
-1

The problem can be solve by changing the environnement excecution of MVN.

Try this command:

- apt install locales-all
- update-locale LANG=fr_FR.UTF-8 LANGUAGE
- update-locale LC_TIME=fr_FR.UTF-8
- update-locale LANG="fr_FR.UTF-8" LANGUAGE="fr_FR"
- dpkg-reconfigure locales
- apt-get update >/dev/null
- apt-get install -y locales >/dev/null
- echo "fr_FR UTF-8" > /etc/locale.gen
- locale-gen fr_FR.UTF-8
- export LANG=fr_FR.UTF-8
- export LANGUAGE=fr_FR:fr
- export LC_ALL=fr_FR.UTF-8
Acrid answered 22/6, 2022 at 16:19 Comment(1)
Not related at all to this question.... – Vladi

© 2022 - 2024 β€” McMap. All rights reserved.