tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neven Cvetkovic <neven.cvetko...@gmail.com>
Subject Re: Spring Scheduled Task is triggered multiple times
Date Fri, 03 Jul 2015 08:00:27 GMT
Hey Zoran,

On 3 Jul 2015 08:42, "Zoran Avtarovski" <zoran@sparecreative.com> wrote:
>
> 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

How are you loading your spring context? Where do you initialize it? Please
share your web.xml, it is probably there.

Do you reference spring anywhere else, e.g. in your struts actions?

>
> 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?
>

That's not an issue. You are just configuring your datasource and security
domain/realm.

> <?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>
>

Cheers
Neven

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message