简体   繁体   English

我正在运行基于 java spring 引导框架的应用程序。 但得到这个错误。 你能帮我解决这个错误吗?

[英]I am running my application which is based java spring boot framework. but getting this error. Can you help me to resolve this error?

I am running my application which is based java spring boot framework.我正在运行基于 java spring 引导框架的应用程序。 basically i have more then one microservices and I want them to communicate using http rest.基本上我有不止一个微服务,我希望它们使用 http rest 进行通信。 but getting this error.但得到这个错误。 Can you help me to resolve this error??你能帮我解决这个错误吗?

'''2022-01-10 10:31:52.834 INFO 13740 --- [ main] com.accounts.account.AccountApplication: Started AccountApplication in 53.129 seconds (JVM running for 57.978) 2022-01-10 10:31:53.259 DEBUG 13740 --- [ main] osbaApplicationAvailabilityBean: Application availability state LivenessState changed to CORRECT 2022-01-10 10:31:53.274 DEBUG 13740 --- [ main] osbaApplicationAvailabilityBean: Application availability state ReadinessState changed to ACCEPTING_TRAFFIC 2022-01-10 10:32:42.838 INFO 13740 --- [nio-8080-exec-1] oac.c.C.[Tomcat].[localhost].[/]: Initializing Spring DispatcherServlet 'dispatcherServlet' 2022-01-10 10:32:42.838 INFO 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet: Initializing Servlet 'dispatcherServlet' 2022-01-10 '''2022-01-10 10:31:52.834 INFO 13740 --- [main] com.accounts.account.AccountApplication:在 53.129 秒内启动 AccountApplication(JVM 运行 57.978)2022-01-10 10:31:52。 DEBUG 13740 --- [ main] osbaApplicationAvailabilityBean: Application availability state LivenessState changed to CORRECT 2022-01-10 10:31:53.274 DEBUG 13740 --- [ main] osbaApplicationAvailabilityBean: Application availability state ReadinessState changed to ACCEPTING_TRAFFIC 2022-01-10 10 :32:42.838 INFO 13740 --- [nio-8080-exec-1] oac.c.C.[Tomcat].[localhost].[/]: Initializing Spring DispatcherServlet 'dispatcherServlet' 2022-01-10 10:32 :42.838 INFO 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet:初始化 Servlet 'dispatcherServlet' 2022-01-10 10:32:42.839 DEBUG 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet: Detected StandardServletMultipartResolver 2022-01-10 10:32:42.840 DEBUG 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet: Detected AcceptHeaderLocaleResolver 2022-01-10 10:32:42.841 DEBUG 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet: Detected FixedThemeResolver 2022-01-10 10:32:42.848 DEBUG 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet: Detected org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator@72a61e61 2022-01-10 10:32:42.850 DEBUG 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet: Detected org.springframework.web.servlet.support.SessionFlashMapManager@742dbac8 2022-01-10 10:32:42.851 DEBUG 13740 --- [nio-8080-exec-1] osZ2 10:32:42.839 调试 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet: 检测到 StandardServletMultipartResolver 2022-01-10 10:32:42.840 调试 13740-80 --- ] osweb.servlet.DispatcherServlet: Detected AcceptHeaderLocaleResolver 2022-01-10 10:32:42.841 DEBUG 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet: Detected FixedThemeResolver 2022-01-10 10:32: 42.848 DEBUG 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet: Detected org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator@72a61e61 2022-01-10 10:32:42.850 DEBUG 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet: Detected org.springframework.web.servlet.support.SessionFlashMapManager@742dbac8 2022-01-10 10:32:42.851 DEBUG 13740 --- [nio-8080-exec -1] osZ2 567A5EC9705EB7AC2C984033E06189DZ.servlet.DispatcherServlet: enableLoggingRequestDetails='false': request parameters and headers will be masked to prevent unsafe logging of potentially sensitive data 2022-01-10 10:32:42.852 INFO 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet: Completed initialization in 13 ms 2022-01-10 10:32:42.942 DEBUG 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet: GET "/", parameters={} 2022-01-10 10:32:43.030 DEBUG 13740 --- [nio-8080-exec-1] oswshandler.SimpleUrlHandlerMapping: Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]] 2022-01-10 10:32:43.046 DEBUG 13740 --- [nio-8080-exec-1] ojsOpenEntityManagerInViewInterceptor: Opening JPA EntityManager in OpenEntityManagerInViewInterceptor 2022-01-10 10:32:43.069 DEBUG 13740 --- [nio-8080-exec-1] 567A5EC9705EB7AC2C984033E06189DZ.servlet.DispatcherServlet:enableLoggingRequestDetails='false':请求参数和标头将被屏蔽以防止潜在敏感数据的不安全记录 2022-01-10 10:32:42.852 INFO 13740 --- [nio-8080-exec-1 ] osweb.servlet.DispatcherServlet: Completed initialization in 13 ms 2022-01-10 10:32:42.942 DEBUG 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet: GET "/", parameters={ 2022-01-10 10:32:43.030 调试 13740 --- [nio-8080-exec-1] oswshandler.SimpleUrlHandlerMapping:映射到 ResourceHttpRequestHandler [classpath [META-INF/resources/],classpath [resources/],classpath [静态/],类路径 [public/],ServletContext [/]] 2022-01-10 10:32:43.046 调试 13740 --- [nio-8080-exec-1] ojsOpenEntityManagerInViewInterceptor:在 OpenEntityManagerInViewInterceptor 中打开 JPA EntityManager -10 10:32:43.069 调试 13740 --- [nio-8080-exec-1] oswsr.ResourceHttpRequestHandler: Resource not found 2022-01-10 10:32:43.071 DEBUG 13740 --- [nio-8080-exec-1] ojsOpenEntityManagerInViewInterceptor: Closing JPA EntityManager in OpenEntityManagerInViewInterceptor 2022-01-10 10:32:43.072 DEBUG 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet: Completed 404 NOT_FOUND 2022-01-10 10:32:43.144 DEBUG 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet: "ERROR" dispatch for GET "/error", parameters={} 2022-01-10 10:32:43.229 DEBUG 13740 --- [nio-8080-exec-1] swsmmaRequestMappingHandlerMapping: Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#errorHtml(HttpServletRequest, HttpServletResponse) 2022-01-10 10:32:43.231 DEBUG 13740 --- [nio-8080-exec-1] ojsOpenEntityManagerInViewInterceptor: Opening JPA oswsr.ResourceHttpRequestHandler: Resource not found 2022-01-10 10:32:43.071 DEBUG 13740 --- [nio-8080-exec-1] ojsOpenEntityManagerInViewInterceptor: Closing JPA EntityManager in OpenEntityManagerInViewInterceptor 2022-01-10 10:32:43.072 DEBUG 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet: Completed 404 NOT_FOUND 2022-01-10 10:32:43.144 DEBUG 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet : GET "/error" 的 "ERROR" dispatch, parameters={} 2022-01-10 10:32:43.229 DEBUG 13740 --- [nio-8080-exec-1] swsmmaRequestMappingHandlerMapping: 映射到 org.springframework.boot。 autoconfigure.web.servlet.error.BasicErrorController#errorHtml(HttpServletRequest, HttpServletResponse) 2022-01-10 10:32:43.231 DEBUG 13740 --- [nio-8080-exec-1] ojsOpenEntityManagerInViewInterceptor: Opening JPA EntityManager in OpenEntityManagerInViewInterceptor 2022-01-10 10:32:43.750 DEBUG 13740 --- [nio-8080-exec-1] oswsvContentNegotiatingViewResolver: Selected 'text/html' given [text/html, text/html;q=0.8] 2022-01-10 10:32:43.790 DEBUG 13740 --- [nio-8080-exec-1] ojsOpenEntityManagerInViewInterceptor: Closing JPA EntityManager in OpenEntityManagerInViewInterceptor 2022-01-10 10:32:43.791 DEBUG 13740 --- [nio-8080-exec-1] osweb.servlet.DispatcherServlet: Exiting from "ERROR" dispatch, status 404''' OpenEntityManagerInViewInterceptor 中的 EntityManager 2022-01-10 10:32:43.750 调试 13740 --- [nio-8080-exec-1] oswsvContentNegotiatingViewResolver:给定 [text/html, text/html;q=0.8] 2022 -01-10 10:32:43.790 DEBUG 13740 --- [nio-8080-exec-1] ojsOpenEntityManagerInViewInterceptor: 关闭 JPA EntityManager 在 OpenEntityManagerInViewInterceptor 2022-01-10 10:32:40.791 exec-1] osweb.servlet.DispatcherServlet:退出“错误”调度,状态 404''' 在此处输入图像描述

From the code, it seems you are trying to retrieve an account based on the customer id.从代码中,您似乎正在尝试根据客户 ID 检索帐户。 In that case, it will be @GetMapping and not @PostMapping ( at line 12).在这种情况下,它将是 @GetMapping 而不是 @PostMapping(在第 12 行)。 Also, in case of get, we pass the variables in the url and not in the request body.此外,在获取的情况下,我们在 url 中传递变量,而不是在请求正文中。 As a coding practice, the className should start with a capital letter ( the return type of your method should be Account and not accounts )作为一种编码习惯,className 应该以大写字母开头(方法的返回类型应该是 Account 而不是 accounts)

@GetMapping("/myAccount/{id}


public Account AccountsGetAccountDetails(@PathVariable String id ) {}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我运行我的 Spring 引导应用程序时,我收到以下错误。 我正在使用 spring 启动版本 2.4.5 - While I am running my Spring Boot application, I am getting the below error. I am using spring boot version 2.4.5 当我运行 Spring 引导应用程序时,我收到以下错误。 我正在使用 spring 启动版本 2.3.1 - When I am running my Spring Boot application, I am getting the below error. I am using spring boot version 2.3.1 我正在尝试在 Java 中呈现一个蓝色方块,但出现 IllegalStateException 错误。 有人能帮我吗? - I'm Trying To Render A Blue Square In Java But I Am Getting A IllegalStateException Error. Can Someone Help Me? 我在 intellij 上运行 springboot 应用程序时出错。 有人能帮我吗? - I am getting an error running a springboot application on intellij. Can someone help me? 我的第一个休眠程序出现错误,请帮助我解决错误 - I am getting error for my first hibernate program, please help me to resolve the erros 当我启动Web Start应用程序时,出现以下错误。 请帮我 - When I launch an web start application i am geteng the following error. Please help me 第一次在 eclipse 中运行 spring 启动应用程序时,我收到错误警告。 我正在使用 JDK 14 - I am getting error warning while running first time spring boot application in eclipse. I am using JDK 14 我从Firebase获取数据并在TextView中显示它但我收到了一些错误。 任何人都可以检查我的代码并建议我 - I am getting data from Firebase and showing it in the TextView but I am getting some error. Can anyone please check out my code and suggest me 当我尝试在我的 maven 项目中使用 @ResController 时,它显示错误“RestController 无法解析为类型”。帮我解决这个问题 - When i am trying to use @ResController in my maven project it showing error “ RestController can not be resolved to a type”.Help me to resolve this 您可以为我的项目提供帮助吗? - can you help me with this error on my project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM