DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2005
    Posts
    1

    Exclamation thread to shut the tomcat and restart

    THIS IS WHAT I AM TRYING TO DO BUT AFTER STARTING THE TOMCAT MY THREAD IS NOT WAKING UP

    HELP PLEASE

    class Restarts extends Thread{
    String fileStart="",fileRestart="";
    String line,line1;
    public Restarts(String start1, String restart1){
    fileStart=start1;
    fileRestart=restart1;
    start();
    }
    public void run(){
    try{
    Process p = Runtime.getRuntime().exec(fileStart);
    BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
    while ((line = input.readLine()) != null) {
    System.out.println(line);
    }
    input.close();
    sleep(20000);
    Process p1 = Runtime.getRuntime().exec(fileRestart);
    BufferedReader input1 = new BufferedReader(new InputStreamReader(p1.getInputStream()));

    while ((line1 = input1.readLine()) != null) {
    System.out.println(line1);
    }
    input1.close();

    }
    catch(Exception e){
    e.printStackTrace();
    }
    }

    }

    class Restart
    {
    public static void main(String a[]){
    Restarts start = new Restarts("startup.bat","shutdown.bat");

    }
    }

  2. #2
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    255
    Happiness is good health and a bad memory.

Similar Threads

  1. integrating Tomcat with Apache
    By ashiers in forum Open Source
    Replies: 0
    Last Post: 11-16-2005, 06:34 PM
  2. Replies: 1
    Last Post: 11-30-2001, 10:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links