Application Servers as Candidates? #477

Open
eprozium opened this Issue Sep 22, 2016 · 7 comments

Projects

None yet

3 participants

@eprozium

Hi,

Are application servers, e.g. like Tomcat possible candidates for SDKMAN?
(the same as with Grails, developers usually need more than one version in combination with different JDKs and the possibility to easily switch them)

Or is the scope strictly limited to "sdk"s only?

Thank you.

@marc0der
Member

I'd think that Tomcat could definitely be considered as a possible candidate for sdkman. It would be first prize if we could engage with their devs so they publish their own versions.

@aadrian
aadrian commented Sep 26, 2016

I'd think that Tomcat could definitely be considered as a possible candidate for sdkman

It would be nice, but I'm not sure if it would be so simple to add Tomcat:

  • it's an application server, not a tool/sdk that needs various configurations and quite often more instances with different configs when running at the same time (even when used for development).
  • the /bin directory of tomcat has many hardcoded generic names: http://svn.apache.org/repos/asf/tomcat/trunk/bin/ so adding this directory to the path would break quite allot of stuff.
  • when used together with Apache HTTPD, stuff gets even more complicated.
@marc0der
Member

I don't really think these are valid concerns.

The zip binary that they provide is well formed and fully compatible with sdkman. It does not have any hard-coded generic names since we aren't using the code from the repo.

I've used it for development often in the past. You would simply have the startup.sh, shutdown.sh and catalina.sh scripts on your path to use as required.

@aadrian
aadrian commented Sep 26, 2016

You would simply have the startup.sh, shutdown.sh and catalina.sh scripts on your path to use as required.

Just by that, it won't allow to have more instances running on the same machine correctly :).
CATALINA_HOME and CATALINA_BASE must point to different directories, different configs than the default, and the start/stop scripts must know about them.

Also startup and shutdown are too generic as naming to add them to the path. Simply renaming them to something like tc-start and tc-stop won't work.

@marc0der
Member

It most certainly will, and I have. Set CATALINA_HOME to the folder where sdkman installs Tomcat, then manage your own CATALINA_BASE environment variable(s) and folder(s) pointing to custom configuration(s).

Your bin folder will always live under the single home folder, you most certainly don't want multiple of those on your path.

We have always lived with the generic names that Tomcat has shipped with. Everyone knows and is fond of the startup.sh, shutdown.sh and catalina.sh. BTW, we never rename scripts in sdkman.

If I remember correctly, they also provide a RUNNING.txt file with the distribution that describes the process clearly.

@aadrian
aadrian commented Sep 26, 2016

Your bin folder will always live under the single home folder, you most certainly don't want multiple of those on your path.

Than how do you handle that a Tomcat 7 and a Tomcat 8 must run in parallel? Especially in the migration phase of applications it's is very common to be forced to run the old ones with the new ones all the time.

Everyone knows and is fond of the startup.sh, shutdown.sh and catalina.sh.

We also use Tomcat since v3 but I can't confirm that someone would be fond of this generic naming and handling :).

I can remember vividly however how often there were problems because shutdown.sh couldn't stop Tomcat correctly (and ports are locked), or that startup.sh can't handle more than one configuration :).

This is why almost everybody that is using Tomcat intensely has extra scripts for start and stop and list, that have as parameter some sort of instance name/id too.

E.g. For starting something like:

%>  tomcat start tc1
%>  tomcat start tc2
%>  tomcat start tc3
%>  tomcat start tc4

For stopping:

%>  tomcat stop tc4

Or getting the state of the system:

%> tomcat status
PID   Name State   Port   CTXes      Path     Version
---   ---- ------- -----  --------   -------  -------
123   tc1  Running 10180  app1,app2  /tc/tc1  8.0.30
231   tc2  Running 10280  app3,app4  /tc/tc2  8.0.30
321   tc3  Running 10380  app5,app6  /tc/tc3  8.0.30
132   tc4  Stopped 10480  app1,app2  /tc/tc4  7.0.55
213   tc5  Stopped 10580  app3,app4  /tc/tc5  7.0.55
@marc0der
Member

We will be hosting Tomcat on sdkman soon. We will not be changing the script names. It's your own choice whether you want to use it or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment