Primavera + cuarzo hacen un trabajo 7 veces

i'm trying to do quartz scheduling from this link: QUARTZ+SPRING

But when I run this on a glassfish it makes the job 7times.

applicationContext.xml

<bean id="exampleBusinessObject" class="cz.elit.ediplus.core.dao.ExampleBusinessObject" 
    p:companyService-ref="CompanyService"
    p:invoiceService-ref="InvoiceService" 
    p:orderService-ref="OrderService" 
    p:packingListService-ref="PackingListService" />

<bean id="jobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
    <property name="targetObject" ref="exampleBusinessObject"/>
    <property name="targetMethod" value="doIt"/>
    <property name="concurrent" value="false"/>
</bean>
<bean id="simpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
      <property name="jobDetail" ref="jobDetail"/>
    <property name="startDelay" value="10000"/>
    <property name="repeatInterval" value="300000"/>
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
    <property name="triggers">
        <list>
            <ref bean="simpleTrigger"/>
        </list>
    </property>
</bean>

and some code from web.xml

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<context-param>
    <param-name>log4jConfigLocation</param-name>
    <param-value>/WEB-INF/log4j.properties</param-value>    
</context-param>
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
    <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<servlet>
    <servlet-name>dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>2</load-on-startup>
</servlet>
<servlet>
    <servlet-name>jaxws-servlet</servlet-name>
    <servlet-class>com.sun.xml.ws.transport.http.servlet.WSSpringServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>dispatcher</servlet-name>
    <url-pattern>*.htm</url-pattern>
</servlet-mapping>

Does anyone know where the mistake could be? I read some forums, but with no effect. The strange thing is, when I run it on localhost, the job runs only one time, but when I deploy it on a main server, the job runs seventimes.

preguntado el 03 de mayo de 12 a las 15:05

Are you using glassfish locally too when it "works"? Or are you using a different container on localhost? -

yes on a localhost I use glassfish too.. could it be in a different version of GF? -

@yen1k Do you happen to have multiple load balanced servers in production? Each server instance will run its own job. -

@maple_shaft No, it has not loadballancing. :-/ Do You think it could be in GF settings? Info for me, where to start to looking for mistake.. :-) -

This is not a solution, but better use doc for version 3.1.x static.springsource.org/spring/docs/3.1.x/… version 1.2.x is quite old. -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.