<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=attack7" rel="nofollow">Matt Young</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6859?redirect=false" rel="nofollow">SPR-6859</a></strong> and commented</p>
<p dir="auto">I posted this on the forum, but with no response... I wondered if you all could look into it.</p>
<p dir="auto">I was stubbing out some code that I'd like to run on a schedule, and just to test it, I have it running once every 60 seconds. I noticed that in my logging, the method seems to be executed twice. To make sure it wasn't a logging issue, I put a static int counter into the class and have it increment on each call. So I can confirm the method is actually being run twice.</p>
<p dir="auto">I suspect that this is something like doing a context:component-scan twice-over and resulting in double execution, but can't seem to locate the problem.  I thought I would check first if there were any pointers.</p>
<p dir="auto">The class<br>
Code:<br>
/**</p>
<ul dir="auto">
<li>
<p dir="auto">Date: Feb 15, 2010</p>
</li>
<li>
<p dir="auto">Time: 10:54:36 AM<br>
*/<br>
<code class="notranslate">@Component</code><br>
public class DataHarvestingServiceImpl implements DataHarvestingService {<br>
private static final Logger logger = Logger.getLogger(DataHarvestingServiceImpl.class);</p>
<p dir="auto">private static int count = 0;</p>
<p dir="auto"><code class="notranslate">@Override</code><br>
//  Every night at 1 AM<br>
// <code class="notranslate">@Scheduled</code>(cron = "* * 1 * * ?")</p>
<p dir="auto"><code class="notranslate">@Scheduled</code>(cron = "0 * * * * ?")<br>
public void collectSocialMediaData() {<br>
logger.info("Starting data retrieval at " + new Date(System.currentTimeMillis()));</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="logger.info(&quot;Finished media data retrieval at &quot; + new Date(System.currentTimeMillis()));
System.out.println(&quot;count is &quot; + count++);"><pre class="notranslate"><code class="notranslate">logger.info("Finished media data retrieval at " + new Date(System.currentTimeMillis()));
System.out.println("count is " + count++);
</code></pre></div>
<p dir="auto">}</p>
</li>
</ul>
<p dir="auto">}<br>
The configuration</p>
<p dir="auto">Code:</p>
<p dir="auto">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</p>
<p dir="auto">&lt;beans xmlns="<a href="http://www.springframework.org/schema/beans" rel="nofollow">http://www.springframework.org/schema/beans</a>"<br>
xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow">http://www.w3.org/2001/XMLSchema-instance</a>" xmlns:task="<a href="http://www.springframework.org/schema/task" rel="nofollow">http://www.springframework.org/schema/task</a>"<br>
xsi:schemaLocation="<a href="http://www.springframework.org/schema/beans" rel="nofollow">http://www.springframework.org/schema/beans</a> <a href="http://www.springframework.org/schema/beans/spring-beans.xsd" rel="nofollow">http://www.springframework.org/schema/beans/spring-beans.xsd</a> <a href="http://www.springframework.org/schema/task" rel="nofollow">http://www.springframework.org/schema/task</a> <a href="http://www.springframework.org/schema/task/spring-task-3.0.xsd%22%3E" rel="nofollow">http://www.springframework.org/schema/task/spring-task-3.0.xsd"&gt;</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;!--  This is the bit of configuration that allows spring to search for annotations
      that indicate that particular methods should be run at particular times.  --&gt;

&lt;task:scheduler id=&quot;searchScheduler&quot;/&gt;

&lt;task:executor id=&quot;searchExecutor&quot; pool-size=&quot;1&quot;/&gt;

&lt;task:annotation-driven executor=&quot;searchExecutor&quot; scheduler=&quot;searchScheduler&quot;/&gt;"><pre class="notranslate"><code class="notranslate">&lt;!--  This is the bit of configuration that allows spring to search for annotations
      that indicate that particular methods should be run at particular times.  --&gt;

&lt;task:scheduler id="searchScheduler"/&gt;

&lt;task:executor id="searchExecutor" pool-size="1"/&gt;

&lt;task:annotation-driven executor="searchExecutor" scheduler="searchScheduler"/&gt;
</code></pre></div>
<p dir="auto">&lt;/beans&gt;<br>
The output I see:<br>
Code:<br>
11316 [searchScheduler-1] INFO  com.vodori.cms.feature.socialMedia.service.impl.DataHarvestingServiceImpl  - Starting data retrieval at Mon Feb 15 14:56:00 CST 2010<br>
11321 [searchScheduler-1] INFO  com.vodori.cms.feature.socialMedia.service.impl.DataHarvestingServiceImpl  - Finished media data retrieval at Mon Feb 15 14:56:00 CST 2010<br>
count is 0<br>
11321 [searchScheduler-1] INFO  com.vodori.cms.feature.socialMedia.service.impl.DataHarvestingServiceImpl  - Starting data retrieval at Mon Feb 15 14:56:00 CST 2010<br>
11321 [searchScheduler-1] INFO  com.vodori.cms.feature.socialMedia.service.impl.DataHarvestingServiceImpl  - Finished media data retrieval at Mon Feb 15 14:56:00 CST 2010<br>
count is 1<br>
71318 [searchScheduler-1] INFO  xxx.service.impl.DataHarvestingServiceImpl  - Starting data retrieval at Mon Feb 15 14:57:00 CST 2010<br>
71318 [searchScheduler-1] INFO  xxx.service.impl.DataHarvestingServiceImpl  - Finished media data retrieval at Mon Feb 15 14:57:00 CST 2010<br>
count is 2<br>
71318 [searchScheduler-1] INFO  xxx.service.impl.DataHarvestingServiceImpl  - Starting data retrieval at Mon Feb 15 14:57:00 CST 2010<br>
71318 [searchScheduler-1] INFO  xxx.service.impl.DataHarvestingServiceImpl  - Finished media data retrieval at Mon Feb 15 14:57:00 CST 2010<br>
count is 3<br>
Any insight very much appreciated.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 GA</p>
<p dir="auto"><strong>Reference URL:</strong> <a href="http://forum.springsource.org/showthread.php?t=84747" rel="nofollow">http://forum.springsource.org/showthread.php?t=84747</a></p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398101633" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11322" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11322/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11322">#11322</a> ScheduledAnnotationBeanPostProcessor registers schedules twice in web application (<em><strong>"duplicates"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398150882" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14094" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14094/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14094">#14094</a> CronSequenceGenerator fails to accurately compute earliest next date when using second expression</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398103939" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11669" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11669/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11669">#11669</a> CronTrigger is not triggered at correct time</li>
</ul>
<p dir="auto">5 votes, 21 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=cmjartan" rel="nofollow">Carsten Mjartan</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-3202?redirect=false" rel="nofollow">SPR-3202</a></strong> and commented</p>
<p dir="auto">I'm using Freemarkers TagLib-Support to make use of spring form tags in freemarker views.</p>
<p dir="auto">Example: page.ftl</p>
<p dir="auto">&lt;#assign form=JspTaglibs["http://www.springframework.org/tags/form"]&gt;<br>
...<br>
&lt;<code class="notranslate">@form</code>.form commandName="registrationData" method="post"&gt;<br>
...<br>
&lt;<code class="notranslate">@form</code>.errors path="surname"/&gt;</p>
<p dir="auto"><a href="mailto:/@form.form">/@form.form</a></p>
<p dir="auto">All tags render fine except for the ErrorsTag.</p>
<p dir="auto">Debugging through the code, I can see that ErrorsTag.renderDefaultContent is successfully processed and finds the errors, but it doesn't show up in the generated HTML.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0.2</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398077603" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/8110" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/8110/hovercard" href="https://github.com/spring-projects/spring-framework/issues/8110">#8110</a> form:errors and form:option JSP tags don't render in FreeMarker templates (<em><strong>"duplicates"</strong></em>)</li>
</ul>