Perforce Public Knowledge Base - Commons FileNotFoundException: tmpl/*.html
× PRODUCTS SOLUTIONS CUSTOMERS LEARN SUPPORT
Downloads Company Partners Careers Contact Free Trials
Menu Search
Perforce
Reset Search
 

 

Article

Commons FileNotFoundException: tmpl/*.html

« Go Back

Information

 
Problem

On navigating to the Commons page your browser displays an error like this:

 
HTTP ERROR 500

Problem accessing /login. Reason:

     tmpl/login.html

Caused by:

java.io.FileNotFoundException: tmpl/login.html
at org.springframework.web.servlet.view.mustache.MustacheTemplateLoader.getTemplate(MustacheTemplateLoader.java:41) 
at org.springframework.web.servlet.view.mustache.MustacheViewResolver.buildView(MustacheViewResolver.java:55)
at org.springframework.web.servlet.view.UrlBasedViewResolver.loadView(UrlBasedViewResolver.java:436) 
.....

Usually your Commons server was working fine before this error occurs.

Other "tmpl" files may be within the FileNotFoundException , such as about.html, commons.html, or commons_ui.html.

A 500 error with a ClassNotFoundException may also be caused by the same root cause.  To confirm the same root cause, unpack the contents of commons.war and verify the exception's missing class exists in the war.  If the class exists in the war file, the root cause is the same.

Solution

To resolve, the Commons web server must be restarted.  As the cause likely affects the other Commons web apps,  restart them all.

Cause

Someone or something deleted the Commons application's unpacked war files.

Each Commons' application context xml file contains the element to unpack the war file.  For Jetty, the location of the unpacked files is usually either $(jetty.home)/work or $(java.io.tmpdir).  Reference:  Jetty's Temporary Directories documentation.
 

Your jetty instance's startup command may not define jetty.home nor java.io.tmpdir or the work subdirectory does not exist.  If so, the usual location for the tmpdir is /tmp.  Many sysadmins regularly purge old files from /tmp;  this can then delete the unpacked files.

This in unlikely to happen with other web servers, such as Tomcat, since they do not by detault unpack to /tmp.

Once the unpacked file(s) are deleted you will encounter the error(s) above.

Long Term Solution

The long term solution is to either:

  • never delete the jetty unpacked war files under /tmp
  • define an alternate location for the unpacked war

To define an alternate location: 

  • If your startup script does not define the jetty.home property, add -Djetty.home=/path/to/jetty_home.  Do this for each of the four Commons jetty instances' startup commands. 
  • Create the work subdirectory (/path/to/jetty_home/work) with permissions allowing the jetty process owner full access to the directory.   On restart, jetty will unpack to this new location.
 

OVA notes

A VM based on commons.ova assumes you will not be deleting the files in /tmp so no action should be necessary.  If you do need to move the files out of /tmp, create the directory /opt/jetty/work with permissions allowing user 'jetty' full access; the init.d startup scripts already define jetty.home for you.

Sample unpacked war file directories on a commons.ova based VM:

 
root@dhcp-35-n101:/opt/jetty# ls -l /tmp/jetty*
total 4488
drwxr-xr-x 4 jetty jetty    4096 Oct  7 19:25 jetty-0.0.0.0-8443-commons.war-_-any-
drwxr-xr-x 4 jetty jetty    4096 Sep 17 16:14 jetty-0.0.0.0-9003-p4combine.war-_-any-
drwxr-xr-x 4 jetty jetty    4096 Sep 17 16:14 jetty-0.0.0.0-9004-p4preview.war-_-any-
drwxr-xr-x 4 jetty jetty    4096 Sep 17 16:14 jetty-0.0.0.0-9005-pdfcompare.war-_-any-
Related Links

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255