Search code examples
javawebspherewebsphere-7

WebSphere error 404 SRVE0295E


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)


Solution

  • 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 the WEB-INF folder, and ensuring that enable-file-serving is set to true.