当前位置: 首页 > 知识库问答 >
问题:

我试图测试我的存储库,但最终得到了这个错误

袁俊弼
2023-03-14

java.lang.IllegalStateException:未能加载ApplicationContext

at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:132)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:124)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:118)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
at org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance(SpringBootDependencyInjectionTestExecutionListener.java:43)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:248)
at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:138)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$8(ClassBasedTestDescriptor.java:363)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:368)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$9(ClassBasedTestDescriptor.java:363)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310)
at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735)
at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:362)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$instantiateAndPostProcessTestInstance$6(ClassBasedTestDescriptor.java:283)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:282)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$4(ClassBasedTestDescriptor.java:272)
at java.base/java.util.Optional.orElseGet(Optional.java:364)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$5(ClassBasedTestDescriptor.java:271)
at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:102)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:101)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:66)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$2(NodeTestTask.java:123)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:123)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:90)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71)
at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)

原因:org . spring framework . beans . factory . unsatisfieddependencyexception:创建在URL[jar:file:/C:/Users/MDI vya/. m2/repository/io/spring fox/spring fox-spring-web/2 . 7 . 0/spring fox-spring-we b-2 . 7 . 0 . jar中定义的名为' documentationplugins bootstrapper '的bean时出错!/spring fox/documentation/spring/web/plugins/documentation plugins bootstrapper . class]:通过构造函数参数6表示的不满足的依赖关系;嵌套异常为org . spring framework . beans . factory . nosuchbeandetificationonexception:没有类型为“javax.servlet.ServletContext”的合格bean可用:应至少有一个符合autowire候选资格的bean。依赖项注释:{ } at org . spring framework . beans . factory . support . constructor resolver . createargumentarray(constructor resolver . Java:800)at org . spring framework . beans . factory . support . constructor resolver . autowire constructor(constructor resolver . Java:229)at org . spring framework . beans . factory . support . abstractautowirecablebean factory . autowire constructor(abcapablebean factory . Java:1372)at org . spring framework . beans . support . abstractautowire capablebean fact...72更多原因:org . spring framework . beans . factory . nosuchbeandetification异常:没有类型为“javax.servlet.ServletContext”的合格bean可用:至少应有一个符合autowire候选资格的bean。依赖项注释:{ } at org . spring framework . beans . factory . support . defaultlistablebeanfactory . raisenomatchingbeanfactory(defaultlistablebeanfactory . Java:1799)at org . spring framework . beans . factory . support . defaultlistablebeanfactory . doresolvedention(defaultlistablebeanfactory . Java:1355)at org . spring framework . beans . factory . support . defaultlistablebeanfactory . resolved dependency(defaultlistablebeanfactory . Java:1309)at org . spring framework . beans...90多

共有1个答案

邓建柏
2023-03-14

您的POM文件中似乎有spingfox(swagger API),请检查您的配置文件中的Swagger。

 类似资料:
  • 在C:\用户\戴尔\桌面\项目\my-app中创建新的React应用。 安装包。这可能需要几分钟。使用cra模板安装反应、反应-多姆和反应-脚本... NPM ERR!最大调用堆栈大小超过npm ERR!超出最大调用堆栈大小 NPM ERR!此运行的完整日志可以在npm ERR中找到!C:\用户\戴尔\AppData\漫游\npmcache_logs\2020-09-05T07_43_27_276

  • > 我尝试使用react添加Seach过滤器,并使用json数据将其与搜索词匹配 以下是我的代码 常量应用 = () = 使用效果(()= }, []); 返回 ( );}; 当我试图执行时,我得到了下面的错误,有人能解释为什么会发生这种情况吗

  • 我试图在webGL中构建我的游戏,但我得到了这个错误 找不到文件“C:\users----\OneDrive\Documents\Endless\Runner\Temp\StagingArea\Data\Native\Build.bc” 我对unity和stackoverflow很陌生,所以不要对我太苛刻。

  • 在Flatter中实现facebook登录后,我出现了这些错误。我的代码无法执行 e:C:/Users/HP/。gradle/caches/transforms-2/files-2.1/0c02c09b68f8e9b24bbbea025e769c0c/jetified-facebook-core-12.2.0-api。罐子/META-INF/facebook-core_发布。kotlin_模块:模

  • 下面是我的代码: java.lang.runtimeException:无法启动活动ComponentInfo{com.example.auditoriamedica/com.example.auditoriamedica.views.principal}:java.lang.IllegalStateException:findViewById(r.id.nav_view)在Android.app

  • 我正在尝试使用flutter构建一个应用程序。当我尝试运行此推荐“flutter build appbundle”时,我收到以下错误: 失败:构建失败,但有例外。 > 其中:构建文件'F:\azabaza_app\myapp\android\app\build.gradle'行:28 错误:评估项目“app”时出现问题。 无法为FlutterExtension类型的扩展“flutter”获取未知属