users@glassfish.java.net

Re: EJB timer service can not automatically migration

From: Shreedhar Ganapathy <Shreedhar.Ganapathy_at_Sun.COM>
Date: Mon, 02 Feb 2009 07:21:12 -0800

Hi Jason
I have cc'd Mahesh and the users list for others benefit. Mahesh, could
you help Jason figure this out?

Thanks
Shreedhar

shockwave_115_at_hotmail.com wrote:
> Hi
> I have tested it again:
>
> environment:
> Windows X86 32bit
> jdk 1.6
> glassfish 9.1
> two instances of two agents on one machine
>
> operation:
> 1 deploy timer service EJB on AS
> timer service active on instance1
> 2 kill agent1 then kill instance1
> timer service can not automatically migrate from instance1 to
> instance2
>
> Then I add my owner "TimerFailureSuspectedAction" into
> GroupManagementService to migrate timer service, and it is OK.
>
>
> ************************************************************************************************************************************
>
> String clusterName = "cluster1";
> try {
> GroupManagementService gms =
> GMSFactory.getGMSModule(clusterName );
> FailureNotificationActionFactory
> myFailureNotificationAction = new
> TimerFailureNotificationActionFactory();
> FailureSuspectedActionFactory myFFailureSuspectedAction =
> new TimerFailureSuspectedActionFactory();
> gms.addActionFactory(myFailureNotificationAction);
> gms.addActionFactory(myFFailureSuspectedAction);
> GroupHandle groupHanlder = gms.getGroupHandle();
> List<String> nodeList = groupHanlder.getAllCurrentMembers();
> for(String node : nodeList)
> {
> System.out.println("We have Node: " + node);
> if(groupHanlder.isMemberAlive(node))
> {
> System.out.println("We have Alive Node: " + node );
> }
> else
> {
> System.out.println("We have dead Node: " + node );
> }
> }
> } catch (GMSNotEnabledException e1) {
> // TODO Auto-generated catch block
> e1.printStackTrace();
> } catch (GMSNotInitializedException e1) {
> // TODO Auto-generated catch block
> e1.printStackTrace();
> } catch (GMSException e1) {
> // TODO Auto-generated catch block
> e1.printStackTrace();
> }
>
> ************************************************************************************************************************************
>
>
> public class TimerFailureSuspectedAction implements
> FailureSuspectedAction{
>
> @Override
> public void consumeSignal(Signal signal) throws ActionException {
> System.out.println("the group to which the member involved in
> the Signal belonged to: " + signal.getGroupName());
> System.out.println("the identity token of the member that
> caused this signal to be generated: " + signal.getMemberToken());
> DistributedEJBService timerService =
> DistributedEJBServiceFactory.getDistributedEJBService();
> String serverId = signal.getMemberToken();
> timerService.migrateTimers(serverId );
> }
>
> }
>
> ************************************************************************************************************************************
>
>
>
> Actually we don't want to implement the auto-migration ourselves, but
> we can not fix the problem, do you have any clue of it?
>
>
> BRs
> //Jason
>
> --------------------------------------------------
> From: "Shreedhar Ganapathy" <Shreedhar.Ganapathy_at_Sun.COM>
> Sent: Monday, February 02, 2009 1:13 PM
> To: <users_at_glassfish.dev.java.net>
> Subject: Re: EJB timer service can not automatically migration
>
>> Hi Jason
>> Wrote a separate note to you on the shoal user mailing list. In
>> addition to that could you share exact steps to reproduce this problem?
>>
>> Thanks
>> Shreedhar
>>
>> shockwave_115_at_hotmail.com wrote:
>>> Hi
>>> I continue to investigate this problem by turn on the log of
>>> "Group Management Service", I found some error logs on
>>> "FailureNotification", I don't know if it is the root cause the
>>> timer automatic migration failure.
>>>
>>> [#|2009-02-02T10:27:06.122+0800|INFO|sun-appserver9.1|ShoalLogger|_ThreadID=21;_ThreadName=com.sun.enterprise.ee.cms.impl.common.Router
>>> Thread;instance2;|Sending FailureSuspectedSignals to registered
>>> Actions. Member:instance2...|#]
>>>
>>> [#|2009-02-02T10:27:06.174+0800|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=21;_ThreadName=com.sun.enterprise.ee.cms.impl.common.Router
>>> Thread;_RequestID=26e5a26b-7b1c-4eb9-be38-1be1c42a1ae7;|Exception in
>>> thread "com.sun.enterprise.ee.cms.impl.common.Router Thread" |#]
>>>
>>> [#|2009-02-02T10:27:06.176+0800|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=21;_ThreadName=com.sun.enterprise.ee.cms.impl.common.Router
>>> Thread;_RequestID=26e5a26b-7b1c-4eb9-be38-1be1c42a1ae7;|java.lang.ClassCastException:
>>> timer.TimerFailureNotificationAction cannot be cast to
>>> com.sun.enterprise.ee.cms.core.FailureSuspectedAction
>>> at
>>> com.sun.enterprise.ee.cms.impl.common.Router.notifyFailureSuspectedAction(Router.java:299)
>>>
>>> at
>>> com.sun.enterprise.ee.cms.impl.common.SignalHandler.analyzeSignal(SignalHandler.java:120)
>>>
>>> at
>>> com.sun.enterprise.ee.cms.impl.common.SignalHandler.handleSignals(SignalHandler.java:103)
>>>
>>> at
>>> com.sun.enterprise.ee.cms.impl.common.SignalHandler.run(SignalHandler.java:85)
>>>
>>> at java.lang.Thread.run(Thread.java:619)
>>> |#]
>>>
>>> Does it mean the callback failed to perform the timer migration when
>>> it got the SuspectedFailureNotification?
>>>
>>> BRs
>>> Jason
>>>
>>> --------------------------------------------------
>>> From: <glassfish_at_javadesktop.org>
>>> Sent: Sunday, January 18, 2009 1:39 PM
>>> To: <users_at_glassfish.dev.java.net>
>>> Subject: Re: EJB timer service can not automatically migration
>>>
>>>> I think this is a very good question. I do not know where the
>>>> automatic failover is done.
>>>> Is that done by the DAS server???
>>>> If the DAS server is down where is then the failover performed? We
>>>> must be sure not to have a single point of failure in our system.
>>>> If the DAS is single point of failure then the EJB timer is not
>>>> feasable.
>>>>
>>>> I had a look at Quartz that can be performed from a Servlet.
>>>> Is there somebody who has experience with Quartz vs EJB Timer on
>>>> GlassFishV2?
>>>> Where can I find more information about automatic failover of the
>>>> EJB Timer in GlassFish?
>>>>
>>>> Thanks
>>>> Jelte
>>>> p.s. I cannot use GlassFishV3 since it is still prelude.
>>>> [Message sent by forum member 'jeltejansons' (jeltejansons)]
>>>>
>>>> http://forums.java.net/jive/thread.jspa?messageID=326679
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>>