I'm trying to deploy moqui 1.6.3 and runtime in apache-tomcat-8.0.12 in a non-ROOT folder.
I have done below modification in build.gradle:
task deployTomcatRuntime << { delete file(tomcatHome + '/runtime'); delete file(tomcatHome + '/webapps/myweb'); delete file(tomcatHome + '/webapps/myweb.war') copy { from file(plusRuntimeName); into file(tomcatHome + '/webapps'); rename(plusRuntimeName, 'myweb.war') } }
After commands: gradle cleanAll, gradle buid, gradle addRuntimeTomcat, myweb.war is deployed in tomcat webapp folder successfully.
After that, I use "http://localhost:8080/myweb" to open the root page, and the login page comes "http://localhost:8080/myweb/Login".
And then I give the username and password and click login, but I'm still in login page without any error.
If I change myweb.war to ROOT.war, it will work fine to log into the system.
I put some debug in framework code, and find that system create a new ExecutionContextImpl when redirect from Login to root page. Below is the place I put the logs:
ExecutionContextImpl getEci() { logger.debug("===========getExecutionContext:"+activeContext.get()) // the ExecutionContextImpl cast here looks funny, but avoids Groovy using a slow castToType call ExecutionContextImpl ec = (ExecutionContextImpl) activeContext.get() if (ec != null) return ec if (logger.traceEnabled) logger.trace("Creating new ExecutionContext in thread [${Thread.currentThread().id}:${Thread.currentThread().name}]") if (!(Thread.currentThread().getContextClassLoader() instanceof StupidClassLoader)) Thread.currentThread().setContextClassLoader(cachedClassLoader) ec = new ExecutionContextImpl(this) this.activeContext.set(ec) return ec }
impl.context.ExecutionContextFactoryImpl [] ===========getExecutionContext:ExecutionContext in tenant DEFAULT --- 2016-05-02 23:02:51.176 [nio-8080-exec-4] DEBUG impl.context.ExecutionContextFactoryImpl [] ===========getExecutionContext:null --- 2016-05-02 23:02:51.177 [nio-8080-exec-4] DEBUG impl.context.ExecutionContextFactoryImpl [] ===========getExecutionContext:ExecutionContext in tenant DEFAULT
It looks like ThreadLocal has problem in a non-ROOT folder in tomcat, but not sure. Have anybody deployed moqui in a non-ROOT folder?