JBuilder uses Tomcat as an embedded server, I believe. But you
could accomplish the same thing with a little ingunity.
First, the hard part is finding an available port. Choose some
number, probably around 4000 as a starting point. Try to create a socket
connection to localhost and that port. If there is no response then you've
found your port, else increment the number and try again. Now repeat to
find second number. An alternative is to parse the output of netstat (its
available on all Unix/Linux computers and my Win2000 - don't know about
other Windows) and choose two numbers not listed.
Second, taking your number you just found, insert it into the
server.xml file. There is a line dealing with the HTTP connector and one
for the AJP12 connector. Replate their port values in the server.xml file
with the numbers just found (maybe use SED with a couple of unique
strings?). Now, store the server.xml file and use tomcat.bat/sh -f
newServer.xml start/stop to start and stop on any available port.
You could do this in a number of different ways, but writting a
program to do the first step and a shell script to glue it to the second
step and execute the second step shouldn't be that hard.
Randy
-----Original Message-----
From: Arafat Mohamed [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 10:09 AM
To: [EMAIL PROTECTED]
Subject: Qn about JBuilder/Tomcat implementation
Ladies and Gentlemen,
I have a qn about JBuilder and Tomcat. My company recently got JBuilder4
Enterprise. Although it's really nice, I prefer using emacs/JDE.
One really nice feature it has though is it's integration of Tomcat.
Basically, it's able to start a new instance of tomcat on the first
available port it finds. That speeds up testing (I don't have to stop
tomcat, restart, and then run my app to test). So I could have 3 different
instances of tomcat running, each on a different port.
I've tried to figure out how JBuilder does this, and I'll admit I'm not
smart enough to figure it out. I'm guessing I have to edit server.xml. But,
how do I run an application that isn't in /webapps and still have tomcat
find it?
So, could someone please point me in the right direction to duplicate this
without having to use JBuilder?
Thank you,
Arafat Mohamed
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]