I have just finished coding webservices. I need to be able to debug the webservice load path. When I sudo restart service tomcat7
, the /var/log/tomcat7/catalina.2014-09-29.log
provides us with the package path for the webservice
INFO: Scanning for root resource and provider classes in the packages:
com.swipex.backend.webservices
INFO: Root resource classes found:
class com.swipex.backend.webservices.Registration
class com.swipex.backend.webservices.Activation
When I run the junit test code to call these webservices, on running I get /var/log/tomcat7/localhost_access_log.2014-09-29.txt
"POST /SwipeXBackEnd/backend/Activation/Request HTTP/1.1" 404 1049
web.xml
<xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>de.vogella.jersey.jaxb</display-name>
<servlet>
<servlet-name>SwipeXBackendServices</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.swipex.backend.webservices</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>SwipeXBackendServices</servlet-name>
<url-pattern>/backend/*</url-pattern>
</servlet-mapping>
</web-app>
Calling http://localhost:8080/SwipeXBackEnd/backend/Activation/Request
from junit, I get
com.sun.jersey.api.client.UniformInterfaceException: POST http://localhost:8080/SwipeXBackEnd/backend/Activation/Request returned a response status of 304 Not Modified
Calling http://localhost:8080/Activation/Request
from junit, I get
com.sun.jersey.api.client.UniformInterfaceException: POST http://localhost:8080/Activation/Request returned a response status of 404 Not Found
Is there a log file that verifies if the path /SwipeXBackEnd/backend/Activation/Request
is correct for class com.swipex.backend.webservices.Activation
I was not able to find any log file that has the load path defined. I surely hope someone can point it out. But I did find that the log4j prints into catalina.out. This is good enough to know for now, since this is where we can check if our load path got access via a junit test.
Junit Test
catalina.out : Here al log4j are printed
catalina.2014.. date : Here if your webservices load, you will notice something like this.
Here you will also notice errors on the webserivces when you restart tomcat.
localhost.2014-date : Here if there is a load issue, you will notice some errors.