We have a handful of applications deploying to the same tomcat server (currently working on upgrading to grails 3, so this may be OBE in the next few months, but it's been plaguing us for quite some time now) and two of the applications will occasionally lose their relative context root path.
Let's say we have "app1" and "app2" which deploy to server:port/app1
and server:port/app2
.
app1 works just fine, but app2 will SOMETIMES (~20% of the time, maybe) deploy and all <g:link/>
links (or any other generated links, such as asset locations) generate relative to the server root... the application is correctly deployed under /app2
, so the links point to bad locations.
E.g., <g:link controller='hello' action='index'/>
will generate the link as /hello/index
rather than /app2/hello/index
.
I don't know what the relevant code to post is, we've compared this to our other applications and have found nothing noticeably different in the two that are exhibiting this behavior. But it's only these two (out of a dozen) applications that ever break in this manner.
Any ideas on what could be causing this or where to look would be most appreciated.
Edit: Plugins in use:
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
provided "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-dependencies"
compile "org.grails:grails-web-boot"
compile 'org.grails.plugins:cache:4.0.0.M2'
compile 'org.grails.plugins:cache-ehcache:3.0.0.M1'
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:hibernate4"
compile "org.hibernate:hibernate-core:4.3.10.Final"
compile "org.hibernate:hibernate-ehcache:4.3.10.Final"
console "org.grails:grails-console"
profile "org.grails.profiles:web"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.14.1"
runtime "com.h2database:h2"
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"