|
From: kapilashantha r. <kap...@gm...> - 2010-09-28 04:04:28
|
Dear Sir,
Thanks a lot your kind response,
I'm using RHEL 5.4 operating system and my application is a transaction
server which is basically installing in banking system.
So I have two servers mentioned LIVE and BACKUP
And I'm using LINUX HA (heartbeat) to make a backup processes.
Note : I extends the 'WrapperSimpleApp' in my application and using it
My issue is that my service (running on wrapper) something different not
like other service (For a example take httpd service)
The reason is when starting failing of service (it means init() method
returns false ), The linux HA is still detecting that service is still
running status.
Note : I'm using HA service monitoring option to monitor service status
Then service will not move to the BACKUP server even if it is getting
failure in LIVE server. But same configuration I have been applying to httpd
service, so HA try to three attempts to start service on LIVE server if it
is failing there, the httpd service will move to the backup server.
My point is that when I run my service, imediatly it will create PID file
and others but application is still initializing. So HA now detecting
service is running
Anyway i trust that you can understand my problem.
This is the using code
-----------------------------------------------------------------------------
package com.epic.line.server;
import org.tanukisoftware.wrapper.WrapperSimpleApp;
import com.epic.line.config.TLEConfig;
import com.epic.line.config.TLEInitAll;
public class WrapperStart extends WrapperSimpleApp {
protected WrapperStart(String[] arg0) {
super(arg0);
}
public static void main(String[] args) {
try {
TLEInitAll.init();
if (TLEConfig.INIT_ST){
System.out.println( "Epic_TLE startup passed." );
new WrapperStart(args);
}else{
System.out.println( "Epic_TLE startup failed." );
System.exit(0);
}
} catch (Exception e) {
}
}
@Override
public int stop(int exitCode) {
return super.stop(0);
}
}
-----------------------------------------------------------------------------
Note : Passing my main method via args
And one thing with this code
When calling 'TLEInitAll.init();' wrapper has created PID file and other
before calling 'new WrapperStart(args);'
Thanks and regards
-Kapila
On Mon, Sep 27, 2010 at 10:57 PM, <
wra...@li...> wrote:
> Send Wrapper-user mailing list submissions to
> wra...@li...
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/wrapper-user
> or, via email, send a message with subject or body 'help' to
> wra...@li...
>
> You can reach the person managing the list at
> wra...@li...
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Wrapper-user digest..."
>
>
> Today's Topics:
>
> 1. Taking chance to call my init() before running on JSW
> (kapilashantha rajapaksha)
> 2. Re: Taking chance to call my init() before running on JSW
> (Leif Mortenson)
> 3. Wrapper service failing immediately
> (GLOVER, MARK CSC)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 27 Sep 2010 13:09:50 +0530
> From: kapilashantha rajapaksha <kap...@gm...>
> Subject: [Wrapper-user] Taking chance to call my init() before running
> on JSW
> To: Wra...@li...
> Message-ID:
> <AAN...@ma...>
> Content-Type: text/plain; charset="iso-8859-1"
>
> hi All,
>
> I'm using int JSW for my application. One thing I want to know.
>
> I want to run my init() method (There is an init() method in my application
> which used for checking initializing modules like dbconnection, some
> hardware status (HSM), remote socket connection status etc... ). If it is
> returning TRUE, the all modules are successfully loaded. If it is retuning
> FALSE, some failure has detected.
>
> What I want to know,
>
> Can I call my init() method before loading JSW ?
>
> If only TRUE returns , Then my application should be get started on JSW
>
>
> Regards
> -Kapila
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 2
> Date: Mon, 27 Sep 2010 16:49:56 +0900
> From: Leif Mortenson <lei...@ta...>
> Subject: Re: [Wrapper-user] Taking chance to call my init() before
> running on JSW
> To: wra...@li...
> Message-ID:
> <AAN...@ma...>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Kapila,
> You can do this in one of a number of ways.
>
> 1) The simplest is to write a simple class which does this check in
> its main method then calls the application's main class's main method
> if you really want to start the application. Call System.exit with
> an appropriate error code otherwise.
> You can then use the standard Integration Method #1 and make use of
> the WrapperSimpleApp helper class as usual:
> http://wrapper.tanukisoftware.com/doc/english/integrate.html#method1
>
> 2) A more advanced option is to use Integration Method #3, and write
> your own WrapperListener implementation. In this case, you would do
> your initialization checks in the WrapperListener.start method and
> then return an error or call your main class start method as above.
> This method has the benefit of giving you more control over when the
> Wrapper things the application is "started":
> http://wrapper.tanukisoftware.com/doc/english/integrate.html#method3
>
> Cheers,
> Leif
>
> On Mon, Sep 27, 2010 at 4:39 PM, kapilashantha rajapaksha
> <kap...@gm...> wrote:
> > hi All,
> >
> > I'm using int JSW for my application. One thing I want to know.
> >
> > I want to run my init() method (There is an init() method in my
> application
> > which used for checking initializing modules like dbconnection, some
> > hardware status (HSM), remote socket connection status etc... ). If it is
> > returning TRUE, the all modules are successfully loaded. If it is
> retuning
> > FALSE, some failure? has detected.
> >
> > What I want to know,
> >
> > Can I call my init() method before loading JSW ?
> >
> > If only TRUE returns , Then my application should be get started on JSW
> >
> >
> > Regards
> > -Kapila
>
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 27 Sep 2010 13:26:51 -0400
> From: "GLOVER, MARK CSC" <MAR...@UT...>
> Subject: [Wrapper-user] Wrapper service failing immediately
> To: <wra...@li...>
> Message-ID:
> <8D3...@UU...>
> Content-Type: text/plain; charset="iso-8859-1"
>
> What might cause a wrapper to exit before trying to start?
>
> Running from console doesn't seem to indicate error.
>
> C:\Documents and
> Settings\gloverm\src\java\wrapper-windows\MarkTestWrapperApp\bin>wrapper.exe
> -c ..\conf\MarkTestWrapperApp.conf
>
> n See wrapper.log for results.
>
>
>
> The service is not waiting 30000 milliseconds for a process to start.
>
> The service failing immediately.
>
> M/S documentation suggests error code WIN32_EXIT_CODE : 0 (0x0) is
> caused by a bug before the process is starting.
>
>
>
> C:\Documents and
> Settings\gloverm\src\java\wrapper-windows\MarkTestWrapperApp\bin>InstallMarkTestWrapperApp-NT.bat
>
> wrapper | Service command: "C:\Documents and
> Settings\gloverm\src\java\wrapper-windows\MarkTestWrapperApp\bin\wrapper.exe"
> -s "C:\Documents and
> Settings\gloverm\src\java\wrapper-windows\MarkTestWrapperApp\conf\wrapper.conf"
>
> wrapper | MarkTestWrapperApp service installed.
>
>
>
> C:\Documents and
> Settings\gloverm\src\java\wrapper-windows\MarkTestWrapperApp\bin>wrapper.exe
> -t ..\conf\MarkTestWrapperApp.conf
>
> wrapper | Starting the MarkTestWrapperApp service...
>
> wrapper | Unable to start the MarkTestWrapperApp service - The service did
> not respond to the start or control request in a timely fashion. (0x41d)
>
>
>
> C:\Documents and
> Settings\gloverm\src\java\wrapper-windows\MarkTestWrapperApp\bin>sc query
> MarkTestWrapperApp
>
>
>
> SERVICE_NAME: MarkTestWrapperApp
>
> TYPE : 10 WIN32_OWN_PROCESS
>
> STATE : 1 STOPPED
>
>
> (NOT_STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN)
>
> WIN32_EXIT_CODE : 0 (0x0)
>
> SERVICE_EXIT_CODE : 0 (0x0)
>
> CHECKPOINT : 0x0
>
> WAIT_HINT : 0x0
>
>
>
>
>
>
>
> Mark Glover
>
> UTC Power
>
> 195 Governors Highway
>
> South Windsor CT 06074
>
> 860 727 2253
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: src.zip
> Type: application/x-zip-compressed
> Size: 2167 bytes
> Desc: src.zip
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: wrapper.log.zip
> Type: application/x-zip-compressed
> Size: 3967 bytes
> Desc: wrapper.log.zip
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: MarkTestWrapperApp.conf.zip
> Type: application/x-zip-compressed
> Size: 2791 bytes
> Desc: MarkTestWrapperApp.conf.zip
>
> ------------------------------
>
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
>
> ------------------------------
>
> _______________________________________________
> Wrapper-user mailing list
> Wra...@li...
> https://lists.sourceforge.net/lists/listinfo/wrapper-user
>
>
> End of Wrapper-user Digest, Vol 52, Issue 10
> ********************************************
>
|