gpt4 book ai didi

java - 未找到 JAX-RS 的处理程序方法

转载 作者:行者123 更新时间:2023-12-02 12:28:13 24 4
gpt4 key购买 nike

我有一个资源 JAX-RS

@Path("/profile")
public class ProfileResource {

@GET
@Path(value = "/{username}")
public Response getProfile(
@PathParam("username") String username,
@Context UriInfo uriInfo
) throws URISyntaxException {
....
}
}



2017-07-29 20:37:41.940 DEBUG 4004 --- [nio-8080-exec-5] o.s.web.servlet.DispatcherServlet : Successfully completed request
2017-07-29 20:38:01.223 DEBUG 4004 --- [nio-8080-exec-7] o.s.web.servlet.DispatcherServlet : DispatcherServlet with name 'dispatcherServlet' processing GET request for [/profile/jonki]
2017-07-29 20:38:01.236 DEBUG 4004 --- [nio-8080-exec-7] s.w.s.m.m.a.RequestMappingHandlerMapping : Looking up handler method for path /profile/jonki
2017-07-29 20:38:01.236 DEBUG 4004 --- [nio-8080-exec-7] s.w.s.m.m.a.RequestMappingHandlerMapping : Did not find handler method for [/profile/jonki]
2017-07-29 20:38:01.237 DEBUG 4004 --- [nio-8080-exec-7] o.s.w.s.handler.SimpleUrlHandlerMapping : Matching patterns for request [/profile/jonki] are [/**]
2017-07-29 20:38:01.237 DEBUG 4004 --- [nio-8080-exec-7] o.s.w.s.handler.SimpleUrlHandlerMapping : URI Template variables for request [/profile/jonki] are {}
2017-07-29 20:38:01.237 DEBUG 4004 --- [nio-8080-exec-7] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapping [/profile/jonki] to HandlerExecutionChain with handler [ResourceHttpRequestHandler [locations=[ServletContext resource [/], class path resource [META-INF/resources/], class path resource [resources/], class path resource [static/], class path resource [public/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@36463b09]]] and 1 interceptor
2017-07-29 20:38:01.237 DEBUG 4004 --- [nio-8080-exec-7] o.s.web.servlet.DispatcherServlet : Last-Modified value for [/profile/jonki] is: -1
2017-07-29 20:38:01.238 DEBUG 4004 --- [nio-8080-exec-7] o.s.web.servlet.DispatcherServlet : Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
2017-07-29 20:38:01.238 DEBUG 4004 --- [nio-8080-exec-7] o.s.web.servlet.DispatcherServlet : Successfully completed request
2017-07-29 20:38:01.238 DEBUG 4004 --- [nio-8080-exec-7] o.s.web.servlet.DispatcherServlet : DispatcherServlet with name 'dispatcherServlet' processing GET request for [/error]
2017-07-29 20:38:01.239 DEBUG 4004 --- [nio-8080-exec-7] s.w.s.m.m.a.RequestMappingHandlerMapping : Looking up handler method for path /error

我没有找到 JAX-RS 的方法。我使用的是Spring Boot,没有做任何配置。

最佳答案

你无缘无故地混淆了技术。 Spring 有自己的 Web 框架,不需要 JAX-RS,而且 Spring Web 无论如何也不兼容 JAX-RS,这解释了为什么处理程序没有注册。请参阅this 。可以将 JAX-RS 与 Spring 依赖注入(inject)一起使用,但没有必要。请参阅this .

关于java - 未找到 JAX-RS 的处理程序方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45392795/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com