[ 
https://issues.apache.org/activemq/browse/SMXCOMP-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53672#action_53672
 ] 

Chris Custine commented on SMXCOMP-446:
---------------------------------------

I think a workaround for this issue is to use a unique name attribute in the 
quartz:simple and quart:cron trigger definitions.  So using your example, it 
would look like this:

{code:xml|title=SA1}
<quartz:endpoint service="Es5_v_0:Es5.Step2_v_0" endpoint="Es5.Step2_v_0" 
targetService="Es5_v_0:Es5.EstraiNamespace_v_0">

  <quartz:trigger>
    <quartz:simple name="trigger1" repeatCount="5" repeatInterval="5000" />
  </quartz:trigger>

</quartz:endpoint>
{code}

and

{code:xml|title=SA2}
<quartz:endpoint service="Es6_v_0:Es6.Step2_v_0" endpoint="Es6.Step2_v_0" 
targetService="Es6_v_0:Es6.EstraiNamespace_v_0">

  <quartz:trigger>
    <quartz:simple name="trigger2" repeatCount="5" repeatInterval="5000" />
  </quartz:trigger>

</quartz:endpoint>
{code}  

I'm going to go ahead and apply the patch so that this is fixed for anyone 
using default values as shown in the examples, but I hope this workaround helps 
anyone using older endpoints or those who can't upgrade for whatever reason.

> Quartz Exception when declaring two sa with quartz endpoint
> -----------------------------------------------------------
>
>                 Key: SMXCOMP-446
>                 URL: https://issues.apache.org/activemq/browse/SMXCOMP-446
>             Project: ServiceMix Components
>          Issue Type: Bug
>          Components: servicemix-quartz
>    Affects Versions: servicemix-quartz-2008.01
>            Reporter: Andrea Zoppello
>            Assignee: Chris Custine
>         Attachments: QuartzEndpoint.java.patch
>
>
> When you've two sa ( for example sa1 and for example sa2 ) and each one of 
> this declare a quartz endpoint as the example below:
> SA1 xbean for quartz:
> ....
>       <quartz:endpoint 
>                       service="Es5_v_0:Es5.Step2_v_0" 
>                       endpoint="Es5.Step2_v_0"
>                       targetService="Es5_v_0:Es5.EstraiNamespace_v_0">
>       
>                       <quartz:trigger>
>                        <quartz:simple repeatCount="5" 
>                                                       repeatInterval="5000" />
>                       </quartz:trigger>
>  
>  
>  
>       
>       </quartz:endpoint>
> .....
> and SA2:
> <quartz:endpoint 
>                       service="Es6_v_0:Es6.Step2_v_0" 
>                       endpoint="Es6.Step2_v_0"
>                       targetService="Es6_v_0:Es6.EstraiNamespace_v_0">
>       
>                       <quartz:trigger>
>                        <quartz:simple repeatCount="5" 
>                                                       repeatInterval="5000" />
>                       </quartz:trigger>
>       
>       </quartz:endpoint>
> This will result in an exception:
> loc-message>Unable to start service unit</loc-message>
> </msg-loc-info>
> </task-status-msg>
>                       <exception-info>
>                               <nesting-level>1</nesting-level>
>                               <msg-loc-info>
>                                       <loc-token/>
>                                       <loc-message>New trigger is not related 
> to the same job as the old trigger.</loc-message>
>                                       
> <stack-trace><![CDATA[org.quartz.JobPersistenceException: New trigger is not 
> related to the same job as the old trigger.
>       at org.quartz.simpl.RAMJobStore.replaceTrigger(RAMJobStore.java:421)
>       at 
> org.quartz.core.QuartzScheduler.rescheduleJob(QuartzScheduler.java:771)
>       at org.quartz.impl.StdScheduler.rescheduleJob(StdScheduler.java:297)
>       at 
> org.apache.servicemix.quartz.QuartzEndpoint.start(QuartzEndpoint.java:200)
>       at 
> org.apache.servicemix.common.DefaultServiceUnit.start(DefaultServiceUnit.java:78)
>       at 
> org.apache.servicemix.common.BaseServiceUnitManager.start(BaseServiceUnitManager.java:155)
>       at 
> org.apache.servicemix.jbi.framework.ServiceUnitLifeCycle.start(ServiceUnitLifeCycle.java:103)
>       at 
> org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.start(ServiceAssemblyLifeCycle.java:132)
>       at 
> org.apache.servicemix.jbi.framework.DeploymentService.start(DeploymentService.java:378)
>       at 
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:355)
>       at 
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:256)
>       at 
> org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:667)
>       at 
> org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:62)
>       at 
> org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:631)
>       at java.util.TimerThread.mainLoop(Timer.java:512)
>       at java.util.TimerThread.run(Timer.java:462)
> ]]></stack-trace>
>                               </msg-loc-info>
>                       </exception-info>
>               </task-result-details>
>       </component-task-result-details>
> </component-task-result>
> </jbi-task-result>
> </jbi-task>

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

Reply via email to