我有一个SpringBoot项目,所有测试都运行得很好。但今天Intellij开始提出错误“测试框架意外退出”。
它可能是什么?
环境:
idea.log - 最后一行:
2017-05-16 20:01:34,597 [3596101] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stdout]: Build process started. Classpath: C:/Program Files/JetBrains/IntelliJ IDEA 2017.1.2/lib/jps-launcher.jar;C:/Program Files/Java/jdk1.8.0_111/lib/tools.jar;C:/Program Files/JetBrains/IntelliJ IDEA 2017.1.2/lib/optimizedFileManager.jar
2017-05-16 20:01:34,681 [3596185] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
2017-05-16 20:01:34,681 [3596185] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: Defaulting to no-operation (NOP) logger implementation
2017-05-16 20:01:34,682 [3596186] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2017-05-16 20:04:23,492 [3764996] INFO - ution.rmi.RemoteProcessSupport - Terminating: 17210/Maven3ServerImpl69bd6bce
2017-05-16 20:04:23,542 [3765046] INFO - stubs.SerializationManagerImpl - START StubSerializationManager SHUTDOWN
2017-05-16 20:04:23,543 [3765047] INFO - stubs.SerializationManagerImpl - END StubSerializationManager SHUTDOWN
2017-05-16 20:04:23,544 [3765048] INFO - org.jetbrains.io.BuiltInServer - web server stopped
2017-05-16 20:04:23,552 [3765056] INFO - Types.impl.FileTypeManagerImpl - FileTypeManager: 242 auto-detected files
Elapsed time on auto-detect: 25584 ms
2017-05-16 20:04:23,574 [3765078] INFO - pl.local.NativeFileWatcherImpl - Watcher terminated with exit code 0
2017-05-16 20:04:23,575 [3765079] INFO - il.indexing.FileBasedIndexImpl - START INDEX SHUTDOWN
2017-05-16 20:04:23,921 [3765425] INFO - il.indexing.FileBasedIndexImpl - END INDEX SHUTDOWN
2017-05-16 20:04:23,937 [3765441] INFO - newvfs.persistent.PersistentFS - VFS dispose started
2017-05-16 20:04:24,078 [3765582] INFO - newvfs.persistent.PersistentFS - VFS dispose completed
2017-05-16 20:04:24,085 [3765589] INFO - #com.intellij.idea.Main - ------------------------------------------------------ IDE SHUTDOWN ------------------------------------------------------
2017-05-16 20:04:24,092 [3765596] INFO - org.jetbrains.io.BuiltInServer - web server stopped
的pom.xml
<?xml version="1.0" encoding="UTF-8"?>
http://maven.apache.org/xsd/maven-4.0.0.xsd“&GT; 4.0.0
<groupId>br.com.e2pd</groupId>
<artifactId>controle-processos</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<description>Controle de processos para advogados</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<jjwt.version>0.7.0</jjwt.version>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<findbugs-maven-plugin.version>3.0.4</findbugs-maven-plugin.version>
<docker-maven-plugin.version>0.4.13</docker-maven-plugin.version>
<commons-lang3-version>3.5</commons-lang3-version>
<rest-assured-version>2.8.0</rest-assured-version>
<spring-security-test-version>4.2.2.RELEASE</spring-security-test-version>
<jsonassert-version>1.5.0</jsonassert-version>
<maven-failsafe-plugin-version>2.19.1</maven-failsafe-plugin-version>
<springfox-swagger2-version>2.6.1</springfox-swagger2-version>
<springfox-swagger-ui-version>2.6.1</springfox-swagger-ui-version>
<caelum-stella-version>2.1.2</caelum-stella-version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.RELEASE</version>
<relativePath/>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!--<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.mobile</groupId>
<artifactId>spring-mobile-device</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jjwt.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>com.jayway.restassured</groupId>
<artifactId>rest-assured</artifactId>
<version>${rest-assured-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<version>${spring-security-test-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
<version>${jsonassert-version}</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox-swagger2-version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${springfox-swagger-ui-version}</version>
<scope>compile</scope>
</dependency>
<!--Dependencias do Stella https://github.com/caelum/caelum-stella/-->
<dependency>
<groupId>br.com.caelum.stella</groupId>
<artifactId>caelum-stella-core</artifactId>
<version>${caelum-stella-version}</version>
</dependency>
<dependency>
<groupId>br.com.caelum.stella</groupId>
<artifactId>caelum-stella-bean-validation</artifactId>
<version>${caelum-stella-version}</version>
</dependency>
<dependency>
<groupId>br.com.caelum.stella</groupId>
<artifactId>caelum-stella-hibernate-user-types</artifactId>
<version>${caelum-stella-version}</version>
</dependency>
<dependency>
<groupId>br.com.caelum.stella</groupId>
<artifactId>caelum-stella-boleto</artifactId>
<version>${caelum-stella-version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin-version}</version>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<phase>verify</phase>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>pre-integration-test</id>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>post-integration-test</id>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker-maven-plugin.version}</version>
<configuration>
<imageName>e2pd/controle-processos</imageName>
<baseImage>openjdk:8</baseImage>
<imageTags>
<imageTag>${project.version}</imageTag>
<imageTag>latest</imageTag>
</imageTags>
<entryPoint>["java", "-jar", "/${project.build.finalName}.jar"]</entryPoint>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
<serverId>docker-hub</serverId>
<registryUrl>https://index.docker.io/v1/</registryUrl>
</configuration>
</plugin>
</plugins>
</build>
我尝试了命令 mvn clean verify ,测试正在运行且输出为:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:16 min
[INFO] Finished at: 2017-05-16T21:02:13-03:00
[INFO] Final Memory: 86M/717M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.19.1:integration-test (default) on project controle-processos: Execution default of goal org.apache.maven.plugins:maven-failsafe-plugin:2.19.1:integration-test failed: There was an error in the forked process
[ERROR] java.lang.NoClassDefFoundError: br/com/e2pd/exceptions/BairroException
[ERROR] at java.lang.Class.getDeclaredMethods0(Native Method)
[ERROR] at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
[ERROR] at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
[ERROR] at java.lang.Class.getMethod0(Class.java:3018)
[ERROR] at java.lang.Class.getMethod(Class.java:1784)
[ERROR] at org.apache.maven.surefire.util.ReflectionUtils.tryGetMethod(ReflectionUtils.java:61)
[ERROR] at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.isSuiteOnly(JUnit3TestChecker.java:64)
[ERROR] at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.isValidJUnit3Test(JUnit3TestChecker.java:59)
[ERROR] at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.accept(JUnit3TestChecker.java:54)
[ERROR] at org.apache.maven.surefire.common.junit4.JUnit4TestChecker.accept(JUnit4TestChecker.java:52)
[ERROR] at org.apache.maven.surefire.util.DefaultScanResult.applyFilter(DefaultScanResult.java:98)
[ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:311)
[ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.setTestsToRun(JUnit4Provider.java:191)
[ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:134)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
[ERROR] Caused by: java.lang.ClassNotFoundException: br.com.e2pd.exceptions.BairroException
[ERROR] at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[ERROR] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[ERROR] ... 17 more
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
2017-05-16 21:02:13 - Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@24bdd5bc: startup date [Tue May 16 21:01:45 BRT 2017]; root of context hierarchy
2017-05-16 21:02:13 - Stopping beans in phase 2147483647
2017-05-16 21:02:13 - Stopping beans in phase 0
2017-05-16 21:02:13 - Unregistering JMX-exposed beans on shutdown
2017-05-16 21:02:13 - Closing JPA EntityManagerFactory for persistence unit 'default'