这些是我正在使用的版本和依赖项,我怀疑版本需要更改,但我不确定更改为什么
springCore : '5.3.3',
springjdbc : '5.3.3',
springContext : '5.3.3',
springTest : '5.3.3',
springWeb : '5.3.3',
springWebmvc : '5.3.3',
springDataJpa : '2.3.3.RELEASE',
springBootdataJpa : '2.3.3.RELEASE',
bootStarterTomcat : '2.3.3.RELEASE',
bootStarterTest : '2.3.3.RELEASE',
springBoot : '2.3.3.RELEASE',
springBootWeb : '2.3.3.RELEASE',
bootStarterTest : "org.springframework.boot:spring-boot-starter-test:$versions.bootStarterTest",
springWebmvc : "org.springframework:spring-webmvc:$versions.springWebmvc",
springContext : "org.springframework:spring-context:$versions.springContext",
springTest : "org.springframework:spring-test:$versions.springTest",
bootStarterTomcat : "org.springframework.boot:spring-boot-starter-tomcat:$versions.bootStarterTomcat",
springWeb : "org.springframework:spring-web:$versions.springWeb",
springDataJpa : "org.springframework.data:spring-data-jpa:$versions.springDataJpa",
springBootdataJpa : "org.springframework.boot:spring-boot-starter-data-jpa:$versions.springBootdataJpa",
springCore : "org.springframework:spring-core:$versions.springCore",
springjdbc : "org.springframework:spring-jdbc:$versions.springjdbc",
springBoot : "org.springframework.boot:spring-boot-starter-web:$versions.springBoot",
springBootWeb : "org.springframework.boot:spring-boot-starter-web:$versions.springBootWeb",
我在java.lang.noclassdeffounderror:org/springframework/core/nativedetector中尝试过这个解决方案,但仍然得到相同的错误。还尝试了spring boot classnotfoundexception org.springframework.core.metrics.applicationstartup中的解决方案。还是不走运
添加错误跟踪
org/springframework/core/nativedetector java.lang.noclassdeffounderror:org/springframework/core/nativedetector位于org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.(abstractautowirecapablebeanfactory)。java:180)位于org.springframework.beans.factory.support.defaultlistablebeanfactory。(defaultlistablebeanfactory。java:193) 位于org.springframework.context.support.genericapplicationcontext.(genericapplicationcontext。java:113)位于org.springframework.test.context.support.abstractgenericcontextloader.createcontext(abstractgenericcontextloader)。java:210)在org.springframework.test.context.support.abstractgenericcontextloader.loadcontext(abstractgenericcontextloader)。java:113)位于org.springframework.test.context.support.abstractgenericcontextloader.loadcontext(abstractgenericcontextloader)。java:60)在org.springframework.test.context.support.abstractdelegatingsmartcontextloader.delegateloading(abstractdelegatingsmartcontextloader)。java:275)位于org.springframework.test.context.support.abstractdelegatingsmartcontextloader.loadcontext(abstractdelegatingsmartcontextloader)。java:251)在org.springframework.test.context.cache.defaultcacheawarecontextloaderdelegate.loadcontextinternal(defaultcacheawarecontextloaderdelegate)。java:99)在org.springframework.test.context.cache.defaultcacheawarecontextloaderdelegate.loadcontext(defaultcacheawarecontextloaderdelegate。java:124)在org.springframework.test.context.support.defaulttestcontext.getapplicationcontext(defaulttestcontext)。java:124)位于org.springframework.test.context.support.dependencyinjectiontestexecutionlistener.injectdependencies(dependencyinjectiontestexecutionlistener)。java:118)在org.springframework.test.context.support.dependencyinjectiontestexecutionlistener.preparetestinstance(dependencyinjectiontestexecutionlistener)。java:83)在org.springframework.test.context.testcontextmanager.preparetestinstance(testcontextmanager。java:244)在org.springframework.test.context.testng.abstracttestngspringcontexttests.springtestcontextpreparetestinstance(abstracttestngspringcontexttests)。java:149)位于java.base/jdk.internal.reflect.nativemethodaccessorimpl.invoke0(本机方法),位于java.base/jdk.internal.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl)。java:62)在java.base/jdk.internal.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl。java:43)在java.base/java.lang.reflect.method.invoke(method。java:566)在org.testng.internal.methodinvocationhelper.invokemethod(methodinvocationhelper。java:134)在org.testng.internal.methodinvocationhelper.invokemethodconsideringtimeout(methodinvocationhelper)。java:63)在org.testng.internal.configinvoker.invokeconfigurationmethod(configinvoker。java:348)在org.testng.internal.configinvoker.invokeconfigurations(configinvoker。java:302)在org.testng.internal.testmethodworker.invokebeforeclassmethods(testmethodworker)。java:176)在org.testng.internal.testmethodworker.run(testmethodworker。java:122)在java.base/java.util.arraylist.foreach(arraylist。java:1541)在org.testng.testrunner.privaterun(testrunner。java:766)在org.testng.testrunner.run(testrunner。java:587)在org.testng.suiterunner.runtest(suiterunner。java:384)在org.testng.suiterunner.runsequential(suiterunner。java:378)在org.testng.suiterunner.privaterun(suiterunner。java:337)在org.testng.suiterunner.run(suiterunner。java:286)在org.testng.suiterunnerworker.runsuite(suiterunnerworker。java:53)在org.testng.suiterunnerworker.run(suiterunnerworker。java:96)在org.testng.testng.runsuitessequentially(testng。java:1187)在org.testng.testng.runsuiteslocally(testng。java:1109)在org.testng.testng.runsuites(testng。java:1039)在org.testng.testng.run(testng。java:1007)在org.gradle.api.internal.tasks.testing.testng.testngtestclassprocessor.runtests(testngtestclassprocessor。java:141)在org.gradle.api.internal.tasks.testing.testng.testngtestclassprocessor.stop(testngtestclassprocessor。java:90)在org.gradle.api.internal.tasks.testing.suitetestclassprocessor.stop(suitetestclassprocessor。java:61)在java.base/jdk.internal.reflect.nativemethodaccessorimpl.invoke0(本机方法)位于java.base/jdk.internal.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl)。java:62)在java.base/jdk.internal.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl。java:43)在java.base/java.lang.reflect.method.invoke(method。java:566) 在org.gradle.internal.dispatch.reflectiondispatch.dispatch(reflectiondispatch。java:36)在org.gradle.internal.dispatch.reflectiondispatch.dispatch(reflectiondispatch。java:24)在org.gradle.internal.dispatch.contextclassloaderdispatch.dispatch(contextclassloaderdispatch。java:33)在org.gradle.internal.dispatch.proxydispatchadapter$dispatchinginvocationhandler.invoke(proxydispatchadapter)。java:94)com.sun.proxy.$proxy5.stop(未知源)org.gradle.api.internal.tasks.testing.worker.testworker.stop(testworker)。java:133)位于java.base/jdk.internal.reflect.nativemethodaccessorimpl.invoke0(本机方法)java.base/jdk.internal.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl。java:62)在java.base/jdk.internal.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl。java:43)在java.base/java.lang.reflect.method.invoke(method。java:566)在org.gradle.internal.dispatch.reflectiondispatch.dispatch(reflectiondispatch。java:36)在org.gradle.internal.dispatch.reflectiondispatch.dispatch(reflectiondispatch。java:24)在org.gradle.internal.remote.internal.hub.messagehubbackedobjectconnection$dispatchwrapper.dispatch(messagehubbackedobjectconnection)。java:182)在org.gradle.internal.remote.internal.hub.messagehubbackedobjectconnection$dispatchwrapper.dispatch(messagehubbackedobjectconnection)。java:164)在org.gradle.internal.remote.internal.hub.messagehub$handler.run(messagehub。java:414)在org.gradle.internal.concurrent.executorpolicy$catchandrecordfailures.onexecute(executorpolicy。java:64)在org.gradle.internal.concurrent.managedexecutorimpl$1.run(managedexecutorimpl。java:48)位于java.base/java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor。java:1128)在java.base/java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor。java:628)在org.gradle.internal.concurrent.threadfactoryimpl$managedthreadrunnable.run(线程工厂impl。java:56)在java.base/java.lang.thread.run(thread。java:834)原因:java.lang.classnotfoundexception:org.springframework.core.nativedetector at java.base/jdk.internal.loader.builtinclassloader.loadclass(builtinclassloader)。java:581)在java.base/jdk.internal.loader.classloaders$appclassloader.loadclass(类加载器。java:178)在java.base/java.lang.classloader.loadclass(classloader。java:521) ... 66个以上
任何建议。
1条答案
按热度按时间b91juud31#
我认为您使用了错误的版本,所以请尝试使用SpringV-5.3.4,因为该版本的springframework中存在class->org/springframework/core/nativedetector。