AndreG
Posts: 57
Joined: Tue Jun 10, 2014 11:41 am

Java application won't run as a service on Windows Server 2003

Greetings,

I've been having some trouble recently with getting one of our applications to run as a service on Windows Server 2003, both the original release and R2. In my searching, I found this old thread which appears to be the same problem (or at least, very similar) but there isn't anything there that really helps me. Unfortunately I don't have many Windows Server machines to test my setup on, still trying to get our IT department to organise an environment in which I can test things like this, so I can't say if it only affects 2003 or if it's common to all the "Server" variations of Windows..

I don't have many details about the problem itself though, other than to state:
  • There were no problems during installation
  • Our application code never gets invoked - so none of our logs exist
  • Trying to launch it from the Services panel shows "The service started and then stopped unexpectedly"
  • Event Viewer messages don't show anything more than the popup message
Is there any info about this issue that might help me get around it? Any specific requirement from the installation side that would affect launching the app as a service? I'm hoping to get my hands on a few VMs to test this with sometime next week, but I'm just wondering if there's anything I can try in the meantime?
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Java application won't run as a service on Windows Server 2003

Hello,

I'm not sure what could be the root cause of the issue. Can you please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AndreG
Posts: 57
Joined: Tue Jun 10, 2014 11:41 am

Re: Java application won't run as a service on Windows Server 2003

Hi Daniel, apologies for the delay, I've just sent the email through now with the requested files.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Java application won't run as a service on Windows Server 2003

Hello Andre,

Please give us some time to test and investigate your sent project on our side and we'll get back to you as soon as we have an update.

Thank you for your patience and understanding.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AndreG
Posts: 57
Joined: Tue Jun 10, 2014 11:41 am

Re: Java application won't run as a service on Windows Server 2003

I just noticed a message in AI when I opened one of my projects now, it simply states:
Packages built with this version of Advanced Installer can be installed only on Windows XP SP3 or newer. For deploying packages on older operating systems, please use Advanced Installer 10.3.
I haven't seen this myself, however I did hear one of our support guys saying the other day that he couldn't get the service installed by our setup wizard to start up on Windows XP.. For the most part, we haven't had any issues with this environment before, but considering Windows Server 2003 is effectively the "server" version of XP, could these two issues perhaps be related?

Could someone perhaps point me in the direction of a setup package for Advanced Installer 10.3?
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Java application won't run as a service on Windows Server 2003

Hello Andre,

You can download any Advanced Installer version covered by your maintenance plan from your customer information page. Just enter your license key in there and then select the desired AI version in the "Versions released during your maintenance plan" combo box from the bottom section of the page.

However, for troubleshooting purposes, can you try to manually install your java application files on the problematic machine and try to manually call your Jar main() and stop() methods and make sure they work as expected?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AndreG
Posts: 57
Joined: Tue Jun 10, 2014 11:41 am

Re: Java application won't run as a service on Windows Server 2003

In looking for my license key, it turns out the "Customer Information" link in the "About Advanced Installer" window opens on the same page you linked to. Nice and easy. :)
Daniel wrote:However, for troubleshooting purposes, can you try to manually install your java application files on the problematic machine and try to manually call your Jar main() and stop() methods and make sure they work as expected?
Currently, to get around the issue of it not running as a service, we're launching the application using a batch file that contains the typical "java -jar <file>" command. Both this way and launching the jar file directly (which uses "javaw"), it runs without any problems.

Or are you perhaps suggesting I try manually install it as a service (using "sc create")?
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Java application won't run as a service on Windows Server 2003

Hello,

To further investigate this issue, would it be possible for you to send us a download link for your built setup package so we can test and investigate it on our side?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AndreG
Posts: 57
Joined: Tue Jun 10, 2014 11:41 am

Re: Java application won't run as a service on Windows Server 2003

In the interest of not leaving this thread unanswered: it seems this may quite possibly be an incompatibility with our application and the Windows Server environment. Even though I'm not sure how or why, when I tested this with a simple "endless loop" Java method installed as a service through AI, my dummy service installed and started up correctly on Server 2003.

Apologies for not updating this thread sooner, today I've found a number of my posts on various sites that haven't been updated in a long time, so I'm now doing some cleanup.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Java application won't run as a service on Windows Server 2003

Thank you for your follow up Andre.

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

Return to “Common Problems”