I set the following attribute for embedded tomcat 8
this.embedded = new TomcatImpl();
((StandardHost) this.embedded.getHost()).setUnpackWARs(true); If I set the value to true //this.embedded.getHost().setAppBase(getPath());I did not set this value as I have to deploy using context docbase attribue this.embedded.getHost().setAutoDeploy(true);
Everything works fine but i got the below error message
Exception fixing docBase for context [/service]
java.io.IOException: Unable to create the directory [/var/opt/mediation/MMStorage/Online/etc/tomcat/webapps/webapps/service]
at org.apache.catalina.core.ContainerBase. (ContainerBase.java:701)
to remove this error
I set the below value
b]((StandardHost) this.embedded.getHost()).setUnpackWARs(false)[/b]; If I change the value false from true
Security is not the main issue when determining whether to unpack WARs or not. If you properly secure your system, I doubt it will even make a difference. On the other hand, the latest javadocs indicate that allowing Tomcat to unpack a WAR can result in significant speedup in deployment. Whether you find that important depends on your work environments and viewpoint. I've never felt it to be a problem.
If you do decide to unpack WARs, however, you need to tell Tomcat where to unpack the WARs to. That is, you must have a destination directory similar to the TOMCAT_HOME/webapps directory that will serve as the parent directory for the unzipped WAR files.
Your problem is that you're telling Tomcat to unzip into a directory that does not exist - /var/opt/mediation/MMStorage/Online/etc/tomcat/webapps/webapps/service - and since you don't show how the variable absolutePath is being set, it's hard to tell exactly what you did wrong in creating that name.
So much for your actual problem. Here's some info that you might find useful.
First, on Unix/Linux depoyment, the directory path /var/opt/mediation is a bit wonky. Typically you'd either use /opt/mediation (or something like /opt/com/mousetech/mediation is what I use, since I'm mousetech.com). OR you'd use /var/lib/mediation. You have an odd combination of both. Not exactly wrong, just weird since it conforms to none of the accepted usages.
The other thing has to do with filesystem paths and context paths. Instead of:
Why you're deploying 2 different instances of the same webapp I don't know, but that's your business. Do note that a webapp context path should be absolute, so simply deploying under "" and "M" shouldn't work. If it does, well OK. But it's not how the convention works elsewhere.
When it comes to destroying a civilization, gas chambers cannot hold a candle to echo chambers.