我正面临着这个奇怪的问题。我在Tomcat服务器上部署了一个Web应用程序。我正在尝试通过邮递员致电此应用程序的服务。某些服务可以正常工作,但是对于某些Tomcat,它提供以下日志-
27-Sep-2018 05:33:17.773 INFO [http-nio-8080-exec-5]
org.glassfish.jersey.filter.LoggingFilter.log 5 * Server responded with a
response on thread http-nio-8080-exec-5
5 < 200
5 < Content-Type: application/json
27-Sep-2018 05:33:17.867 INFO [http-nio-8080-exec-5]
org.glassfish.jersey.filter.LoggingFilter.log 6 * Server responded with a
response on thread http-nio-8080-exec-5
6 < 500
我同时搜索了服务器和应用程序日志。没有任何指示原因的信息。而且我的应用程序中的所有调试日志都已成功打印,这使我认为应用程序没有问题,但服务器配置没有问题。请帮助我提供可能的解决方案。
Web.xml-
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<distributable />
<display-name>afrasia-services</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext-rest.xml
</param-value>
</context-param>
<context-param>
<param-name>log4j-config-location</param-name>
<param-value>classpath:log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<!-- START AUTHORIZATION: Spring OAuth2 -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- END AUTHORIZATION -->
<filter>
<filter-name>cors</filter-name>
<filter-class>com.afrAsia.filters.CORSFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>cors</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- servlet> <servlet-name>DigitalTransaction</servlet-name> <servlet-class>com.sun.xml.ws.transport.http.servlet.WSSpringServlet</servlet-class>
</servlet> <servlet-mapping> <servlet-name>DigitalTransaction</servlet-name>
<url-pattern>/*</url-pattern> </servlet-mapping -->
<servlet>
<servlet-name>REST-Project</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.afrAsia.rest,com.fasterxml.jackson.jaxrs.json</param-value>
</init-param>
<init-param>
<param-name>jersey.config.server.provider.classnames</param-name>
<param-value>org.glassfish.jersey.filter.LoggingFilter;org.glassfish.jersey.media.multipart.MultiPartFeature</param-value>
</init-param>
<init-param>
<param-name>dispatchOptionsRequest</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>REST-Project</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/oauth/token</url-pattern>
<url-pattern>/*/request_otp</url-pattern>
<url-pattern>/*/sign_in</url-pattern>
<url-pattern>/*/*</url-pattern>
</servlet-mapping>
</web-app>