I've got a strange problem where an application I'm deploying to WebSphere can't seem to access its resources. I can access the main page just fine, but when index.jsp tries to reference the Javascript file it relies on, it gets a 404. Specifically, "Error 404: SRVE0295E: Error reported: 404".
The Javascript is referenced as <script type="text/javascript" src="/contextRoot/someDir/scripts/myJavascript.js"></script>
The main entry page for the site is located at http://localhost:9080/contextRoot/index.jsp
and it loads fine.
If I try to navigate my browser to http://localhost:9080/contextRoot/someDir/scripts/myJavascript.js
I get Error 404: SRVE0295E
, even though the path to the file in my WebSphere installed application $myCell/myApp.ear/myWARModule.war/index.jsp
and $myCell/myApp.ear/myWARModule.war/someDir/scripts/myJavascript.js
are both valid, the only resource I can access from a browser is index.jsp
.
Does anyone know what could cause this error?
(Running on WebSphere 7.0.0.29)
To serve static files like images, html, or javascript application needs to have file serving enabled. You can do it by editing
ibm-web-ext.xml
file in theWEB-INF
folder, and ensuring thatenable-file-serving
is set totrue
.