0

I'm just starting to use Jelastic. I have a java web application which I have brought to Jelastic as a war-package and am running it on Tomcat. I have also a data folder which I want to keep separate from the war-package. Previously on my test environment as well as in Azure I have been able to access it by declaring it as a PreResource in context.xml-file. However, in Jelastic this does not seem to work. Should I use some other method or do I have an incorrect path? I did not see the absolute path anywhere so I had to ques that it is /opt/tomcat/webapps/data.

Thanks in advance, Minna

Minna
  • 11

1 Answers1

1

As per the documentation, Jelastic provides some preconfigured environment variables pointed to some useful directories on various Java nodes.

Specifically, on Tomcat 6, Tomcat 7, and TomEE servers, you have user.home (pointed to /opt/tomcat/temp) that can be used to write application data outside of your application (i.e. so those files are not lost on redeployment).

More recent Tomcat versions are provisioned as docker based container images and for those you have the option to define Docker variables via the Jelastic dashboard, that you could point to any valid server path.

Tip: Make sure that your data path is set as a docker volume to ensure that it is not lost during application server redeployment (e.g. if you change Tomcat or Java version in future, which is managed via creating a replacement container automatically transposing the defined 'volumes' - all other data is lost).

Damien - Layershift
  • 1,508
  • 8
  • 15