Play Framework application "can not find a template" when deployed to geroku

I wrote an application that runs locally without problems

after deploying the application to Heroku when I try to enter a specific page, I get the following error (taken from the log):

  • 2012-02-29T00: 11: 53 + 00: 00 application [web.1]: Internal server error (500) for request GET / Application / adminPage
  • 2012-02-29T00: 11: 53 + 00: 00 application [web.1]: the template was not found (in / app / controllers / Application.java near line 78)
  • 2012-02-29T00: 11: 53 + 00: 00 application [web.1]:
  • 2012-02-29T00: 11: 53 + 00: 00 application [web.1]: at play.mvc.Controller.renderTemplate (Controller.java:667)
  • 2012-02-29T00: 11: 53 + 00: 00 application [web.1]:
  • 2012-02-29T00: 11: 53 + 00: 00 app [web.1]: play.exceptions.TemplateNotFoundException: Template not found: Application / admin.html 2012-02-29T00: 11: 53 + 00: 00 application [ web.1]: Application / admin.html template does not exist.

/app/controllers/Application.java around line 78:

public static void admin(){ List<MailUSer> allUsers = MailUSer.findAll(); render(allUsers); } 

route file:

 # Home page GET / Application.index GET / module:secure POST /Register/welcome Register.welcome GET /Application/adminPage Application.admin # Ignore favicon requests GET /favicon.ico 404 # Map static resources from the /app/public folder to the /public path GET /public/ staticDir:public # Catch all * /{controller}/{action} {controller}.{action} 

what am I doing wrong?

+6
source share
2 answers

I had this problem on Heroku and it was case insensitive.

In my controller, I had something like

 public static void showUser(Long id) { ... render(user); } 

but in my browse folder I had

 app/views/Application/showuser.html 

This is fine on my Mac and Windows, but on Linux machines, including Heroku, the showUser.html file showUser.html not be found.

+8
source

Try to troubleshoot using the following items:

  • Have you downloaded the view folder in the app in Heroku?
  • Do you have problems with the registers in your file and directory names (say, Application/admin.html is different from Application/admin.html , etc.)? When you are on the Windows platform, this is normal, but when you connect the application to the linux / unix environment, it will break your application.

By the way, MailUSer looks weird, why not MailUSer ?

+4
source

Source: https://habr.com/ru/post/909593/


All Articles