tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zoran Avtarovski <zo...@sparecreative.com>
Subject Re: Spring Scheduled Task is triggered multiple times
Date Fri, 03 Jul 2015 06:41:51 GMT
I went through the logs in much greater detail today and I noticed when
the server starts I get multiple Spring loads in the log:

org.apache.catalina.core.ApplicationContext.log Initializing Spring root
WebApplicationContext

And the number of times the log entry appears correlates to the number of
executions, which makes sense.

It looks like I need to find out why the spring config is loaded multiple
times.

I have a context.xml in the META-INF directory which sets up a db
container and jndi datasource realm, could this be the issue?

<?xml version="1.0" encoding="UTF-8"?>
<Context URIEncoding="UTF-8" antiResourceLocking="false" path="/pain">
  <Resource     auth="Container"
	driverClassName="com.mysql.jdbc.Driver"
	logAbandoned="true"
	testOnBorrow="true"
	validationQuery="select count(*) from types"
	maxActive="100" 
	maxIdle="30" 
	maxWait="10000" 
	name=“jdbc/myDB" 
	username=“xxx"
	password=“xxxx" 
	removeAbandoned="true"
	removeAbandonedTimeout="60"
	type="javax.sql.DataSource"
	url="jdbc:mysql://localhost:3306/my_data_v1?useUnicode=true&amp;characterE
ncoding=UTF-8&amp;zeroDateTimeBehavior=convertToNull"/>

  <Realm        className="org.apache.catalina.realm.DataSourceRealm"
	dataSourceName=“jdbc/myDB"
	debug="1" 
	localDataSource="true"
	roleNameCol="status"
	userCredCol="password"
	userNameCol="user_name"
	userRoleTable="users"
	userTable="users"/>
</Context>



Z.

On 2/07/2015 3:22 pm, "Zoran Avtarovski" <zoran@sparecreative.com> 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.
>
>We have an Ubuntu 14.04.1 Server using the standard tomcat 7 installed
>using
>apt-get and running on oracle java 8.
>
>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.
>
>Z.
>
>



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


Mime
View raw message