private final String PNG_PATH = "cache/windowsTiles/";
private final String FULL_PNG_PATH = Play.application().path().getPath() + "/" + PNG_PATH;
but i'm having the following error:
play.api.UnexpectedException: Unexpected exception[ProvisionException: Unable to provision, see the following errors:
1) Error injecting constructor, java.lang.RuntimeException: There is no started application
at controllers.WindowsTiles.<init>(WindowsTiles.java:31)
while locating controllers.WindowsTiles
for parameter 2 at router.Routes.<init>(Routes.scala:60)
while locating router.Routes
while locating play.api.inject.RoutesProvider
while locating play.api.routing.Router
for parameter 0 at play.api.http.JavaCompatibleHttpRequestHandler.<init>(HttpRequestHandler.scala:197)
while locating play.api.http.JavaCompatibleHttpRequestHandler
while locating play.api.http.HttpRequestHandler
for parameter 4 at play.api.DefaultApplication.<init>(Application.scala:240)
at play.api.DefaultApplication.class(Application.scala:240)
while locating play.api.DefaultApplication
while locating play.api.Application
It was working in Play 2.3.
Anyone got an idea of how I can instantiate a bunch of constants after the application has started ?
To be honest I'm having a hard time making the transition to 2.4 and the dependency injection system even though I read the documentation, it's really not clear for me.
Regards,
Paul.
I'm trying to set up some file path based on the Play.application().path() in a controller like following:
private final String PNG_PATH = "cache/windowsTiles/";
private final String FULL_PNG_PATH = Play.application().path().getPath() + "/" + PNG_PATH;