The approach presented below has risks. Changes are being made to the Tomcat Server which may prevent it from working correctly. Always backup any files before making changes. Always test the updates in a development environment. The recommended approach would be to change the mashup navigation to address the issue.
For your education (Use at your own risk).
The Message “404- Entity Not found” is generated from the application server (Tomcat)
The file which defines the message is located at: <tomcat director>/webapps/Thingworx/WEB-INF/web.xml.
It contains something like:
<!-- 404 error handling -->
<servlet>
<servlet-name>PageNotFoundExceptionHandler</servlet-name>
<servlet-class>com.thingworx.handlers.PageNotFoundExceptionHandler</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>PageNotFoundExceptionHandler</servlet-name>
<url-pattern>/PageNotFoundExceptionHandler</url-pattern>
</servlet-mapping>
<error-page>
<error-code>404</error-code>
<location>/PageNotFoundExceptionHandler</location>
</error-page>
This could be changed to access a different page for the error message:
<error-page>
<error-code>404</error-code>
<location>/Custom404Error.html</location>
</error-page
The file need to be placed in the “Thingworx” directory.
The file Custom404Error.html can contain normal HTML items such as:
<!doctype html>
<title>Thingworx Error Page</title>
<style>
body { text-align: center; padding: 50px; background-color:#2d2d2d; color:#fff; }
h1 { font-size: 40px; text-align:center; }
body { font: 16px Helvetica, sans-serif; color: #fff;text-align:center;}
article { display: block; text-align: left; width: 850px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #fff; text-decoration: none; }
p{text-align:center;}
</style>
<article>
<div align=”center”>
<img src="ThingworxLogo.png" alt="ThingWorx Logo" width=”200px”>
</div>
<h1>Page access is denied</h1>
<div>
<p>The page you are trying to access does not exist or you do not have the privliges to access that page.</p>
<p></p><hr>
<p>Go back to <a href=”https://www.ptc.com/”>ptc.com</a></p>
</div>
</article>
This sample page contains reference to a graphic file “ThingworxLogo.png”. The location which will be searched for this file is the same directory which contains the HTML file. This is provided as a sample and not intended to describe all possible approaches.