I am evaluating AdvacnedInstaller for using it to install Java based programs on Windows platform.
I found that it runs great if you install it as a program. However, when I install it as a Windows Service, it does run but my CPU utilization goes to 100%.
Here is the code, I am using to create Java Service:
public class JavaService {
public static boolean isRunning;
// This method is called by AdvancedInstaller when it starts the Windows service
public static void main(String[] args){
try {
// Start the tomcat server
TomCatEmb.main(null);
Thread.sleep(1000);
isRunning=true;
while (isRunning){
}
} catch (Exception e) {
e.printStackTrace();
}
}
// This method is called by AdvancedInstaller when it stops the Windows service
public static void stop(){
TomCatEmb.stopServer();
isRunning=false;
}
}