Hi Christopher,

On 2/07/2015 11:52 pm, "Christopher Schultz"
<ch...@christopherschultz.net> wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA256
>
>Zoran,
>
>On 7/2/15 1:22 AM, Zoran Avtarovski wrote:
>> We have a struts2 based app that uses spiring scheduling to trigger
>> a task every morning at 6am.
>> 
>> The problem we have is that task in triggered multiple times,
>> simultaneously.
>
>What evidence do you have that the task is triggered multiple times?
>(I'm not saying I don't believe you, I'm just curious... it might help
>determine WHY it's being run twice.)

The task is running 6 times as I log an error message with log4j2 each
time spring triggers the task

2015-07-02 06:00:00,280 ERROR [pool-4-thread-1] service.PatientDaoService
(PatientDaoService.java:783) - Task triggered.
2015-07-02 06:00:00,287 ERROR [pool-5-thread-1] service.PatientDaoService
(PatientDaoService.java:783) - Task triggered.
2015-07-02 06:00:00,281 ERROR [pool-7-thread-1] service.PatientDaoService
(PatientDaoService.java:783) - Task triggered.
2015-07-02 06:00:00,824 ERROR [pool-3-thread-1] service.PatientDaoService
(PatientDaoService.java:783) - Task triggered.
2015-07-02 06:00:00,825 ERROR [pool-7-thread-1] service.PatientDaoService
(PatientDaoService.java:783) - Task triggered.
2015-07-02 06:00:00,869 ERROR [pool-8-thread-1] service.PatientDaoService
(PatientDaoService.java:783) - Task triggered.

You can see the task is triggered several times at the same time.

Here’s the relevant part of my spring config

<bean id="springCronTask" class="SpringCronTask">
        <property name="patientService">
                <ref bean="patientService"/>
        </property>
        <property name="localisedTextService">
                <ref bean="localisedTextService"/>
        </property>
    </bean>

<task:scheduled-tasks>
        <task:scheduled ref="springCronTask" method="sendReminders" cron="0 0 6 
*
* ?" />
    </task:scheduled-tasks>




>
>> We have an Ubuntu 14.04.1 Server using the standard tomcat 7
>> installed using apt-get and running on oracle java 8.
>
>Ubuntu tends to be relatively up-to-date compared to other distros,
>but do you know what version of Tomcat 7 you actually have? It won't
>have anything to do with this problem, but upgrading to latest is
>always recommended.

Agreed and we are running Apache Tomcat/7.0.52 (Ubuntu) I figure Ubuntu
are pretty good at pushing out updates and I’m not too concerned if we’re
a little behind in releases.

Also, I don’t think it is a Tomcat issue but something in the our
configuration of either tomcat or spring.

>
>> Tomcat is configured as a stand alone not a cluster and I had a
>> look at the servers.xml file and it only has one host.
>> 
>> It has to be the way we have tomcat configured, but I can¹t see
>> what. I changed from quartz to spring scheduling thinking the issue
>> was quartz, but that made no difference.
>> 
>> I¹d really appreciate any pointers at this stage.
>
>At first, I was sure the issue would be multiple-deployment, triggered
>by putting a <Context> element in your server.xml that pointed to a
>WAR file (or exploded WAR directory) in your webapps/ folder. That
>would do it. But you posted your server.xml elsewhere in this thread,
>and that's not the problem.
>
>But you might still have a double-deployment.
>
>Do you have any files in CATALINA_BASE/conf/Catalina/localhost/? If
>so, which ones and what do they contain?

The only file here is manager.xml


>
>What do you have in CATALINA_BASE/webapps/?

A ROOT directory with a simple redirect jsp for redirect purposes
My jar file and an exploded version of the jar

>
>How do you launch Tomcat?

Using the tomcat7 Upstart script that installed in init.d on Ubuntu



>
>- -chris
>-----BEGIN PGP SIGNATURE-----
>Comment: GPGTools - http://gpgtools.org
>
>iQIcBAEBCAAGBQJVlUIoAAoJEBzwKT+lPKRYMccQAJZ1lUii5AnABhG83thkcMNr
>6eQ7FgNR9tqrwenn+DfSc4bXvTxxLNwa0hySHaopAwBlMkpxdxvUmSvWMtZlFaCI
>vAX6KaMLUnDT1oWChq4FJT9hX8GHKoE01xJnnaY8eph3mNu2F4KjEuK0VASY4b2g
>HaB1lAQgPuebW/hjBpiRkn0NKiEZbyJGGJXNKYHyCcUKf0C3Oitsv4gagcfkA1DQ
>wGhQmYGNYm55NMlQeMULUm+OeNynDhQVuVC1akKmYrO6EqVqmjajww4DU65xQpV+
>j+laTnYibidTYfI2TMQru4V/mnEKYLHJMU2avTC8B8+8uD95RCaZz+F3AI15x/Pu
>0fsMolT8hNGdF+92vP9UNZ4E1JW7YEeqkVudsfrZUQbuiwJeQF790IRp4ZE1TT44
>J/Omir3xVh3OjhZuysVWEBtF3S2tqVRVdkl8QUjeTohUfoNpsG8i+HpH6GklQSSX
>X37wxrmuQm7PUpSQ2aNEPxWKVPC1/njXcTXsr51fCAV1+Hcjojg1Fd0ky0ATPCCE
>ZuM/HQBXx2cOic4zOIHMyng+JqvWRUerTcu3yYEezXyn/G/iQOomXRLHmoZE1NAp
>u38GcW6OekhaJ3z+g+Yz3pdoN+d9q5Ajk5/NreJ/f7IRgDiy+phYR4bnrSQ4dOhz
>JoPHm92in/xmP/JEPSCX
>=Kp1E
>-----END PGP SIGNATURE-----
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>For additional commands, e-mail: users-h...@tomcat.apache.org
>

Z.
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to