Java Service -- Installer thinks it hasn't started - Advanced Installer Community
belgariontheking
Posts: 2
Joined: Tue Oct 21, 2014 6:34 pm

Java Service -- Installer thinks it hasn't started

lease give us the following information so we can help you quicker:

Problem description - Installer doesn't seem to know that the service has started. I'm using Advanced Installer 9.4

Environment - Windows 7. Java application reads config from (hardcoded) c:\users\Administrator\AppData\company\product\config.props
Log4J writes log file to same directory, monitoring.log
Despite all this, installation works and fires up the service. I have evidence of this in log files being written, files being uploaded, and seeing "FileMonitor.exe" in Windows Task Manager. It is not running before starting up the installer.

The installer seems unable to tell that the serivce has started, so it waits 5 minutes and gives me the error saying that the service hasn't started and has Retry/Cancel. If I look at services in Computer Management, It lists the service and says "Starting" so even Windows cannot tell that the program has started up.

How does the installer tell that the service has started? I've got the main(String[] args) and stop() methods implemented in my code.

Will email verbose log and aip file.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Java Service -- Installer thinks it hasn't started

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

Our "Services" page uses Windows Installer default support to install an start services. The service control operations are handled through Windows Installer "ServiceControl" table and "StartServices" action.

However, you may encounter the related behavior if your service cannot start or if the service start operation cannot be accomplished in a due time. Can you please try to manually start your installed service and see if the service successfully starts? If not, then I'm afraid you should try to debug your service in order to find out the root cause of this behavior.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
belgariontheking
Posts: 2
Joined: Tue Oct 21, 2014 6:34 pm

Re: Java Service -- Installer thinks it hasn't started

The service starts immediately, and it starts when the installer/Windows tells it to. Log file created, initial sftp upload completed within 20 seconds.

Since the installer deletes the service when it doesn't think it's started, I had to wait for the installer to say "it hasn't started" in order to manually start it. Same result, service starts up, log file and everything. Computer Management window gave me this error window:

---------------------------
Services
---------------------------
Windows could not start the XXXXX service on Local Computer.



Error 1053: The service did not respond to the start or control request in a timely fashion.


---------------------------
OK
---------------------------

In what way do I need to "respond" to the request?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Java Service -- Installer thinks it hasn't started

Hello,

If the service can be successfully started outside the installer, then you can uncheck the "Start" operation configured for it in "Services page -> Service Control Operation -> Actions -> On Install" and add your own custom action which will start the service. The custom action should be added as a custom action with sequence after "Install Execution Stage -> Add Resources" actions group and should be scheduled as deferred.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”