Thanks. I'm actually invoking Tomcat's startup.bat from the wrapper, so of course Tomcat probably also needs -Xrs in the command line. I've edited the catalina.bat in the Tomcat distribution I'm using and I'll try that out. Looking at my wrapper code, I'm not sure why the wrapper should stop if I have -Xrs in the .ini file (see below), even if Tomcat stops. There's nothing in the wrapper that checks that Tomcat is actually running. However, it does seem to be the case that the wrapper is stopping and then starting on logout.
Code: Select all
public class MyWrapper {
public static boolean running = true;
public static void main(String[] args) throws Exception {
ProcessBuilder pb = new ProcessBuilder("tomcat/bin/startup.bat");
pb.directory(new File("."));
pb.environment().put("JRE_HOME", "jre6");
pb.environment().put("CATALINA_HOME", "tomcat");
Process proc = pb.start();
String line;
BufferedReader input = new BufferedReader(new InputStreamReader(proc.getInputStream()));
while ((line = input.readLine()) != null) {
System.out.println(line);
}
input.close();
while(running){
try{
Thread.sleep(500);
} catch (Exception e){
e.printStackTrace();
}
}
}
public static void stop() throws IOException {
ProcessBuilder pb = new ProcessBuilder("tomcat/bin/shutdown.bat");
pb.directory(new File("."));
pb.environment().put("JRE_HOME", "jre6");
pb.environment().put("CATALINA_HOME", "tomcat");
pb.redirectErrorStream(true);
Process proc = pb.start();
String line;
BufferedReader input = new BufferedReader(new InputStreamReader(proc
.getInputStream()));
while ((line = input.readLine()) != null) {
System.out.println(line);
}
input.close();
running = false;
}
}
Code: Select all
[Java Runtime Environment]
Maximum Version=any
JVM Source=favor_JDK
JVM Type=favor_server
Virtual Machine Parameters=-Xrs
Minimum Version=any
Main Class=service.MyWrapper
...
FOLLOW US
Get the latest news in Application Packaging