-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Play! to RePlay migration] play.exceptions.UnexpectedException: Failed to read $PWD/conf/application.conf
at startup
#198
Comments
play.exceptions.UnexpectedException: Failed to read $PWD/conf/application.conf
play.exceptions.UnexpectedException: Failed to read $PWD/conf/application.conf
at startup
…framework#198) in case when they don't exits in the working directory. Running RePlay apps in a distributed form (zip, tar, docker) the working directory doesn't always contain the conf/ directory, but the classpath.
…framework#198) in case when they don't exists in the working directory. Running RePlay apps in a distributed form (zip, tar, docker) the working directory doesn't always contain the conf/ directory, but the classpath.
…framework#198) in case when they don't exists in the working directory. Running RePlay apps in a distributed form (zip, tar, docker) the conf/ directory doesn't always exists in the working directory, but in the classpath.
…framework#198) in case when they don't exists in the working directory. Running RePlay apps in a distributed form (zip, tar, docker) the conf/ directory doesn't always exists in the working directory, but in the classpath.
…framework#198) in case when they don't exists in the working directory. Running RePlay apps in a distributed form (zip, tar, docker) the conf/ directory doesn't always exists in the working directory, but in the classpath.
…framework#198) in case when they don't exists in the working directory. Running RePlay apps in a distributed form (zip, tar, docker) the conf/ directory doesn't always exists in the working directory, but in the classpath. Fixes: replay-framework#198
…-framework#198) in case they don't exists in the working directory. Running RePlay apps in a distributed form (zip, tar, docker) the conf/ directory doesn't always exists in the working directory, but in the classpath. Fixes: replay-framework#198
…-framework#198) in case they don't exists in the working directory. Running RePlay apps in a distributed form (zip, tar, docker) the conf/ directory doesn't always exists in the working directory, but in the classpath. Fixes: replay-framework#198
…l file) it allows users to extract route files to modules (a jar file added to the project as a dependency).
…ly from local file) it allows users to extract conf files to modules (a jar file added to the project as a dependency).
…ng templates * Now `Play.appRoot` has type `File` * `Play.applicationPath` was removed because it's the same as `Play.appRoot`
…ocal file) it allows users to extract template files to modules (a jar file added to the project as a dependency).
I created an example repo to describe my problems: Example project for RePlay! issue #198 It's still in progress, but one could play with
|
@xabolcs I tried to clone the repo.
|
Thanks for looking into it. It's still in "development" 😅 For the 1. point, it related to #65 (and it's related issues) - I didn't care much for using the empty sample app. The example repo is at a decision point when one have to choose how deal with the old/current behavior - RePlay framework searches One way to solve this is to "fix" the distribution tasks (the The other way to solve this is to teach the RePlay framework to check not the
So I didn't choose a workaround yet because it could influence the fix itself. |
@xabolcs It's much simpler than you think. And everything you need to make Gradle support these folder is this piece in sourceSets {
main {
java {srcDir "app"}
resources {srcDir "app"}
resources {srcDir 'conf'}
}
test {
java {srcDir "test"}
}
} |
I thought I tried this "define the |
…l file) it allows users to extract route files to modules (a jar file added to the project as a dependency).
…ly from local file) it allows users to extract conf files to modules (a jar file added to the project as a dependency).
…ng templates * Now `Play.appRoot` has type `File` * `Play.applicationPath` was removed because it's the same as `Play.appRoot`
…ocal file) it allows users to extract template files to modules (a jar file added to the project as a dependency).
…l file) it allows users to extract route files to modules (a jar file added to the project as a dependency).
…ly from local file) it allows users to extract conf files to modules (a jar file added to the project as a dependency).
…ng templates * Now `Play.appRoot` has type `File` * `Play.applicationPath` was removed because it's the same as `Play.appRoot`
…ocal file) it allows users to extract template files to modules (a jar file added to the project as a dependency).
Re-Play 2.4.0 - bumped Java requirement to 17 - moved from group 'com.codeborne.replay' to 'io.github.replay-framework' - started to require 'application.conf' being on the classpath For the latter see replay-framework/replay#198
Re-Play 2.4.0 - bumped Java requirement to 17 - moved from group 'com.codeborne.replay' to 'io.github.replay-framework' - started to require 'application.conf' being on the classpath For the latter see replay-framework/replay#198
Modify "multi-module-app" test to use the "conf/" directory: - conf/application.conf - conf/routes To achieve this let move the "conf/" directory (which location is defined in replay-tests.gradle) to the default resources location: "src/main/resources/". With this change these files would be at classpath "conf/application.conf" and "conf/routes", NullPointerException: HelloWorldSpec > openHelloWorldPage() FAILED java.lang.NullPointerException: File not found in classpath: application.conf at java.base/java.util.Objects.requireNonNull(Objects.java:336) at play.ClasspathResource.<init>(ClasspathResource.java:42) at play.ClasspathResource.file(ClasspathResource.java:26) at play.PropertiesConfLoader.readOneConfigurationFile(PropertiesConfLoader.java:34) at play.PropertiesConfLoader.readOneConfigurationFile(PropertiesConfLoader.java:30) at play.PropertiesConfLoader.readConfiguration(PropertiesConfLoader.java:26) at play.Play.readConfiguration(Play.java:230) at play.Play.init(Play.java:138) at play.server.Starter.start(Starter.java:19) at hello.HelloWorldApp.start(HelloWorldApp.java:7) at ui.hello.BaseSpec.startApp(BaseSpec.java:23) at ui.hello.BaseSpec.setUp(BaseSpec.java:17) Ref: replay-framework#198
to ease migration from Play1 projects. Modify "multi-module-app" test to work from "conf/" directory: - use "conf/application.conf" for configuration - use "conf/routes" for routes This is an advanced setup, so play.server.Starter couldn't help. While at it, fix README about Criminals example project. Ref: replay-framework#198
Modify "multi-module-app" test to use the "conf/" directory: - conf/application.conf - conf/routes To achieve this let move the "conf/" directory (which location is defined in replay-tests.gradle) to the default resources location: "src/main/resources/". With this change these files would be at classpath "conf/application.conf" and "conf/routes", causing NullPointerException HelloWorldSpec > openHelloWorldPage() FAILED java.lang.NullPointerException: File not found in classpath: application.conf at java.base/java.util.Objects.requireNonNull(Objects.java:336) at play.ClasspathResource.<init>(ClasspathResource.java:42) at play.ClasspathResource.file(ClasspathResource.java:26) at play.PropertiesConfLoader.readOneConfigurationFile(PropertiesConfLoader.java:34) at play.PropertiesConfLoader.readOneConfigurationFile(PropertiesConfLoader.java:30) at play.PropertiesConfLoader.readConfiguration(PropertiesConfLoader.java:26) at play.Play.readConfiguration(Play.java:230) at play.Play.init(Play.java:138) at play.server.Starter.start(Starter.java:19) at hello.HelloWorldApp.start(HelloWorldApp.java:7) at ui.hello.BaseSpec.startApp(BaseSpec.java:23) at ui.hello.BaseSpec.setUp(BaseSpec.java:17) Ref: replay-framework#198
to ease migration from Play1 projects. Modify "multi-module-app" test to work from "conf/" directory: - use "conf/application.conf" for configuration - use "conf/routes" for routes This is an advanced setup, so play.server.Starter couldn't help. While at it, fix README about Criminals example project. Ref: replay-framework#198
From the codeborne/replay gitter.im channel:
@xabolcs wrote:
Using the application plugin (
id: 'application'
) and running the extracted application from thebuild/distributions/app
dir:@xabolcs wrote:
@asolntsev wrote:
It would be nice if the RePlay framework would be able to resolve the
conf/
directory through the classpath in the case it doesn't exists in the working directory. In that case it would be easy to addconf/
dir to the classpath through thesourceSets.main.resources
. The following example fills theresources
build directory without definingresources
in the project:The text was updated successfully, but these errors were encountered: