当我运行mvn spring-boot:run -log
时,会出现此错误https://goo.gl/xQS5vY(我放入Google云端硬盘,因为字符数已超出限制)。
有人可以帮助我吗?
感谢。
@Edited 该日志有四个不同的文件,我不知道我在帖子中放了什么部分,但链接来自谷歌驱动器,它们只有4个文本文件(https://drive.google.com/folderview?id=0BwijxlJDuqYBfjRFY0t3Q2NuR1IzbVRHWmVjaHhoMGwxZDVvQXNhcjdmUzdDbjR2VGVFVEk&usp=sharing)。这是错误的一部分
Test set: test6.service.UserServiceTest
Tests run: 6, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 5.407 sec
<<< FAILURE! - in test6.service.UserServiceTest assertThatOnlyActivatedUserCanRequestPasswordReset(test6.service.UserServiceTest) Time elapsed: 0.001 sec <<< ERROR! java.lang.IllegalStateException: Failed to load ApplicationContext at
org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:94) at
org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72) at
org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117) at
org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83) at
org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212) at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:200) at
... (snipped some lines)
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:/C:/Users/t.taraczuk/.m2/repository/io/springfox/springfox-swagger2/2.0.3/springfox-swagger2-2.0.3.jar!/springfox/documentation/swagger2/mappers/LicenseMapper$License.class]; nested exception is java.lang.UnsupportedClassVersionError: org/mapstruct/Qualifier : Unsupported major.minor version 52.0 at
org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:303) at
org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:248) at
org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:140) at
(... snipped some lines)
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264) at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124) at
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200) at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: java.lang.UnsupportedClassVersionError: org/mapstruct/Qualifier : Unsupported major.minor version 52.0 at
java.lang.ClassLoader.defineClass1(Native Method) at
java.lang.ClassLoader.defineClass(ClassLoader.java:800) at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at
java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at
java.net.URLClassLoader.access$100(URLClassLoader.java:71) at
java.net.URLClassLoader$1.run(URLClassLoader.java:361) at
java.net.URLClassLoader$1.run(URLClassLoader.java:355) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:354) at
java.lang.ClassLoader.loadClass(ClassLoader.java:425) at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at
java.lang.ClassLoader.loadClass(ClassLoader.java:358)
答案 0 :(得分:0)
正如评论中所见,但无论如何你只需要阅读堆栈跟踪:这是因为你没有安装正确的Java版本。