|
From: Christian M. <chr...@ta...> - 2012-12-19 01:29:04
|
Hello Hugo,
the JVM is running as long as there is a non daemon thread running inside
the JVM. It appears that when you return from the start() function that's
not the case, so the JVM is initiating the shutdown.
While the start function has to return in a given time, you can launch a
thread in there, which for instance calls your main method, starts your
app, etc.
For instance:
public Integer start(String[] arg0) {
new java.lang.Thread(this).start();
return null;
}
public void run() {
/*
invoke your application
*/
}
In most cases integration method #1 using the WrapperSimpleApp is the best
choice for running your application with the Java quite out of the box, so
if there is no immediate requirement for method #3, I'd recommend also
using integration method #1.
Please let me know if you have any further questions.
Thank you,
Christian Mueller
Tanuki Software, Ltd.
On Tue, Dec 18, 2012 at 6:47 PM, hug...@tr... <
hug...@tr...> wrote:
> Hi Christian,****
>
> Thanks for your response,****
>
> But I still don’t know why it always start and then stop immediately even
> I never set wrapper.listener.force_stop to True,****
>
> I indeed saw the service status changed to ‘started’ and resume to ‘stop’
> soon.****
>
> My start function as below:****
>
> * *
>
> *public* Integer start( String[] args )****
>
> {****
>
> ****
>
> System.*out*.println(TAG + "start>>>>>>>>>>>>>>>>>>>>> ");****
>
> //appStart();****
>
> System.*out*.println(TAG + "start<<<<<<<<<<<<<<<<<<<< ");****
>
> *return* *null*;****
>
> }****
>
> ** **
>
> I use the wrapper-windows-x86-32-3.5.15 (*Community*) and
> jre-6u33-windows-i586****
>
> ** **
>
> Could you help to provide some troubleshooting steps to find my
> environment issue?****
>
> ** **
>
> Thanks.****
>
> Hugo.****
>
> ** **
>
> ** **
>
> *From:* Christian Mueller [mailto:chr...@ta...]
> *Sent:* Monday, December 17, 2012 10:25 AM
> *To:* wra...@li...
> *Subject:* Re: [Wrapper-user] questions about "Method 3 - WrapperListener
> Integration"****
>
> ** **
>
> Hello Hugo,
>
> thank you very much for your interest in the Java Service Wrapper.
>
> The start() function is being called from the WrapperManager during
> startup and is the place where you can initiate the startup of your
> application.
>
> The return value of the start function indicates the result of the
> startup, whereas for instance, 'null' indicates a successful start-up and
> thereafter the state engine of the Wrapper will switch to 'started'. If any
> other value than null is returned then this indicates that the start-up has
> failed and the Wrapper will stop and initiate the shutdown return value
> also indicates the exit code of the Wrapper.
>
> If the start method is not returning anything but calling for instance
> System.exit(), the JVM naturally will shutdown, trigger it's shutdown hooks
> etc. Since the JVM is already shutting down, the stop() function of your
> WrapperListener implantation won't be called unless
> wrapper.listener.force_stop isn't set to TRUE.
>
> Please let me know if you have any further questions.
>
> Thank you,
>
> Christian Mueller
> Tanuki Software, Ltd.
>
> ****
>
> On Fri, Dec 14, 2012 at 6:11 PM, hug...@tr... <
> hug...@tr...> wrote:****
>
> Dears, ****
>
> I am a new guy of the Java Service Wrapper,****
>
> I would like to ask some questions about "Method 3 - WrapperListener
> Integration",****
>
> ****
>
> I created a main class like this sample code:****
>
>
> http://wrapper.tanukisoftware.com/doc/english/integrate-listener.html#mainMethod
> ****
>
> ****
>
> but It always launch wrapper start and then stop immediately even if I do
> nothing in start() function just return null,****
>
> Is this normal process?****
>
> ****
>
> ****
>
> And I saw the following info:****
>
> http://wrapper.tanukisoftware.com/doc/english/prop-listener-force-stop.html
> ****
>
> ****
>
> When FALSE, the stop method will be called only if the start method
> returned a value of "NULL" prior to the shutdown process being started.***
> *
>
> Are there any relationship with the wrapper.listener.force_stop property?*
> ***
>
> ****
>
> Could I only launch the start() function without calling stop function
> immediately?****
>
> And keep the windows service status in “started”****
>
> Thanks.****
>
> ****
>
> Best Regards ****
>
> Hugo.****
>
> ****
>
> ****
>
> TREND MICRO EMAIL NOTICE****
>
> The information contained in this email and any attachments is confidential ****
>
> and may be subject to copyright or other intellectual property protection. ****
>
> If you are not the intended recipient, you are not authorized to use or ****
>
> disclose this information, and we request that you notify us by reply mail or****
>
> telephone and delete the original message from your mail system.****
>
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> Wrapper-user mailing list
> Wra...@li...
> https://lists.sourceforge.net/lists/listinfo/wrapper-user****
>
> ** **
>
> TREND MICRO EMAIL NOTICE
> The information contained in this email and any attachments is confidential
> and may be subject to copyright or other intellectual property protection.
> If you are not the intended recipient, you are not authorized to use or
> disclose this information, and we request that you notify us by reply mail or
> telephone and delete the original message from your mail system.
>
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> Wrapper-user mailing list
> Wra...@li...
> https://lists.sourceforge.net/lists/listinfo/wrapper-user
>
>
|