I'm facing this weird issue. I have a web application deployed on Tomcat server. I'm trying to call the services of this app through postman. Some services work fine but for some Tomcat gives the below logs -
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
I searched both the server and application logs. Nothing is there to indicate the cause. And all the debug logs in my application are printed successfully which makes me think that there is no problem with my application but with the server configuration. Please help me with possible solutions.
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>