This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Starting tomcat using Execute Script/batch file action
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 13, 2010
12:29 AM
Starting tomcat using Execute Script/batch file action
Hi I have a requirement where i need to start and stop tomcat from command prompt rather than using windows service.
I am using the below code using Execute Script/batch file action
cd $PORTAL_HOME$\bin
catalina.bat start
but it is failing to start.
Second question is if it get started how can we suspend the installer progress untill server get started.
Thanks,
Vijay
I am using the below code using Execute Script/batch file action
cd $PORTAL_HOME$\bin
catalina.bat start
but it is failing to start.
Second question is if it get started how can we suspend the installer progress untill server get started.
Thanks,
Vijay
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 13, 2010
03:38 AM
I think that this has to do with the fact that when you do that the startup.bat opens a new window, and "Suppress first window" (Windows only) is checked by default. However, I really don't see the use case of starting the Apache Tomcat server not by service, but by this .bat file, exactly because of this console window...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 28, 2011
09:03 AM
I made a setup that does exactly what you need. I made it in an CustomCodeAction. Here's the Code:
File scriptFile = new File("C:\\TOMCAT\\catalina.bat"); //whatever your path is
ProcessBuilder oProcBuilder = neww ProcessBuilder("cmd", "/c", scriptFile.getName());
oProcBuilder.directory(scriptFile.getParentFile());
//run the script file
try {
Process oProcScript = oProcBuilder.start();
try {
oProcScript.waitFor();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (IOException e) {
e.printStackTrace();
}