0

While I am aware that one can have a single binary and multiple instances of Tomcat (or TomeEE respectively) running by setting up CATALINA_BASE env variable for separate configurations, I wonder if the same is true for having both Tomcat and TomEE?

In this case the binaries are obviously not the same so it cannot be solved by only creating separate config for eg. TomEE instances.

The end result should enable me to start both of these, not worrying about having to change CATALINA_HOME in order to run either of them.

developer10
  • 1,450
  • 2
  • 15
  • 31

1 Answers1

1

Disclaimer: I'm not aware of particularities of TomEE configuration. However, you should consider them as completely separate entities and ignore their common ancestry. As you correctly write, they're both separate binaries, further more they might change at different times when upgraded, and thus the demand to configure them to access the same directory does not make any sense. Also, TomEE contains a lot of additional common libraries in its lib directory - do you really want to share them with your Tomcat installation?

Just because they (might) honor an environment variable with the same name does not make them magically work with whatever they find there. With the same reasoning, you might want to claim to run tomcat 7, 8.5 and 9 to run from the same home directory - they honor the same CATALINA_HOME variable as well - and here it might be clearly visible that there's not a chance that they'll all work together.

Also, you don't need to worry about changing CATALINA_HOME when starting: Tomcat will figure out its CATALINA_HOME automatically if you don't set it, so the whole problem is already solved without doing anything.

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
  • You wrote this answer more than one year ago, I never tried it (running them without CATALINA_HOME env variable). Tried it today and what do you know - they both start. It seems only when the variable *is* defined, will both Tomcat and TomEE use that variable. If not, they will, as you pointed out, figure out their own CATALINA_HOME. Thank you! I will now accept your answer! – developer10 Jan 17 '20 at 09:30