Deploy Grails 3.1.1 to Heroku

501 views Asked by At

I was using 3.0.14v Grails and I did some deployments to heroku. Everything was working fine, however I wanted to try with Grails 3.1.1 and I'm getting some errors now.

I was following this post https://devcenter.heroku.com/articles/deploying-gradle-apps-on-heroku

I cloned this https://github.com/kissaten/grails3-example

I think it's something about tomcat version but not sure.

Any help?

heroku logs

heroku logs

2

There are 2 answers

0
Joch On

For your trouble with the compile 'com.github.jsimone:webapp-runner:8.0.30.1', I figured it out by removing the httpclient module from all test* import, and I imported a good version of that module (only for test*).

testCompile ("org.grails.plugins:geb"){
    exclude module: 'httpclient'
}
testCompile ('org.seleniumhq.selenium:selenium-firefox-driver:2.48.2'){
    exclude module: 'httpclient'
}
testCompile 'org.apache.httpcomponents:httpclient:4.3.5'

Thanks to that, I could import the "last" webapp-runner (directly as a jar)

compile 'com.github.jsimone:webapp-runner:8.0.30.1@jar'

Maybe that version of the webapp-runner will fix the problem, but I'm not sure. As I saw on your stacktraces, there is a NoClassDefFoundException for org/apache/tomcat/util/descriptor/tld/TldParser.

This class is provided by the tomcat-embed-core artifact. And that artifact comes from spring-boot-starter-tomcat (as a dependency). Change "spring-boot-starter-tomcat" from provided to compiled or try another version (for Grails 3.0.9, the spring-starter-tomcat version is 1.2.6).

Hope it helps ;)

0
Adrian Rodriguez On

I'm unsure of the specifics, but it looks like Grails 3.1.1 requires some of the classes in the Tomcat 8.x line.

I found a solution I used a "compile 'com.github.jsimone:webapp-runner:8.0.30.2'" instead '8.0.30.1' and It's working well now.

I think there is an issue with including '8.0.30.1' as a compile time dependency.