Some services stop automatically if they are not in use by o - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Rahamat
Posts: 9
Joined: Thu Mar 15, 2012 11:15 pm

Some services stop automatically if they are not in use by o

Hi All,

I am trying to create a service out of the jar that we have at work.
I follow the tutorial http://www.advancedinstaller.com/user-g ... rvice.html and am able to run javaservice.jar the example in the tutorial with no issues.
But when i try to to convert one of my java application into a javaservice.exe . I get "some services stop automatically if they are not in use by other services or programs "
I have tried all combinations but i get this error.
Can u please tell me where to look for logs if my jar has some errors and all and also how to overcome the above error????
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Some services stop automatically if they are not in use

Hi and welcome to Advanced Installer forums,

This is not an installer topic, you'll need to see why your java application does not work as a service.
The installation log can be generated like this.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Rahamat
Posts: 9
Joined: Thu Mar 15, 2012 11:15 pm

Re: Some services stop automatically if they are not in use

Hi Mihai,
The logging mechanism you mentioned above only logs the installation system commands and nothing from the application as such.
I have a simple java code as seen below, and I make a jar out of it and trying to install that as a service using advance installer service creation method and i still get the same "some services stop automatically if they are not in use by other services or programs ". Your service.jar runs fine and am able to run the tellnet service 4444 command without any issue. Please advice why the code isnt working, to run as a service does it need to do threading or any other such mechanism?

Code: Select all

package com.jha.yhs.Controller;

public class YHCSController {

    private static boolean notShutdown = true;

    /**
     * @param args
     */
    public static void main(String[] args) {
	// TODO Auto-generated method stub

	while (notShutdown) {
	    // do nothing
	}
    }

    public static void stop() {
	notShutdown = false;
    }

}
 
Rahamat
Posts: 9
Joined: Thu Mar 15, 2012 11:15 pm

Re: Some services stop automatically if they are not in use

Hi Mihai,

Thanks for your advice earlier .
Please let me know if this is not an installer question , do i post this question in some other forum


Thanks
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Some services stop automatically if they are not in use

Hello,

Unfortunately we cannot provide guidance outside installer related issues. We recommend you debug and troubleshoot the issue on Java forums or look it up on the Internet with the appropriate keywords.
Here's a good place to start:
http://www.java-forums.org/

If you have any installer related doubts or queries we'll be glad to assist.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Rahamat
Posts: 9
Joined: Thu Mar 15, 2012 11:15 pm

Re: Some services stop automatically if they are not in use

Hi Mihai,
The code snippet i posted is a perfectly working Java application. Using advance installer, I have not been able to launch it as a windows service and I keep getting the Some services stop automatically if they are not in use by other applications error repeatedly.
My company is looking at Advanced Installer to use it as a installer and if it is not able to launch a service as given in this examplehttp://www.advancedinstaller.com/user-g ... #preparing, I do not see how we can use this product to do more robust requirements.
Please help me resolve this error and use the advance installer to go forward with launching the application as a windows service,


Thanks
Rahamat
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Some services stop automatically if they are not in use

Hello Rahamat,

We tested the snippet you attached and the service installed and started as expected.

Can you please specify the operating systems you are getting this behavior on? Also, does this behavior manifest on similar clean machines or is it sporadic?

This thread may also help:
http://stackoverflow.com/questions/6356 ... r-services

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Rahamat
Posts: 9
Joined: Thu Mar 15, 2012 11:15 pm

Re: Some services stop automatically if they are not in use

Hi Mihai,
Thanks for trying my code snippet in your environment.
I shall try the app in another colleagues machine,
My only wonder is why does the code that your example provided work and not the one i gave working? Shall restart my comp and check it again.

thanks
Rahamat
Rahamat
Posts: 9
Joined: Thu Mar 15, 2012 11:15 pm

Re: Some services stop automatically if they are not in use

Hi Mihai,
The OS that i am running this on is windows 7 and i was able to run this application as a service after restarting my machine.
The universal mantra of restart did the job.

Thanks for your help in this endeavor diligently.

Rahamat
Rahamat
Posts: 9
Joined: Thu Mar 15, 2012 11:15 pm

Re: Some services stop automatically if they are not in use

Hi Mihai,
The service starts and then when i stop it i still start getting the same "Some services stop automatically if they are not in use by o
" error.


Thanks
Rahamat
Rahamat
Posts: 9
Joined: Thu Mar 15, 2012 11:15 pm

Re: Some services stop automatically if they are not in use

Hi Mihai,
The service that i can bundle with advance installer only works when i restat the machine and is active foor some time. if i restart the service i get back that above error.
If i start 2 services also i get the same error. Other than these errors there is no progress . I have been in touch with you for 1 week now and made no progress what so ever . So am wondering if the product is useful at all for the nature of our business to install a huge Java application as a service !!! i doubt am not getting the reliability
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Some services stop automatically if they are not in use

Hello Rahamat,

Unfortunately we're unable to replicate this behavior. Can you install this java application as a service manually outside the installer?
The installer simply configures your service to be installed on the target machine. Its later behavior completely depends on its development design.

If everything works fine if you install it manually, please send us the failing package, 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,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Rahamat
Posts: 9
Joined: Thu Mar 15, 2012 11:15 pm

Re: Some services stop automatically if they are not in use

Hi Mihai,

Thanks for all your help Mihai
It was a windows 64 bit OS error. It is working fine on a 32bit OS

Thanks again
Rahamat
jicr74
Posts: 4
Joined: Thu Dec 20, 2012 11:17 pm

Re: Some services stop automatically if they are not in use

DId you solve the problem in the long run?
I am still getting the annoying "Some services stop automatically if they are not in use "
when trying to start a java service installed with AI.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Some services stop automatically if they are not in use

Hello,

Can you please try to manually install and start the related java service and see if the behavior still persist? If so, I'm afraid you should debug your service in order to detect the root cause of this behavior.

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

Return to “Common Problems”