Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

start tomcat dynamically  RSS feed

 
Ariffin Ahmad
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a requirement to start tomcat server within my code. how can check either tomcat is started or not, and if not then i will start it? i tried r.exec("c:\\jakarta-tomcat-4.0.2\\bin\\startup.bat"), but i got some message from tomcat to set the path for catalina_home. but, when i tried r.exec("set CATALINA_HOME=c:\\jakarta-tomcat-4.0.2"), i got some error message.
 
Sita Kodali
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may try this..
try {
Socket s = new Socket("hostname",8080);
}
catch(ConnectException ioe) {
//put your code to start tomcat here
}
I'm sure this not the best answer, but one of the possibilities
HTH
--
Venkat
 
Ariffin Ahmad
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
great idea...
but, still stuck on how to run tomcat dynamically......
can anyone tell how?..
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This doesn't belong here. Moving it to the apache forum...
Kyle
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!