Action Not Found For request 'GET /' These routes have been tried, in this order: Play Framework

986 Views Asked by At

Migrating from sbt 0.13.0 to 1.3.0,scala 2.10.3 to 2.12.3 and play Version from 2.2.6 to 2.6.6

Below is the description of my problem

Caused by: java.lang.RuntimeException: java.io.IOException: resource not found on classpath: conf/application.conf #6507

I got the above error so I understood that application.conf file is missing so added application.conf an empty file in conf directory in project root directory . Actually my project has application.conf file under : project/modules/core/conf folder.

After adding a conf file under root directory I am getting the below error:

http://localhost:9000 - Action Not Found
For request 'GET /'

These routes have been tried, in this order:

In sbt console :

[warn] p.db.DBModule - Configuration not found for database: No configuration setting found for key 'db'
[info] p.a.h.EnabledFilters - Enabled Filters (see https://www.playframework.com/documentation/latest/Filters):

play.filters.csrf.CSRFFilter
play.filters.headers.SecurityHeadersFilter
play.filters.hosts.AllowedHostsFilter
[info] play.api.Play - Application started (Dev) (no global state)
2

There are 2 best solutions below

1
Simon On

Try starting sbt with the flags which point it to the correct application.conf.

Include the flag -Dconfig.resource="path/application.conf" when starting the project.

That should sort the DB errors if your config is correct...

https://www.playframework.com/documentation/2.8.x/ConfigFile?

1
olimath On

This works for me

play.filters.hosts.allowed += "."