Where is your spring configuration file? Is it inside the war file?

When you have two hosts, do you have the war file in both? If this is he case 
you may deploy the entire war file twice. Generally a deployed war file can run 
only in one host. If you run it in two hosts, you are deploying the entire war 
file twice. This will create two instances of your quartz object.

If all you need is multiple domains mapped to the same application, try 
replacing 

<Host name="localhost" ...>...</Host>
<Host name="XXX.com"...>...</Host>

With:
<Host name="localhost" ...>
<Alias>XXX.com</Alias>
...</Host>

E

----- Original Message -----
From: zlzc2000 <zlzc2...@hotmail.com>
To: users@tomcat.apache.org
Sent: Fri, 23 Oct 2009 00:28:16 -0700 (PDT)
Subject: How can I prevent Quartz multiple execution after tomcat restart


hallo,

we have problem with Quartz and Tomcat.
Im using tomcat 5.5
i using 'localhost' to deploy a Spring project on server.
after deploy run Quartz the job once time. this is right.
but after restart tomcat, execute the same jobs twice at the same time.
(project new deploy then no problem, only after tomcat stop->start or
restart, then comming problem)
(2 quartz instanz created and started)

in server.xml i use two <Host> tags 1: <Host name="localhost" ...> 2:<Host
name="XXX.com"...> if i use only one host, for example only <Host
name="XXX.com"...>, then no problem., but by which i can not use interface
of tomcat.

a strange thing: in tomcat management interface i have stoped project, but
even though, in catalina.out can ich see, there is still one quartz job run.
I CANT UNDERSTAND!

how can i prevent it?
follow code are our server.xml code


<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="false"
xmlValidation="false" xmlNamespaceAware="false">
</Host>

<Host name="XXX.com"
unpackWARs="true" autoDeploy="false" deployOnStartup="false"
xmlValidation="false" xmlNamespaceAware="false">
<Alias>www.XXX.com</Alias>
<Context path=""
docBase="/var/lib/tomcat55/webapps/xxx"
reloadable="true">
<Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="org.postgresql.Driver"
connectionURL="jdbcostgresql://localhost:5432/xxx"
connectionName="postgres" connectionPassword="" userTable="users_password"
userNameCol="userid" userCredCol="password"
userRoleTable="user_role" roleNameCol="rolename"
digest="MD5"/>
</Context>
</Host>
... 

follow code are configuration of Quartz in applicationContex.xml

<bean id="robotSearchSwapper"
class="org.springframework.scheduling.quartz.Metho
dInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref bean="swapperService" />
</property>
<property name="targetMethod">
<value>robotSearch</value>
</property>
<property name="concurrent" value="false" />
</bean>

<bean id="robotSearchTrigger"
class="org.springframework.scheduling.quartz.Simpl eTriggerBean">
<property name="jobDetail" ref="robotSearchSwapper"/>

<property name="startDelay">
<value>180000</value>
</property>
<property name="repeatInterval">
<value>300000</value>
</property>
</bean>
<bean id="scheduler" class="org.springframework.scheduling.quartz.Sched
ulerFactoryBean">
<property name="quartzProperties">
<props>
<prop key="org.quartz.threadPool.class">org.quartz.simpl
.SimpleThreadPool</prop>
<prop key="org.quartz.threadPool.threadCount">1</prop>
<prop key="org.quartz.threadPool.threadPriority">1</prop>
<prop key="org.quartz.threadPool.threadsInheritContextCl
assLoaderOfInitializingThread">true</prop>
</props>
</property>

<property name="triggers">
<list>
<ref local="robotSearchTrigger"/>
</list>
</property>
</bean>

-- 
View this message in context: 
http://www.nabble.com/How-can-I-prevent-Quartz-multiple-execution-after-tomcat-restart-tp26021949p26021949.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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




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

Reply via email to