You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-dev@ws.apache.org by "Vinh Nguyen (JIRA)" <ji...@apache.org> on 2007/06/13 04:24:25 UTC

[jira] Created: (MUSE-237) Cannot set subscription termination time if Subscribe was first called with null time

Cannot set subscription termination time if Subscribe was first called with null time
-------------------------------------------------------------------------------------

                 Key: MUSE-237
                 URL: https://issues.apache.org/jira/browse/MUSE-237
             Project: Muse
          Issue Type: Bug
         Environment: Muse 2.2.0, Eclipse 3.2.1
            Reporter: Vinh Nguyen
            Assignee: Dan Jemiolo


I initially subscribe with no expiration date.  This means the subscription lifetime is indefinite.  But later, when I try to call the setTerminationTime() to give the subscription a specific expiration date, I get the following error:

org.apache.muse.ws.addressing.soap.SoapFault: Timer already cancelled.
	at org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:298)
	at com.cisco.nm.cmp.nbi.wsdm.client.core.SubscriptionClient.invoke(SubscriptionClient.java:126)
	at org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:254)
	at org.apache.muse.ws.resource.remote.WsResourceClient.setTerminationTime(WsResourceClient.java:187)

The error is in SimpleScheduledTermination line #114. 

The SimpleNotificationProducer.subscribe() is invoked by the client with a null expiration date.  This creates the SimpleScheduledTermination instance and calls setTerminationTime(null), which cancels the internal timer.  Later, when setTerminationTime() is called with a valid date, the Timer throws an error because a task is trying to be scheduled on it, but the timer already was cancelled.

The simplest fix is to set a flag so that if the timer was initially cancelled, reinstantiate it when it's used again.  The flag can be set in SimpleScheduledTermination time.  Or better, create it in org.apache.muse.util.Timer so that you know if it was cancelled, and check this flag in SimpleScheduledTermination.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Closed: (MUSE-237) Cannot set subscription termination time if Subscribe was first called with null time

Posted by "Dan Jemiolo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MUSE-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Jemiolo closed MUSE-237.
----------------------------

    Resolution: Fixed

Fixed bug by making suggested change to org.apache.muse.util.Timer

> Cannot set subscription termination time if Subscribe was first called with null time
> -------------------------------------------------------------------------------------
>
>                 Key: MUSE-237
>                 URL: https://issues.apache.org/jira/browse/MUSE-237
>             Project: Muse
>          Issue Type: Bug
>          Components: WSRF WSRL ScheduledTermination
>    Affects Versions: 2.2.0
>         Environment: Muse 2.2.0, Eclipse 3.2.1
>            Reporter: Vinh Nguyen
>            Assignee: Dan Jemiolo
>             Fix For: 2.3.0
>
>         Attachments: SimpleScheduledTermination.java
>
>
> I initially subscribe with no expiration date.  This means the subscription lifetime is indefinite.  But later, when I try to call the setTerminationTime() to give the subscription a specific expiration date, I get the following error:
> org.apache.muse.ws.addressing.soap.SoapFault: Timer already cancelled.
> 	at org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:298)
> 	at com.cisco.nm.cmp.nbi.wsdm.client.core.SubscriptionClient.invoke(SubscriptionClient.java:126)
> 	at org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:254)
> 	at org.apache.muse.ws.resource.remote.WsResourceClient.setTerminationTime(WsResourceClient.java:187)
> The error is in SimpleScheduledTermination line #114. 
> The SimpleNotificationProducer.subscribe() is invoked by the client with a null expiration date.  This creates the SimpleScheduledTermination instance and calls setTerminationTime(null), which cancels the internal timer.  Later, when setTerminationTime() is called with a valid date, the Timer throws an error because a task is trying to be scheduled on it, but the timer already was cancelled.
> The simplest fix is to set a flag so that if the timer was initially cancelled, reinstantiate it when it's used again.  The flag can be set in SimpleScheduledTermination time.  Or better, create it in org.apache.muse.util.Timer so that you know if it was cancelled, and check this flag in SimpleScheduledTermination.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Commented: (MUSE-237) Cannot set subscription termination time if Subscribe was first called with null time

Posted by "Vinh Nguyen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MUSE-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12504476 ] 

Vinh Nguyen commented on MUSE-237:
----------------------------------

Another possible fix is to initially have the Timer set to null.  Then in setTerminationTime(), do this:
// If time is null, just return it.
// Else, if the timer task wasn't initialized, make a new one.
// Else, stop the current timer task and make a new one.

You'd also have to update getTerminationTime() and shutdown() to check for a null Timer before calling methods on it.

> Cannot set subscription termination time if Subscribe was first called with null time
> -------------------------------------------------------------------------------------
>
>                 Key: MUSE-237
>                 URL: https://issues.apache.org/jira/browse/MUSE-237
>             Project: Muse
>          Issue Type: Bug
>         Environment: Muse 2.2.0, Eclipse 3.2.1
>            Reporter: Vinh Nguyen
>            Assignee: Dan Jemiolo
>
> I initially subscribe with no expiration date.  This means the subscription lifetime is indefinite.  But later, when I try to call the setTerminationTime() to give the subscription a specific expiration date, I get the following error:
> org.apache.muse.ws.addressing.soap.SoapFault: Timer already cancelled.
> 	at org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:298)
> 	at com.cisco.nm.cmp.nbi.wsdm.client.core.SubscriptionClient.invoke(SubscriptionClient.java:126)
> 	at org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:254)
> 	at org.apache.muse.ws.resource.remote.WsResourceClient.setTerminationTime(WsResourceClient.java:187)
> The error is in SimpleScheduledTermination line #114. 
> The SimpleNotificationProducer.subscribe() is invoked by the client with a null expiration date.  This creates the SimpleScheduledTermination instance and calls setTerminationTime(null), which cancels the internal timer.  Later, when setTerminationTime() is called with a valid date, the Timer throws an error because a task is trying to be scheduled on it, but the timer already was cancelled.
> The simplest fix is to set a flag so that if the timer was initially cancelled, reinstantiate it when it's used again.  The flag can be set in SimpleScheduledTermination time.  Or better, create it in org.apache.muse.util.Timer so that you know if it was cancelled, and check this flag in SimpleScheduledTermination.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Updated: (MUSE-237) Cannot set subscription termination time if Subscribe was first called with null time

Posted by "Bo Shao (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MUSE-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bo Shao updated MUSE-237:
-------------------------

    Attachment: SimpleScheduledTermination.java

As suggested by Vinh Nguyen, I made modifications in the following 4 places:
1. Originally, set _terminationTimer to null;
2. In getTerminationTime(), check if it is null. If it is null, then return null;
3. In setTerminationTime(Date time). Firstly check the input value time, if it is null, then return null. Then I check if _terminationTimer has been initialized or not. If not, then initialize it. And keep all other cases.
4. In shutdown(), I also check if _terminationTimer is null or not. If it is not null, then cancel it.

I attached the modified version of SimpleScheduledTermination.java in this post. Thanks!

> Cannot set subscription termination time if Subscribe was first called with null time
> -------------------------------------------------------------------------------------
>
>                 Key: MUSE-237
>                 URL: https://issues.apache.org/jira/browse/MUSE-237
>             Project: Muse
>          Issue Type: Bug
>         Environment: Muse 2.2.0, Eclipse 3.2.1
>            Reporter: Vinh Nguyen
>            Assignee: Dan Jemiolo
>         Attachments: SimpleScheduledTermination.java
>
>
> I initially subscribe with no expiration date.  This means the subscription lifetime is indefinite.  But later, when I try to call the setTerminationTime() to give the subscription a specific expiration date, I get the following error:
> org.apache.muse.ws.addressing.soap.SoapFault: Timer already cancelled.
> 	at org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:298)
> 	at com.cisco.nm.cmp.nbi.wsdm.client.core.SubscriptionClient.invoke(SubscriptionClient.java:126)
> 	at org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:254)
> 	at org.apache.muse.ws.resource.remote.WsResourceClient.setTerminationTime(WsResourceClient.java:187)
> The error is in SimpleScheduledTermination line #114. 
> The SimpleNotificationProducer.subscribe() is invoked by the client with a null expiration date.  This creates the SimpleScheduledTermination instance and calls setTerminationTime(null), which cancels the internal timer.  Later, when setTerminationTime() is called with a valid date, the Timer throws an error because a task is trying to be scheduled on it, but the timer already was cancelled.
> The simplest fix is to set a flag so that if the timer was initially cancelled, reinstantiate it when it's used again.  The flag can be set in SimpleScheduledTermination time.  Or better, create it in org.apache.muse.util.Timer so that you know if it was cancelled, and check this flag in SimpleScheduledTermination.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Updated: (MUSE-237) Cannot set subscription termination time if Subscribe was first called with null time

Posted by "Dan Jemiolo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MUSE-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Jemiolo updated MUSE-237:
-----------------------------

          Component/s: WSRF WSRL ScheduledTermination
        Fix Version/s: 2.3.0
    Affects Version/s: 2.2.0

> Cannot set subscription termination time if Subscribe was first called with null time
> -------------------------------------------------------------------------------------
>
>                 Key: MUSE-237
>                 URL: https://issues.apache.org/jira/browse/MUSE-237
>             Project: Muse
>          Issue Type: Bug
>          Components: WSRF WSRL ScheduledTermination
>    Affects Versions: 2.2.0
>         Environment: Muse 2.2.0, Eclipse 3.2.1
>            Reporter: Vinh Nguyen
>            Assignee: Dan Jemiolo
>             Fix For: 2.3.0
>
>         Attachments: SimpleScheduledTermination.java
>
>
> I initially subscribe with no expiration date.  This means the subscription lifetime is indefinite.  But later, when I try to call the setTerminationTime() to give the subscription a specific expiration date, I get the following error:
> org.apache.muse.ws.addressing.soap.SoapFault: Timer already cancelled.
> 	at org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:298)
> 	at com.cisco.nm.cmp.nbi.wsdm.client.core.SubscriptionClient.invoke(SubscriptionClient.java:126)
> 	at org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:254)
> 	at org.apache.muse.ws.resource.remote.WsResourceClient.setTerminationTime(WsResourceClient.java:187)
> The error is in SimpleScheduledTermination line #114. 
> The SimpleNotificationProducer.subscribe() is invoked by the client with a null expiration date.  This creates the SimpleScheduledTermination instance and calls setTerminationTime(null), which cancels the internal timer.  Later, when setTerminationTime() is called with a valid date, the Timer throws an error because a task is trying to be scheduled on it, but the timer already was cancelled.
> The simplest fix is to set a flag so that if the timer was initially cancelled, reinstantiate it when it's used again.  The flag can be set in SimpleScheduledTermination time.  Or better, create it in org.apache.muse.util.Timer so that you know if it was cancelled, and check this flag in SimpleScheduledTermination.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org