首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我正在运行我的应用程序,它是基于java spring引导框架的。但却犯了这个错误。你能帮我解决这个错误吗?

我正在运行我的应用程序,它是基于java spring引导框架的。但却犯了这个错误。你能帮我解决这个错误吗?
EN

Stack Overflow用户
提问于 2022-01-10 06:16:34
回答 1查看 2.4K关注 0票数 0

我正在运行我的应用程序,它是基于java引导框架的。基本上,我有不止一个微服务,我希望他们使用http进行通信。但却犯了这个错误。你能帮我解决这个错误吗??

代码语言:javascript
复制
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] o.s.b.a.ApplicationAvailabilityBean      : Application availability state LivenessState changed to CORRECT
2022-01-10 10:31:53.274 DEBUG 13740 --- [           main] o.s.b.a.ApplicationAvailabilityBean      : Application availability state ReadinessState changed to ACCEPTING_TRAFFIC
2022-01-10 10:32:42.838  INFO 13740 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-01-10 10:32:42.838  INFO 13740 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2022-01-10 10:32:42.839 DEBUG 13740 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Detected StandardServletMultipartResolver
2022-01-10 10:32:42.840 DEBUG 13740 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Detected AcceptHeaderLocaleResolver
2022-01-10 10:32:42.841 DEBUG 13740 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Detected FixedThemeResolver
2022-01-10 10:32:42.848 DEBUG 13740 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Detected org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator@72a61e61
2022-01-10 10:32:42.850 DEBUG 13740 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Detected org.springframework.web.servlet.support.SessionFlashMapManager@742dbac8
2022-01-10 10:32:42.851 DEBUG 13740 --- [nio-8080-exec-1] o.s.web.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] o.s.web.servlet.DispatcherServlet        : Completed initialization in 13 ms
2022-01-10 10:32:42.942 DEBUG 13740 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : GET "/", parameters={}
2022-01-10 10:32:43.030 DEBUG 13740 --- [nio-8080-exec-1] o.s.w.s.handler.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] o.j.s.OpenEntityManagerInViewInterceptor : Opening JPA EntityManager in OpenEntityManagerInViewInterceptor
2022-01-10 10:32:43.069 DEBUG 13740 --- [nio-8080-exec-1] o.s.w.s.r.ResourceHttpRequestHandler     : Resource not found
2022-01-10 10:32:43.071 DEBUG 13740 --- [nio-8080-exec-1] o.j.s.OpenEntityManagerInViewInterceptor : Closing JPA EntityManager in OpenEntityManagerInViewInterceptor
2022-01-10 10:32:43.072 DEBUG 13740 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed 404 NOT_FOUND
2022-01-10 10:32:43.144 DEBUG 13740 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : "ERROR" dispatch for GET "/error", parameters={}
2022-01-10 10:32:43.229 DEBUG 13740 --- [nio-8080-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : 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] o.j.s.OpenEntityManagerInViewInterceptor : Opening JPA EntityManager in OpenEntityManagerInViewInterceptor
2022-01-10 10:32:43.750 DEBUG 13740 --- [nio-8080-exec-1] o.s.w.s.v.ContentNegotiatingViewResolver : Selected 'text/html' given [text/html, text/html;q=0.8]
2022-01-10 10:32:43.790 DEBUG 13740 --- [nio-8080-exec-1] o.j.s.OpenEntityManagerInViewInterceptor : Closing JPA EntityManager in OpenEntityManagerInViewInterceptor
2022-01-10 10:32:43.791 DEBUG 13740 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Exiting from "ERROR" dispatch, status 404

EN

回答 1

Stack Overflow用户

发布于 2022-01-10 06:30:13

从代码中,您似乎试图根据客户id检索一个帐户。在这种情况下,它将是@GetMapping,而不是@PostMapping (在第12行)。另外,在get的情况下,我们在url中传递变量,而不是在请求体中传递。作为编码实践,className应该以大写字母开头(您的方法的返回类型应该是帐户而不是帐户)

代码语言:javascript
复制
@GetMapping("/myAccount/{id}


public Account AccountsGetAccountDetails(@PathVariable String id ) {}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70648492

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档