---------------------------------------------------------------------------
HARBOR: http://coolharbor.100free.com/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
Making the Java dream come true.
---------------------------------------------------------------------------
----- Original Message -----
From: "Mark Webb" <[EMAIL PROTECTED]>
To: "dev" <dev@tomcat.apache.org>
Sent: Thursday, February 14, 2008 4:59 PM
Subject: embedded tomcat 6
I have written a program that embeds tomcat 6.0.14 into it. The
problem is that once I call Embedded.start(), the program does not
keep running and just terminates normally. I have placed the program
in the eclipse debugger and all looks fine, but the program just
exits.
What can I do to ensure that the program stays running after the call
to Embedded.start()? After the call, I place a
Thread.sleep(Integer.MAX_VALUE) and things are fine, but that just
does not seem to be good practice.
====================================
Mark, it a long long time since I did this stuff... but I vaguely remember
the concept,
and more importantly how to figure it out...
Embedded has a function called
public void setAwait(boolean b) {
await = b;
}
From your program... you start a thread, and in that thread you
call this function, and then load up your web-apps and stuff.
Tomcat will hold the deamon, until you release that flag.... then the thread
falls thru.
It was something like that and you right, sleeping threads are not the way
to go.
Then the way I figured this stuff out....
Go get all the source code for the WHOLE tomcat...
and start at BOOTSTRAP... study that because all it really does is use
the digester to read all the XML config, and then it calls down into the
same
embedded functions that you using... so if you follow that code you actually
have
guru examples... and then you may even end up doing what we did...
We left the digester stuff in.... so when we develop an embedded app, we do
it
in normal tomcat, then just copy the config files and the webapp to the
app... done!
Hope that helps... have fun
I remember log files driving us mad... but I cant remember the details, I
think we just removed that.
====================================
Thanks in advance
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]