Ratpack Deployment using Gradle distZip

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Ratpack Deployment using Gradle distZip

julian
I tried the following steps to deploy a Ratpack app:

lazybones create ratpack myApp
cd myApp
./gradlew distZip
unzip build/distributions/myApp.zip -d ~/temp
cd ~/temp/myApp/bin
./myApp

Everything works until the last command (./myApp).  Looks like the script is trying to resolve an "app" directory and "ratpack.groovy" file.  The exception is:

./myApp: line 69: cd: /Users/julian/temp/myApp/app: No such file or directory
Exception in thread "main" org.ratpackframework.launch.LaunchException: Could not create handler via handler factory: org.ratpackframework.groovy.launch.GroovyScriptHandlerFactory
        at org.ratpackframework.server.RatpackServerBuilder.createHandler(RatpackServerBuilder.java:61)
        at org.ratpackframework.server.RatpackServerBuilder.buildChannelInitializer(RatpackServerBuilder.java:53)
        at org.ratpackframework.server.RatpackServerBuilder.build(RatpackServerBuilder.java:46)
        at org.ratpackframework.launch.RatpackMain.server(RatpackMain.java:53)
        at org.ratpackframework.launch.RatpackMain.start(RatpackMain.java:64)
        at org.ratpackframework.groovy.launch.RatpackMain.main(RatpackMain.java:29)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /Users/julian/temp/myApp/bin/ratpack.groovy (No such file or directory)
        at org.ratpackframework.reload.internal.ReloadableFileBackedFactory.<init>(ReloadableFileBackedFactory.java:57)
        at org.ratpackframework.groovy.internal.ScriptBackedApp.<init>(ScriptBackedApp.java:46)
        at org.ratpackframework.groovy.launch.GroovyScriptHandlerFactory.create(GroovyScriptHandlerFactory.java:42)
        at org.ratpackframework.server.RatpackServerBuilder.createHandler(RatpackServerBuilder.java:59)
        ... 5 more
Caused by: java.io.FileNotFoundException: /Users/julian/temp/myApp/bin/ratpack.groovy (No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at org.ratpackframework.util.internal.IoUtils.readFile(IoUtils.java:39)
        at org.ratpackframework.reload.internal.ReloadableFileBackedFactory.refresh(ReloadableFileBackedFactory.java:105)
        at org.ratpackframework.reload.internal.ReloadableFileBackedFactory.<init>(ReloadableFileBackedFactory.java:55)
        ... 8 more
Reply | Threaded
Open this post in threaded view
|

Re: Ratpack Deployment using Gradle distZip

Paul_Fairless
Hi,

I ran into the same issue a while back - I fixed it by manually adding the missing files into the build.gradle. There is probably a more elegant solution.

applicationDistribution.from('src/ratpack/templates') {
    into "templates"
}
applicationDistribution.from('src/ratpack/public') {
    into "public"
}
applicationDistribution.from('src/ratpack/handlebars') {
    into "handlebars"
}
applicationDistribution.from('src/ratpack/ratpack.groovy') {
    into "."
}
Reply | Threaded
Open this post in threaded view
|

Re: Ratpack Deployment using Gradle distZip

julian
Thanks Paul - that worked for me also.

I've opened an issue for this:
https://github.com/ratpack/ratpack/issues/180