I'm deploying a worklight http adapter that has a single method to retrieve something from DB and it's mapped to path /foo/bar/1
In websphere console i can see that the my application has started and no errors in the logs, however when i invoke the adapter from a Mobile First App, i get this json response :
{
"errors": [
"Runtime: Failed to parse JSON string
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /foo/bar/1 was not found on this server.</p>
<hr>
<address>IBM_HTTP_Server at my.server.edu Port XXX</address>
</body></html>"
],
"info": [
],
"isSuccessful": false,
"warnings": [
]
}
I know the adapter is working, because it returns at least this error response. But the question is why my application is not found if i'm seeing it started in the websphere console? I have tried stopping it and starting it again and checked the deployment descriptor and looks fine.
<application id="Application_ID" version="5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" >
<display-name> myApp</display-name>
<module>
<web>
<web-uri> myApp.war</web-uri>
<context-root> foo</context-root>
</web>
</module>
</application>
After calling the adapter, in logs i can see
[Wed Jun 15 10:00:28 2016] [error] [client XX.XX.XXX.XXX] File does not exist: /opt/IBM/HTTPServer/htdocs/foo
XX.XX.XXX.XXX - - [15/Jun/2016:12:03:10 -0500] "GET /foo/bar/1 HTTP/1.1" 404 301
I have googled for info to troubleshoot but i still cannot figure out the root cause. Any help to continue troubleshooting it's appreciated.
The error_log entry means the WAS WebServer Plug-in (assuming it's configured in your Apache-based server) did not think it was responsible for the request to /foo.
Normally the plugin reads application context roots from plugin-cfg.xml which is generated on the applciation server. Is yours up to date on the webserver system and aware of /foo as a context root?