无法在Spring Boot应用中通过浏览器访问http:入站网关映射

时间:2018-07-30 16:35:11

标签: spring spring-mvc spring-boot spring-integration

我是使用Spring Boot和Spring Integration的新手。当我使用Postman之类的工具时,它可以正常工作,但是我想从浏览器中请求并访问我的http:inbound-gateway映射。

这是我的Application.java:

@SpringBootApplication
@ImportResource("classpath:springintegration-config.xml")
@EnableSwagger2
public class Application extends SpringBootServletInitializer implements WebApplicationInitializer {

    public void onStartup(ServletContext container) throws ServletException {
        AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
        context.setServletContext(container);
        ServletRegistration.Dynamic servlet = container.addServlet("dispatcher", new DispatcherServlet(context));
        servlet.setLoadOnStartup(1);
        servlet.addMapping("/*");
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Application.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

这是我的int-http:inbound-gateway:

<int-http:inbound-gateway request-channel="requestChannel" reply-channel="outputChannel"
    supported-methods="GET" path="/welcome/{name}" payload-expression="#pathVariables.name">
    <int-http:request-mapping consumes="application/json" produces="application/json" />        
</int-http:inbound-gateway>

从浏览器尝试时出现错误:

{
   "uuid": "500",
   "error": "Internal Server Error",
   "errorDescription": "Oops! Something went wrong…"
}



DEBUG||nio-9290-exec-1(48)||Initializing servlet 'dispatcherServlet'
INFO||nio-9290-exec-1(48)||FrameworkServlet 'dispatcherServlet': initialization started
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'multipartResolver'
DEBUG||nio-9290-exec-1(48)||Using MultipartResolver [org.springframework.web.multipart.support.StandardServletMultipartResolver@7a8b7e11]
DEBUG||nio-9290-exec-1(48)||Creating instance of bean 'org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringServiceAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringRestControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAsyncAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringServiceAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringRestControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAsyncAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringServiceAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringRestControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAsyncAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
DEBUG||nio-9290-exec-1(48)||Finished creating instance of bean 'org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver'
DEBUG||nio-9290-exec-1(48)||Unable to locate LocaleResolver with name 'localeResolver': using default [org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver@1ce677b0]
DEBUG||nio-9290-exec-1(48)||Creating instance of bean 'org.springframework.web.servlet.theme.FixedThemeResolver'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringServiceAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringRestControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAsyncAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringServiceAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringRestControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAsyncAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringServiceAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringRestControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAsyncAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
DEBUG||nio-9290-exec-1(48)||Finished creating instance of bean 'org.springframework.web.servlet.theme.FixedThemeResolver'
DEBUG||nio-9290-exec-1(48)||Unable to locate ThemeResolver with name 'themeResolver': using default [org.springframework.web.servlet.theme.FixedThemeResolver@165a6b9b]
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'requestMappingHandlerMapping'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'viewControllerHandlerMapping'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'beanNameHandlerMapping'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'resourceHandlerMapping'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'defaultServletHandlerMapping'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'faviconHandlerMapping'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'welcomePageHandlerMapping'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'integrationRequestMappingHandlerMapping'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'requestMappingHandlerAdapter'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'httpRequestHandlerAdapter'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'simpleControllerHandlerAdapter'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'errorAttributes'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'handlerExceptionResolver'
DEBUG||nio-9290-exec-1(48)||Creating instance of bean 'org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringServiceAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringRestControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAsyncAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringServiceAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringRestControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAsyncAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringServiceAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringRestControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAsyncAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
DEBUG||nio-9290-exec-1(48)||Finished creating instance of bean 'org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator'
DEBUG||nio-9290-exec-1(48)||Unable to locate RequestToViewNameTranslator with name 'viewNameTranslator': using default [org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator@45bf0d5b]
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'beanNameViewResolver'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'mvcViewResolver'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'defaultViewResolver'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'viewResolver'
DEBUG||nio-9290-exec-1(48)||Creating instance of bean 'org.springframework.web.servlet.support.SessionFlashMapManager'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringServiceAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringRestControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAsyncAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringServiceAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringRestControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAsyncAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringServiceAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringRestControllerAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'monitoringSpringAsyncAdvisor'
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
DEBUG||nio-9290-exec-1(48)||Finished creating instance of bean 'org.springframework.web.servlet.support.SessionFlashMapManager'
DEBUG||nio-9290-exec-1(48)||Unable to locate FlashMapManager with name 'flashMapManager': using default [org.springframework.web.servlet.support.SessionFlashMapManager@1917a53d]
DEBUG||nio-9290-exec-1(48)||Published WebApplicationContext of servlet 'dispatcherServlet' as ServletContext attribute with name [org.springframework.web.servlet.FrameworkServlet.CONTEXT.dispatcherServlet]
INFO||nio-9290-exec-1(48)||FrameworkServlet 'dispatcherServlet': initialization completed in 63 ms
DEBUG||nio-9290-exec-1(48)||Servlet 'dispatcherServlet' configured successfully
DEBUG||nio-9290-exec-1(48)||Could not find key 'appName:datamiddleware' in any property source
DEBUG||nio-9290-exec-1(48)||Could not find key 'appName' in any property source
DEBUG||nio-9290-exec-1(48)||Found key 'spring.application.name' in PropertySource 'applicationConfig: [classpath:/application-dev.yml]' with value of type String
DEBUG||nio-9290-exec-1(48)||Bound request context to thread: org.apache.catalina.connector.RequestFacade@647174a9
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'springSecurityFilterChain'
DEBUG||nio-9290-exec-1(48)||Trying to match using Ant [pattern='/css/**']
DEBUG||nio-9290-exec-1(48)||Checking match of request : '/welcome/so_user'; against '/css/**'
DEBUG||nio-9290-exec-1(48)||Trying to match using Ant [pattern='/js/**']
DEBUG||nio-9290-exec-1(48)||Checking match of request : '/welcome/so_user'; against '/js/**'
DEBUG||nio-9290-exec-1(48)||Trying to match using Ant [pattern='/images/**']
DEBUG||nio-9290-exec-1(48)||Checking match of request : '/welcome/so_user'; against '/images/**'
DEBUG||nio-9290-exec-1(48)||Trying to match using Ant [pattern='/webjars/**']
DEBUG||nio-9290-exec-1(48)||Checking match of request : '/welcome/so_user'; against '/webjars/**'
DEBUG||nio-9290-exec-1(48)||Trying to match using Ant [pattern='/**/favicon.ico']
DEBUG||nio-9290-exec-1(48)||Checking match of request : '/welcome/so_user'; against '/**/favicon.ico'
DEBUG||nio-9290-exec-1(48)||Trying to match using Ant [pattern='/error']
DEBUG||nio-9290-exec-1(48)||Checking match of request : '/welcome/so_user'; against '/error'
DEBUG||nio-9290-exec-1(48)||No matches found
DEBUG||nio-9290-exec-1(48)||Checking match of request : '/welcome/so_user'; against '/management/**'
DEBUG||nio-9290-exec-1(48)||/welcome/so_user has no matching filters
DEBUG||nio-9290-exec-1(48)||DispatcherServlet with name 'dispatcherServlet' processing GET request for [/welcome/so_user]
DEBUG||nio-9290-exec-1(48)||Looking up handler method for path /welcome/so_user
DEBUG||nio-9290-exec-1(48)||Did not find handler method for [/welcome/so_user]
DEBUG||nio-9290-exec-1(48)||Looking up handler method for path /welcome/so_user
DEBUG||nio-9290-exec-1(48)||Resolving exception from handler [null]: org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'null' not supported
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'genericExceptionHandler'
DEBUG||nio-9290-exec-1(48)||Invoking @ExceptionHandler method: public com.accor.tars.socle.module.api.exceptions.ErrorInfo<java.lang.String> com.accor.tars.socle.module.api.exceptions.GenericExceptionHandler.handleThrowable(java.lang.Throwable)

ERROR||nio-9290-exec-1(48)||Throwable#Content type 'null' not supported#org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping.handleNoMatch(RequestMappingInfoHandlerMapping.java:221)#org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.lookupHandlerMethod(AbstractHandlerMethodMapping.java:374)#org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.getHandlerInternal(AbstractHandlerMethodMapping.java:314)#org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.getHandlerInternal(AbstractHandlerMethodMapping.java:61)#org.springframework.web.servlet.handler.AbstractHandlerMapping.getHandler(AbstractHandlerMapping.java:352)#org.springframework.web.servlet.DispatcherServlet.getHandler(DispatcherServlet.java:1160)#org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:940)#org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)#org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)#org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)#javax.servlet.http.HttpServlet.service(HttpServlet.java:635)#org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)#javax.servlet.http.HttpServlet.service(HttpServlet.java:742)#org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)#org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)#org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)#org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)#org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)#org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)#org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)#org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)#org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)#net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:232)#net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:209)#org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)#org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)#org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:110)#org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)#org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)#org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)#org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:208)#org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)#org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)#org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)#org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)#org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)#org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)#org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)#org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)#org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)#org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:108)#org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)#org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)#org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)#org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)#org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)#org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)#org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)#com.accor.tars.socle.module.correlation.tracing.CorrelationIdServletFilter.doFilter(CorrelationIdServletFilter.java:61)#org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)#org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)#brave.servlet.TracingFilter.doFilter(TracingFilter.java:76)#com.accor.tars.socle.module.correlation.tracing.TracingDelegateServletFilter.doFilter(TracingDelegateServletFilter.java:36)#org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)#org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)#org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)#org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)#org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)#org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)#org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106)#org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)#org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)#org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)#org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)#org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)#org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)#org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)#org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)#org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)#org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)#org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)#org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)#org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)#org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)#org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)#org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)#java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)#java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)#org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)#java.lang.Thread.run(Thread.java:748)
DEBUG||nio-9290-exec-1(48)||Written [com.accor.tars.socle.module.api.exceptions.ErrorInfo@74f3ff04] as "application/json" using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@43cf5bff]
DEBUG||nio-9290-exec-1(48)||Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
DEBUG||nio-9290-exec-1(48)||Successfully completed request
DEBUG||nio-9290-exec-1(48)||Returning cached instance of singleton bean 'delegatingApplicationListener'
DEBUG||nio-9290-exec-1(48)||Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@647174a9
DEBUG||nio-9290-exec-1(48)||Finishing injecting tracing parameters in the response header value

2 个答案:

答案 0 :(得分:1)

您正在向int **ppX2; mx.getMxByArg(ppX2); 发送HTTP GET请求,但是显示了/robots.txt的映射。

您可以为/welcome/{name}类别打开DEBUG日志记录,并分析日志以确定服务器上可用的内容和方式。

org.springframework是客户请求。这与服务器端完全无关。

答案 1 :(得分:1)

ERROR||nio-9290-exec-1(48)||Throwable#Content type 'null' not supported

由服务器抛出,因为它期望的内容类型为application/json,而不是浏览器请求的内容类型。我通过删除consumes="application/json"中的int-http:request-mapping解决了这个问题。

即使删除onStartupconfigure方法后,我仍然不明白为什么它能正常工作?