IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Spring Java Discussion :

[Spring] Intégration avec Quartz


Sujet :

Spring Java

  1. #1
    Membre régulier
    Inscrit en
    Mars 2007
    Messages
    179
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 179
    Points : 97
    Points
    97
    Par défaut [Spring] Intégration avec Quartz
    Bonjour
    Je suis un peu débutant en Spring, et encore plus en Quartz.
    J'aimerais intégrer Quartz à Spring mais rien ne se passe...

    Voici mon applicationContext.xml
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
     
    <?xml version="1.0" encoding="UTF-8"?>
     
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
     
    <beans>
     
     
        <bean id="trafficGenerationJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
            <property name="targetObject" ref="trafficGenerationObject"/>
            <property name="targetMethod" value="doIt"/>
        </bean>
     
        <bean id="trafficGenerationObject" class="com.thalys.opalys.schedule.TrafficGenerationJob"/>
     
        <!--<bean id="trafficGenerationTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">-->
        <!--<property name="jobDetail" ref="trafficGenerationJob"/>-->
        <!--<property name="startDelay" value="10000"/>-->
        <!--<property name="repeatCount" value="10"/>-->
        <!--</bean>-->
     
        <bean id="trafficGenerationTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
            <property name="jobDetail" ref="trafficGenerationJob"/>
            <property name="startDelay" value="10000"/>
            <property name="repeatCount" value="10"/>
        </bean>
     
        <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
            <property name="autoStartup">
                <value>true</value>
            </property>
            <property name="triggers">
                <list>
                    <ref bean="trafficGenerationTrigger"/>
                </list>
            </property>
        </bean>
     
    </beans>
    Voici ma classe TrafficGenerationJob
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    package com.thalys.opalys.schedule;
     
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.quartz.JobExecutionContext;
    import org.quartz.JobExecutionException;
     
    /**
         * This job handles the traffic generation from a given rmac file
     * already stored on the file system
     * WARNING: the scheduled time MUST BE after getting the rmac file, ie after`
     * the time set for the ImportRmacJob
     */
    public class TrafficGenerationJob  {
     
        private final static Log LOG = LogFactory.getLog(DumbJob.class);
     
        public void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
     
        }
     
        public void doIt(){
            LOG.info("TrafficGenerationJob started");
     
            LOG.info("TrafficGenerationJob finished successfully");
        }
    }
    Et voici le log de mon serveur JBoss, au lancement, avec en rouge les parties concernant Quartz, enfin je crois
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    /Applications/jboss-4.0.5.GA/bin/run.sh
    =========================================================================
    
      JBoss Bootstrap Environment
    
      JBOSS_HOME: /Applications/jboss-4.0.5.GA
    
      JAVA: /System/Library/Frameworks/JavaVM.framework/Home/bin/java
    
      JAVA_OPTS: -Dprogram.name=run.sh -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -server -Xms128m -Xmx512m
    
      CLASSPATH: /Applications/jboss-4.0.5.GA/bin/run.jar:/System/Library/Frameworks/JavaVM.framework/Home/lib/tools.jar
    
    =========================================================================
    
    17:07:53,469 INFO  [Server] Starting JBoss (MX MicroKernel)...
    17:07:53,470 INFO  [Server] Release ID: JBoss [Zion] 4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)
    17:07:53,472 INFO  [Server] Home Dir: /Applications/jboss-4.0.5.GA
    17:07:53,472 INFO  [Server] Home URL: file:/Applications/jboss-4.0.5.GA/
    17:07:53,473 INFO  [Server] Patch URL: null
    17:07:53,473 INFO  [Server] Server Name: default
    17:07:53,473 INFO  [Server] Server Home Dir: /Applications/jboss-4.0.5.GA/server/default
    17:07:53,473 INFO  [Server] Server Home URL: file:/Applications/jboss-4.0.5.GA/server/default/
    17:07:53,473 INFO  [Server] Server Log Dir: /Applications/jboss-4.0.5.GA/server/default/log
    17:07:53,474 INFO  [Server] Server Temp Dir: /Applications/jboss-4.0.5.GA/server/default/tmp
    17:07:53,474 INFO  [Server] Root Deployment Filename: jboss-service.xml
    17:07:53,733 INFO  [ServerInfo] Java version: 1.5.0_07,Apple Computer, Inc.
    17:07:53,734 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.5.0_07-87,"Apple Computer, Inc."
    17:07:53,734 INFO  [ServerInfo] OS-System: Mac OS X 10.4.10,i386
    17:07:54,207 INFO  [Server] Core system initialized
    17:07:56,527 INFO  [WebService] Using RMI server codebase: http://nico-mac.local:8083/
    17:07:56,546 INFO  [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
    17:08:01,422 INFO  [ServiceEndpointManager] WebServices: jbossws-1.0.3.SP1 (date=200609291417)
    17:08:02,707 INFO  [Embedded] Catalina naming disabled
    17:08:02,747 INFO  [ClusterRuleSetFactory] Unable to find a cluster rule set in the classpath. Will load the default rule set.
    17:08:02,748 INFO  [ClusterRuleSetFactory] Unable to find a cluster rule set in the classpath. Will load the default rule set.
    17:08:03,028 INFO  [Http11BaseProtocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8080
    17:08:03,029 INFO  [Catalina] Initialization processed in 281 ms
    17:08:03,029 INFO  [StandardService] Starting service jboss.web
    17:08:03,055 INFO  [StandardEngine] Starting Servlet Engine: Apache Tomcat/5.5.20
    17:08:03,082 INFO  [StandardHost] XML validation disabled
    17:08:03,155 INFO  [Catalina] Server startup in 126 ms
    17:08:03,442 INFO  [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=.../deploy/http-invoker.sar/invoker.war/
    17:08:04,414 INFO  [TomcatDeployer] deploy, ctxPath=/, warUrl=.../deploy/jbossweb-tomcat55.sar/ROOT.war/
    17:08:04,581 INFO  [TomcatDeployer] deploy, ctxPath=/jbossws, warUrl=.../tmp/deploy/tmp10847jbossws-context-exp.war/
    17:08:04,812 INFO  [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=.../deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
    17:08:06,199 INFO  [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=.../deploy/management/console-mgr.sar/web-console.war/
    
    ...
    
    17:08:14,013 INFO  [CollectionFactory] JDK 1.4+ collections available
    17:08:14,026 INFO  [CollectionFactory] Commons Collections 3.x available
    17:08:14,054 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
    17:08:14,555 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext-dataSource.xml]
    17:08:14,596 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext-quartz.xml]
    17:08:14,612 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext-server-authentication.xml]
    17:08:14,699 INFO  [XmlWebApplicationContext] Bean factory for application context [Root WebApplicationContext]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [messageSource,sessionFactory,hibernateInterceptor,pointDao,particularPointDao,axisDao,referenceDao,passagePointDao,varianteDao,userDao,roleDao,regularityFormDao,endOfMissionMessageDao,effectiveTrancheDao,trainSetDao,effectivePassageDao,incidentFormDao,eventTargetDao,eventDao,actionDao,eventTargetTypeDao,eventTypeDao,actionTypeDao,emailActionTypeDao,emailUserActionTypeDao,emailMailingListActionTypeDao,mailingListDao,stateDao,breakageFormDao,incidentDao,incidentTypeDao,effectDao,effectivePassageIssueDao,varianteSpecialCaseDao,trancheDao,breakageDao,incidentLocationDao,incidentFormNoticeSenderDao,administrationService,dataImportService,echoService,securityService,trafficGeneratorService,schedulerService,valentysService,incidentService,breakageService,regularityService,serviceSecurityInterceptor,serviceAccessDecisionManager,serviceDecisionVoter,dataSource,transactionManager,scheduler,basicProcessingFilter,authenticationEntryPoint,opalysAuthenticationManager,daoAuthenticationProvider,userCacheManager,userCacheBackend,userAuthenticationCache,passwordEncoder,opalysUserDetailsService]; root of BeanFactory hierarchy
    17:08:14,719 INFO  [XmlWebApplicationContext] 63 beans defined in application context [Root WebApplicationContext]
    17:08:14,815 INFO  [DefaultListableBeanFactory] Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [messageSource,sessionFactory,hibernateInterceptor,pointDao,particularPointDao,axisDao,referenceDao,passagePointDao,varianteDao,userDao,roleDao,regularityFormDao,endOfMissionMessageDao,effectiveTrancheDao,trainSetDao,effectivePassageDao,incidentFormDao,eventTargetDao,eventDao,actionDao,eventTargetTypeDao,eventTypeDao,actionTypeDao,emailActionTypeDao,emailUserActionTypeDao,emailMailingListActionTypeDao,mailingListDao,stateDao,breakageFormDao,incidentDao,incidentTypeDao,effectDao,effectivePassageIssueDao,varianteSpecialCaseDao,trancheDao,breakageDao,incidentLocationDao,incidentFormNoticeSenderDao,administrationService,dataImportService,echoService,securityService,trafficGeneratorService,schedulerService,valentysService,incidentService,breakageService,regularityService,serviceSecurityInterceptor,serviceAccessDecisionManager,serviceDecisionVoter,dataSource,transactionManager,scheduler,basicProcessingFilter,authenticationEntryPoint,opalysAuthenticationManager,daoAuthenticationProvider,userCacheManager,userCacheBackend,userAuthenticationCache,passwordEncoder,opalysUserDetailsService]; root of BeanFactory hierarchy]
    17:08:14,941 INFO  [Environment] Hibernate 3.1.3
    17:08:14,953 INFO  [Environment] hibernate.properties not found
    17:08:14,955 INFO  [Environment] using CGLIB reflection optimizer
    17:08:14,955 INFO  [Environment] using JDK 1.4 java.sql.Timestamp handling
    ...
    
    17:08:16,494 INFO  [ConnectionProviderFactory] Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
    17:08:16,965 INFO  [SettingsFactory] RDBMS: MySQL, version: 5.0.41
    17:08:16,965 INFO  [SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.5 ( $Date: 2007-03-01 00:01:06 +0100 (Thu, 01 Mar 2007) $, $Revision: 6329 $ )
    17:08:16,991 INFO  [Dialect] Using dialect: org.hibernate.dialect.MySQLInnoDBDialect
    ...
    17:08:20,767 INFO  [[/opalys-server-remoting]] Loading WebApplicationContext for Spring FrameworkServlet 'opalys-remoting'
    17:08:20,767 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext-export-remoteServices.xml]
    17:08:20,834 INFO  [XmlWebApplicationContext] Bean factory for application context [WebApplicationContext for namespace 'opalys-remoting-servlet']: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [/AdministrationService,/DataImportService,/EchoService,/SecurityService,/TrafficGeneratorService,/SchedulerService,/ValentysService,/IncidentService,/BreakageService,/RegularityService,/Scheduler,/RemoteAuthenticationManagerService]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [messageSource,sessionFactory,hibernateInterceptor,pointDao,particularPointDao,axisDao,referenceDao,passagePointDao,varianteDao,userDao,roleDao,regularityFormDao,endOfMissionMessageDao,effectiveTrancheDao,trainSetDao,effectivePassageDao,incidentFormDao,eventTargetDao,eventDao,actionDao,eventTargetTypeDao,eventTypeDao,actionTypeDao,emailActionTypeDao,emailUserActionTypeDao,emailMailingListActionTypeDao,mailingListDao,stateDao,breakageFormDao,incidentDao,incidentTypeDao,effectDao,effectivePassageIssueDao,varianteSpecialCaseDao,trancheDao,breakageDao,incidentLocationDao,incidentFormNoticeSenderDao,administrationService,dataImportService,echoService,securityService,trafficGeneratorService,schedulerService,valentysService,incidentService,breakageService,regularityService,serviceSecurityInterceptor,serviceAccessDecisionManager,serviceDecisionVoter,dataSource,transactionManager,scheduler,basicProcessingFilter,authenticationEntryPoint,opalysAuthenticationManager,daoAuthenticationProvider,userCacheManager,userCacheBackend,userAuthenticationCache,passwordEncoder,opalysUserDetailsService]; root of BeanFactory hierarchy
    17:08:20,835 INFO  [XmlWebApplicationContext] 12 beans defined in application context [WebApplicationContext for namespace 'opalys-remoting-servlet']
    17:08:20,837 INFO  [DefaultListableBeanFactory] Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [/AdministrationService,/DataImportService,/EchoService,/SecurityService,/TrafficGeneratorService,/SchedulerService,/ValentysService,/IncidentService,/BreakageService,/RegularityService,/Scheduler,/RemoteAuthenticationManagerService]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [messageSource,sessionFactory,hibernateInterceptor,pointDao,particularPointDao,axisDao,referenceDao,passagePointDao,varianteDao,userDao,roleDao,regularityFormDao,endOfMissionMessageDao,effectiveTrancheDao,trainSetDao,effectivePassageDao,incidentFormDao,eventTargetDao,eventDao,actionDao,eventTargetTypeDao,eventTypeDao,actionTypeDao,emailActionTypeDao,emailUserActionTypeDao,emailMailingListActionTypeDao,mailingListDao,stateDao,breakageFormDao,incidentDao,incidentTypeDao,effectDao,effectivePassageIssueDao,varianteSpecialCaseDao,trancheDao,breakageDao,incidentLocationDao,incidentFormNoticeSenderDao,administrationService,dataImportService,echoService,securityService,trafficGeneratorService,schedulerService,valentysService,incidentService,breakageService,regularityService,serviceSecurityInterceptor,serviceAccessDecisionManager,serviceDecisionVoter,dataSource,transactionManager,scheduler,basicProcessingFilter,authenticationEntryPoint,opalysAuthenticationManager,daoAuthenticationProvider,userCacheManager,userCacheBackend,userAuthenticationCache,passwordEncoder,opalysUserDetailsService]; root of BeanFactory hierarchy]
    17:08:20,914 INFO  [DispatcherServlet] Using context class [org.springframework.web.context.support.XmlWebApplicationContext] for servlet 'opalys-remoting'
    17:08:20,919 INFO  [DispatcherServlet] Unable to locate MultipartResolver with name 'multipartResolver': no multipart request handling provided
    17:08:20,921 INFO  [DispatcherServlet] Unable to locate LocaleResolver with name 'localeResolver': using default [org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver@ea320f]
    17:08:20,940 INFO  [DispatcherServlet] Unable to locate ThemeResolver with name 'themeResolver': using default [org.springframework.web.servlet.theme.FixedThemeResolver@5601ad]
    17:08:20,961 INFO  [DispatcherServlet] No HandlerMappings found in servlet 'opalys-remoting': using default
    17:08:20,966 INFO  [DispatcherServlet] No HandlerAdapters found in servlet 'opalys-remoting': using default
    17:08:20,982 INFO  [DispatcherServlet] No ViewResolvers found in servlet 'opalys-remoting': using default
    17:08:20,982 INFO  [DispatcherServlet] FrameworkServlet 'opalys-remoting': initialization completed in 216 ms
    17:08:20,982 INFO  [DispatcherServlet] Servlet 'opalys-remoting' configured successfully
    17:08:21,063 INFO  [TomcatDeployer] deploy, ctxPath=/opalys, warUrl=.../tmp/deploy/tmp10881opalys-server-4.0.10-SNAPSHOT.ear-contents/opalys-server-web-4.0.10-SNAPSHOT-exp.war/
    17:08:21,613 INFO  [ContextLoader] Root WebApplicationContext: initialization started
    17:08:21,613 INFO  [[/opalys]] Loading Spring root WebApplicationContext
    17:08:21,614 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext-acegi-security.xml]
    17:08:21,673 INFO  [XmlWebApplicationContext] Bean factory for application context [Root WebApplicationContext]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [filterChainProxy,httpSessionContextIntegrationFilter,logoutFilter,authenticationProcessingFilter,securityContextHolderAwareRequestFilter,rememberMeProcessingFilter,anonymousProcessingFilter,exceptionTranslationFilter,filterInvocationInterceptor,rememberMeServices,authenticationManager,daoAuthenticationProvider,userDetailsService,loggerListener]; root of BeanFactory hierarchy
    17:08:21,673 INFO  [XmlWebApplicationContext] 14 beans defined in application context [Root WebApplicationContext]
    17:08:21,677 INFO  [DefaultListableBeanFactory] Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [filterChainProxy,httpSessionContextIntegrationFilter,logoutFilter,authenticationProcessingFilter,securityContextHolderAwareRequestFilter,rememberMeProcessingFilter,anonymousProcessingFilter,exceptionTranslationFilter,filterInvocationInterceptor,rememberMeServices,authenticationManager,daoAuthenticationProvider,userDetailsService,loggerListener]; root of BeanFactory hierarchy]
    17:08:21,722 INFO  [EhCacheManagerFactoryBean] Initializing EHCache CacheManager
    17:08:21,723 INFO  [EhCacheFactoryBean] Creating new EHCache cache region 'userCache'
    17:08:21,774 INFO  [AbstractSecurityInterceptor] Validated configuration attributes
    17:08:21,774 INFO  [ContextLoader] Using context class [org.springframework.web.context.support.XmlWebApplicationContext] for root WebApplicationContext
    17:08:21,774 INFO  [ContextLoader] Root WebApplicationContext: initialization completed in 161 ms
    17:08:21,780 INFO  [ResponseOverrideFilter] Filter initialized. Response buffering is enabled
    17:08:22,240 INFO  [TilesPlugin] Tiles definition factory loaded for module ''.
    17:08:22,283 INFO  [TomcatDeployer] deploy, ctxPath=/opalys-server-ws, warUrl=.../tmp/deploy/tmp10881opalys-server-4.0.10-SNAPSHOT.ear-contents/opalys-server-webservice-4.0.10-SNAPSHOT-exp.war/
    17:08:23,228 INFO  [EARDeployer] Started J2EE application: file:/Applications/jboss-4.0.5.GA/server/default/deploy/opalys-server-4.0.10-SNAPSHOT.ear
    17:08:23,342 INFO  [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
    17:08:23,498 INFO  [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
    17:08:23,508 INFO  [JkMain] Jk running ID=0 time=0/24  config=null
    17:08:23,521 INFO  [Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)] Started in 30s:45ms
    Donc avec tout çà, je m'attends à avoir des outputs lorsque mon seerveur se démarre, cf TrafficGenerationJob avec des LOG.info()...
    Mais rien ne se passe :o(
    Please help...

  2. #2
    Rédacteur
    Avatar de Hikage
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 177
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 177
    Points : 6 301
    Points
    6 301
    Par défaut
    J'ai pris ta config et je l'ai mise dans une classe de test :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scheduler' defined in class path resource [taches.xml]: Invocation of init method failed; nested exception is org.quartz.SchedulerException: Repeat Interval cannot be zero.
    Caused by: org.quartz.SchedulerException: Repeat Interval cannot be zero.
    En configurerant le repeatInterval ca a fonctionner ensuite.
    Essaie pour voir

  3. #3
    Membre régulier
    Inscrit en
    Mars 2007
    Messages
    179
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 179
    Points : 97
    Points
    97
    Par défaut
    Bonjour

    Déjà merci beaucoup pour l'aide, c'est bien sympa et c'est efficace

    Alors en fait il se trouve que hier je lancais mon serveur sans faire aucune action dessus (c'est à dire je lancais JBoss, mais je me connectais pas dessus via mon client lourd par exemple)... et du coup je voyais pas ce probleme de repeatInterval.
    Ma connaissance de Spring est limitée, et je pensais que les beans se chargeaient au lancement du serveur, mais a priori ils se chargent à la premirèe connexion? (à me confirmer si possible)

    Quoiqu'il en soit, ce matin j'ai essayé cash en lancant mon clietn lourd également et j'ai eu le meme probleme que vous. J'ai alors valorisé le repeatInterval, et çà fonctionne, donc MERCI.

    J'attends la réponse à ma question sur Spring et je fermerais le sujet

  4. #4
    Rédacteur
    Avatar de Hikage
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 177
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 177
    Points : 6 301
    Points
    6 301
    Par défaut
    Je pense que cela dépends de ta configuration.

    C'est une application Web ? Ear ?
    Comment configure tu l'applicationContext?

  5. #5
    Membre régulier
    Inscrit en
    Mars 2007
    Messages
    179
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 179
    Points : 97
    Points
    97
    Par défaut
    Bonjour
    Il s'agit d'une app EAR.
    Pour ma question sur comment je configure mon appContext, je comprends pas vrmt la question. Voilà à quoi ressemble mon applicationContext.xml, mais je sais pas si c'est ce que vous souhaitez...
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
     
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
     
    <beans>
     
        <!-- ========================= GENERAL DEFINITIONS ========================= -->
     
        <!-- Message source for this context, loaded from localized "messages_xx" files -->
        <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
            <property name="basename"><value>messages</value></property>
        </bean>
     
        <!-- applicationContext merge-point -->
        <!-- Hibernate SessionFactory -->
        <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
            <property name="dataSource"><ref bean="dataSource"/></property>
            <property name="mappingResources">
                <list>
                    <value>com/thalys/opalys/domain/Point.hbm.xml</value>
                    <value>com/thalys/opalys/domain/ParticularPoint.hbm.xml</value>
                    <value>com/thalys/opalys/domain/Axis.hbm.xml</value>
                    <value>com/thalys/opalys/domain/Reference.hbm.xml</value>
                    <value>com/thalys/opalys/domain/PassagePoint.hbm.xml</value>
                    <value>com/thalys/opalys/domain/Variante.hbm.xml</value>
                    <value>com/thalys/opalys/domain/User.hbm.xml</value>
                    <value>com/thalys/opalys/domain/Role.hbm.xml</value>
                    <value>com/thalys/opalys/domain/RegularityForm.hbm.xml</value>
                    <value>com/thalys/opalys/domain/EndOfMissionMessage.hbm.xml</value>
                    <value>com/thalys/opalys/domain/EffectiveTranche.hbm.xml</value>
                    <value>com/thalys/opalys/domain/TrainSet.hbm.xml</value>
                    <value>com/thalys/opalys/domain/EffectivePassage.hbm.xml</value>
                    <value>com/thalys/opalys/domain/IncidentForm.hbm.xml</value>
                    <value>com/thalys/opalys/domain/EventTarget.hbm.xml</value>
                    <value>com/thalys/opalys/domain/Event.hbm.xml</value>
                    <value>com/thalys/opalys/domain/Action.hbm.xml</value>
                    <value>com/thalys/opalys/domain/EventTargetType.hbm.xml</value>
                    <value>com/thalys/opalys/domain/EventType.hbm.xml</value>
                    <value>com/thalys/opalys/domain/ActionType.hbm.xml</value>
                    <value>com/thalys/opalys/domain/MailingList.hbm.xml</value>
                    <value>com/thalys/opalys/domain/State.hbm.xml</value>
                    <value>com/thalys/opalys/domain/BreakageForm.hbm.xml</value>
                    <value>com/thalys/opalys/domain/Incident.hbm.xml</value>
                    <value>com/thalys/opalys/domain/IncidentType.hbm.xml</value>
                    <value>com/thalys/opalys/domain/Effect.hbm.xml</value>
                    <value>com/thalys/opalys/domain/EffectivePassageIssue.hbm.xml</value>
                    <value>com/thalys/opalys/domain/VarianteSpecialCase.hbm.xml</value>
                    <value>com/thalys/opalys/domain/Tranche.hbm.xml</value>
                    <value>com/thalys/opalys/domain/Breakage.hbm.xml</value>
                    <value>com/thalys/opalys/domain/IncidentLocation.hbm.xml</value>
                    <value>com/thalys/opalys/domain/IncidentFormNoticeSender.hbm.xml</value>
                </list>
            </property>
            <property name="hibernateProperties">
                <props>
                    <prop key="hibernate.show_sql">false</prop>
                    <prop key="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</prop>
                    <prop key="hibernate.cache.use_query_cache">false</prop>
                    <prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
                    <prop key="hibernate.cache.query_cache_factory">org.hibernate.cache.StandardQueryCacheFactory</prop>
                    <!-- applicationContext hibernateProperties merge-point -->
                </props>
            </property>
        </bean>
     
        <!-- The Hibernate interceptor -->
        <bean id="hibernateInterceptor" class="org.springframework.orm.hibernate3.HibernateInterceptor">
            <property name="sessionFactory"><ref bean="sessionFactory"/></property>
        </bean>
     
     
    <!-- BUSINESS BEANS DEFINITIONS, not shown here -->
     
        <!-- ========================= Start of SERVICE DEFINITIONS ========================= -->
     
        <!-- AdministrationService Service Proxy with inner AdministrationService Service Implementation -->
        <bean id="administrationService" class="org.springframework.aop.framework.ProxyFactoryBean">
            <property name="target">
                <bean class="com.thalys.opalys.business.AdministrationServiceImpl">
                    <property name="axisDao"><ref bean="axisDao"/></property>
                    <property name="particularPointDao"><ref bean="particularPointDao"/></property>
                    <property name="pointDao"><ref bean="pointDao"/></property>
                    <property name="passagePointDao"><ref bean="passagePointDao"/></property>
                    <property name="referenceDao"><ref bean="referenceDao"/></property>
                    <property name="varianteDao"><ref bean="varianteDao"/></property>
                    <property name="userDao"><ref bean="userDao"/></property>
                    <property name="roleDao"><ref bean="roleDao"/></property>
                    <property name="varianteSpecialCaseDao"><ref bean="varianteSpecialCaseDao"/></property>
                    <property name="trancheDao"><ref bean="trancheDao"/></property>
                    <property name="incidentTypeDao"><ref bean="incidentTypeDao"/></property>
                </bean>
            </property>
            <property name="proxyInterfaces">
                <value>com.thalys.opalys.business.AdministrationService</value>
            </property>
            <property name="interceptorNames">
                <list>
                    <value>hibernateInterceptor</value>
                </list>
            </property>
        </bean>
     
        <!-- DataImportService Service Proxy with inner DataImportService Service Implementation -->
        <bean id="dataImportService" class="org.springframework.aop.framework.ProxyFactoryBean">
            <property name="target">
                <bean class="com.thalys.opalys.business.DataImportServiceImpl">
                    <property name="endOfMissionMessageDao"><ref bean="endOfMissionMessageDao"/></property>
                    <property name="effectivePassageDao"><ref bean="effectivePassageDao"/></property>
                    <property name="effectiveTrancheDao"><ref bean="effectiveTrancheDao"/></property>
                    <property name="pointDao"><ref bean="pointDao"/></property>
                    <property name="trancheDao"><ref bean="trancheDao"/></property>
                    <property name="particularPointDao"><ref bean="particularPointDao"/></property>
                    <property name="administrationService"><ref bean="administrationService"/></property>
                    <property name="trafficGeneratorService"><ref bean="trafficGeneratorService"/></property>
                    <property name="regularityService"><ref bean="regularityService"/></property>
                </bean>
            </property>
            <property name="proxyInterfaces">
                <value>com.thalys.opalys.business.DataImportService</value>
            </property>
            <property name="interceptorNames">
                <list>
                    <value>hibernateInterceptor</value>
                </list>
            </property>
        </bean>
     
        <!-- EchoService Service Proxy with inner EchoService Service Implementation -->
        <bean id="echoService" class="org.springframework.aop.framework.ProxyFactoryBean">
            <property name="target">
                <bean class="com.thalys.opalys.business.EchoServiceImpl">
                </bean>
            </property>
            <property name="proxyInterfaces">
                <value>com.thalys.opalys.business.EchoService</value>
            </property>
            <property name="interceptorNames">
                <list>
                    <value>hibernateInterceptor</value>
                </list>
            </property>
        </bean>
     
        <!-- SecurityService Service Proxy with inner SecurityService Service Implementation -->
        <bean id="securityService" class="org.springframework.aop.framework.ProxyFactoryBean">
            <property name="target">
                <bean class="com.thalys.opalys.business.SecurityServiceImpl">
                    <property name="userDao"><ref bean="userDao"/></property>
                </bean>
            </property>
            <property name="proxyInterfaces">
                <value>com.thalys.opalys.business.SecurityService</value>
            </property>
            <property name="interceptorNames">
                <list>
                    <value>hibernateInterceptor</value>
                </list>
            </property>
        </bean>
     
        <!-- TrafficGeneratorService Service Proxy with inner TrafficGeneratorService Service Implementation -->
        <bean id="trafficGeneratorService" class="org.springframework.aop.framework.ProxyFactoryBean">
            <property name="target">
                <bean class="com.thalys.opalys.business.TrafficGeneratorServiceImpl">
                    <property name="varianteDao"><ref bean="varianteDao"/></property>
                    <property name="effectiveTrancheDao"><ref bean="effectiveTrancheDao"/></property>
                    <property name="regularityFormDao"><ref bean="regularityFormDao"/></property>
                    <property name="effectivePassageDao"><ref bean="effectivePassageDao"/></property>
                    <property name="pointDao"><ref bean="pointDao"/></property>
                    <property name="particularPointDao"><ref bean="particularPointDao"/></property>
                    <property name="referenceDao"><ref bean="referenceDao"/></property>
                    <property name="trancheDao"><ref bean="trancheDao"/></property>
                    <property name="administrationService"><ref bean="administrationService"/></property>
                    <property name="regularityService"><ref bean="regularityService"/></property>
                </bean>
            </property>
            <property name="proxyInterfaces">
                <value>com.thalys.opalys.business.TrafficGeneratorService</value>
            </property>
            <property name="interceptorNames">
                <list>
                    <value>hibernateInterceptor</value>
                </list>
            </property>
        </bean>
     
        <!-- SchedulerService Service Proxy with inner SchedulerService Service Implementation -->
        <bean id="schedulerService" class="org.springframework.aop.framework.ProxyFactoryBean">
            <property name="target">
                <bean class="com.thalys.opalys.business.SchedulerServiceImpl">
                    <property name="dataImportService"><ref bean="dataImportService"/></property>
                    <property name="scheduler"><ref bean="scheduler"/></property>
                    <property name="trafficGeneratorService"><ref bean="trafficGeneratorService"/></property>
                </bean>
            </property>
            <property name="proxyInterfaces">
                <value>com.thalys.opalys.business.SchedulerService</value>
            </property>
            <property name="interceptorNames">
                <list>
                    <value>hibernateInterceptor</value>
                </list>
            </property>
        </bean>
     
        <!-- ValentysService Service Proxy with inner ValentysService Service Implementation -->
        <bean id="valentysService" class="org.springframework.aop.framework.ProxyFactoryBean">
            <property name="target">
                <bean class="com.thalys.opalys.business.valentys.ValentysServiceImpl">
                    <property name="effectiveTrancheDao"><ref bean="effectiveTrancheDao"/></property>
                </bean>
            </property>
            <property name="proxyInterfaces">
                <value>com.thalys.opalys.business.valentys.ValentysService</value>
            </property>
            <property name="interceptorNames">
                <list>
                    <value>hibernateInterceptor</value>
                </list>
            </property>
        </bean>
     
        <!-- IncidentService Service Proxy with inner IncidentService Service Implementation -->
        <bean id="incidentService" class="org.springframework.aop.framework.ProxyFactoryBean">
            <property name="target">
                <bean class="com.thalys.opalys.business.IncidentServiceImpl">
                    <property name="incidentDao"><ref bean="incidentDao"/></property>
                    <property name="incidentTypeDao"><ref bean="incidentTypeDao"/></property>
                    <property name="incidentFormDao"><ref bean="incidentFormDao"/></property>
                    <property name="effectDao"><ref bean="effectDao"/></property>
                    <property name="userDao"><ref bean="userDao"/></property>
                    <property name="breakageDao"><ref bean="breakageDao"/></property>
                    <property name="breakageFormDao"><ref bean="breakageFormDao"/></property>
                    <property name="trainSetDao"><ref bean="trainSetDao"/></property>
                    <property name="incidentLocationDao"><ref bean="incidentLocationDao"/></property>
                    <property name="incidentFormNoticeSenderDao"><ref bean="incidentFormNoticeSenderDao"/></property>
                    <property name="effectiveTrancheDao"><ref bean="effectiveTrancheDao"/></property>
                    <property name="breakageService"><ref bean="breakageService"/></property>
                </bean>
            </property>
            <property name="proxyInterfaces">
                <value>com.thalys.opalys.business.IncidentService</value>
            </property>
            <property name="interceptorNames">
                <list>
                    <value>hibernateInterceptor</value>
                </list>
            </property>
        </bean>
     
        <!-- BreakageService Service Proxy with inner BreakageService Service Implementation -->
        <bean id="breakageService" class="org.springframework.aop.framework.ProxyFactoryBean">
            <property name="target">
                <bean class="com.thalys.opalys.business.BreakageServiceImpl">
                    <property name="trainSetDao"><ref bean="trainSetDao"/></property>
                    <property name="breakageDao"><ref bean="breakageDao"/></property>
                    <property name="breakageFormDao"><ref bean="breakageFormDao"/></property>
                </bean>
            </property>
            <property name="proxyInterfaces">
                <value>com.thalys.opalys.business.BreakageService</value>
            </property>
            <property name="interceptorNames">
                <list>
                    <value>hibernateInterceptor</value>
                </list>
            </property>
        </bean>
     
        <!-- RegularityService Service Proxy with inner RegularityService Service Implementation -->
        <bean id="regularityService" class="org.springframework.aop.framework.ProxyFactoryBean">
            <property name="target">
                <bean class="com.thalys.opalys.business.RegularityServiceImpl">
                    <property name="regularityFormDao"><ref bean="regularityFormDao"/></property>
                    <property name="endOfMissionMessageDao"><ref bean="endOfMissionMessageDao"/></property>
                </bean>
            </property>
            <property name="proxyInterfaces">
                <value>com.thalys.opalys.business.RegularityService</value>
            </property>
            <property name="interceptorNames">
                <list>
                    <value>hibernateInterceptor</value>
                </list>
            </property>
        </bean>
     
        <!-- ========================= End of SERVICE DEFINITIONS ========================= -->
     
    </beans>
    Ensuite j'ai un fichier applicationContext-quartz.xml, dans le même path, et Maven s'occupe de merger le tout au moment du packaging. Le applicationContext est celui montré précédemment.

    Nicolas.

  6. #6
    Rédacteur
    Avatar de Hikage
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 177
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 177
    Points : 6 301
    Points
    6 301
    Par défaut
    Je me suis mal exprimé pour la "configuration".

    Je voulais dire, comment charge tu le fichier applicationContext?
    A la main qque part ( new ClasspathApplicationContext ), ou d'une autre manière?

  7. #7
    Membre régulier
    Inscrit en
    Mars 2007
    Messages
    179
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 179
    Points : 97
    Points
    97
    Par défaut
    Alors en fait toute la plomberie Spring de base est générée par AndroMDA, et comme je szuis débutant, je ne maitrise pas encore ni Spring ni AndroMDA. Voilà en tout cas là où çà semble se passer, dans un fichier ServiceLocator.java, que jutilise pour récupérer mes services

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
     
    public class ServiceLocator
    {
     
        private ServiceLocator()
        {
            // shouldn't be instantiated
        }
     
        /**
         * The shared instance of this ServiceLocator.
         */
        private final static ServiceLocator instance = new ServiceLocator();
     
        /**
         * Gets the shared instance of this Class
         *
         * @return the shared service locator instance.
         */
        public static final ServiceLocator instance()
        {
            return instance;
        }
     
        /**
         * The bean factory reference instance.
         */
        private org.springframework.beans.factory.access.BeanFactoryReference beanFactoryReference;
     
        /**
         * The bean factory reference location.
         */
        private String beanFactoryReferenceLocation;
     
        /**
         * The bean factory reference id.
         */
        private String beanRefFactoryReferenceId;
     
        /**
         * Initializes the Spring application context from
         * the given <code>beanFactoryReferenceLocation</code>.  If <code>null</code>
         * is specified for the <code>beanFactoryReferenceLocation</code>
         * then the default application context will be used.
         *
         * @param beanFactoryReferenceLocation the location of the beanRefFactory reference.
         */
        public synchronized void init(final String beanFactoryReferenceLocation, final String beanRefFactoryReferenceId)
        {
            this.beanFactoryReferenceLocation = beanFactoryReferenceLocation;
            this.beanRefFactoryReferenceId = beanRefFactoryReferenceId;
            this.beanFactoryReference = null;
        }
     
        /**
         * Initializes the Spring application context from
         * the given <code>beanFactoryReferenceLocation</code>.  If <code>null</code>
         * is specified for the <code>beanFactoryReferenceLocation</code>
         * then the default application context will be used.
         *
         * @param beanFactoryReferenceLocation the location of the beanRefFactory reference.
         */
        public synchronized void init(final String beanFactoryReferenceLocation)
        {
            this.beanFactoryReferenceLocation = beanFactoryReferenceLocation;
            this.beanFactoryReference = null;
        }
     
        /**
         * The default bean reference factory location.
         */
        private final String DEFAULT_BEAN_REFERENCE_LOCATION = "beanRefFactory.xml";
     
        /**
         * The default bean reference factory ID.
         */
        private final String DEFAULT_BEAN_REFERENCE_ID = "beanRefFactoryEjb";
     
        /**
         * Gets the Spring ApplicationContext.
         */
        protected synchronized org.springframework.context.ApplicationContext getContext()
        {
            if (this.beanFactoryReference == null)
            {
                if (this.beanFactoryReferenceLocation == null)
                {
                    this.beanFactoryReferenceLocation = DEFAULT_BEAN_REFERENCE_LOCATION;
                }
                if (this.beanRefFactoryReferenceId == null)
                {
                    this.beanRefFactoryReferenceId = DEFAULT_BEAN_REFERENCE_ID;
                }
                org.springframework.beans.factory.access.BeanFactoryLocator beanFactoryLocator =
                    org.springframework.context.access.ContextSingletonBeanFactoryLocator.getInstance(
                        this.beanFactoryReferenceLocation);
                this.beanFactoryReference = beanFactoryLocator.useBeanFactory(this.beanRefFactoryReferenceId);
            }
            return (org.springframework.context.ApplicationContext)this.beanFactoryReference.getFactory();
        }
     
        /**
         * Shuts down the ServiceLocator and releases any used resources.
         */
        public synchronized void shutdown()
        {
            if (this.beanFactoryReference != null)
            {
                this.beanFactoryReference.release();
                this.beanFactoryReference = null;
            }
        }
     
        /**
         * Gets an instance of {@link com.thalys.opalys.business.AdministrationService}.
         */
        public final com.thalys.opalys.business.AdministrationService getAdministrationService()
        {
            return (com.thalys.opalys.business.AdministrationService)
                getContext().getBean("administrationService");
        }
     
        /**
         * Gets an instance of {@link com.thalys.opalys.business.DataImportService}.
         */
        public final com.thalys.opalys.business.DataImportService getDataImportService()
        {
            return (com.thalys.opalys.business.DataImportService)
                getContext().getBean("dataImportService");
        }
     
        /**
         * Gets an instance of {@link com.thalys.opalys.business.EchoService}.
         */
        public final com.thalys.opalys.business.EchoService getEchoService()
        {
            return (com.thalys.opalys.business.EchoService)
                getContext().getBean("echoService");
        }
     
        /**
         * Gets an instance of {@link com.thalys.opalys.business.SecurityService}.
         */
        public final com.thalys.opalys.business.SecurityService getSecurityService()
        {
            return (com.thalys.opalys.business.SecurityService)
                getContext().getBean("securityService");
        }
     
        /**
         * Gets an instance of {@link com.thalys.opalys.business.TrafficGeneratorService}.
         */
        public final com.thalys.opalys.business.TrafficGeneratorService getTrafficGeneratorService()
        {
            return (com.thalys.opalys.business.TrafficGeneratorService)
                getContext().getBean("trafficGeneratorService");
        }
     
        /**
         * Gets an instance of {@link com.thalys.opalys.business.SchedulerService}.
         */
        public final com.thalys.opalys.business.SchedulerService getSchedulerService()
        {
            return (com.thalys.opalys.business.SchedulerService)
                getContext().getBean("schedulerService");
        }
     
        /**
         * Gets an instance of {@link com.thalys.opalys.business.valentys.ValentysService}.
         */
        public final com.thalys.opalys.business.valentys.ValentysService getValentysService()
        {
            return (com.thalys.opalys.business.valentys.ValentysService)
                getContext().getBean("valentysService");
        }
     
        /**
         * Gets an instance of {@link com.thalys.opalys.business.IncidentService}.
         */
        public final com.thalys.opalys.business.IncidentService getIncidentService()
        {
            return (com.thalys.opalys.business.IncidentService)
                getContext().getBean("incidentService");
        }
     
        /**
         * Gets an instance of {@link com.thalys.opalys.business.BreakageService}.
         */
        public final com.thalys.opalys.business.BreakageService getBreakageService()
        {
            return (com.thalys.opalys.business.BreakageService)
                getContext().getBean("breakageService");
        }
     
        /**
         * Gets an instance of {@link com.thalys.opalys.business.RegularityService}.
         */
        public final com.thalys.opalys.business.RegularityService getRegularityService()
        {
            return (com.thalys.opalys.business.RegularityService)
                getContext().getBean("regularityService");
        }
     
     
        /**
         * Gets an instance of the given service.
         */
        public final Object getService(String serviceName)
        {
            return getContext().getBean(serviceName);
        }
     
    }

  8. #8
    Membre régulier
    Inscrit en
    Mars 2007
    Messages
    179
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 179
    Points : 97
    Points
    97
    Par défaut
    Bonjour à nouveau,

    En fait à mon "problème" précédent, maintenant résolu, s'ajoute un nouveau problème.

    J'ai toujours un job quartz que je veux faire démarrer au lancement de mon app serveur, je veux donc le décrire dans mon applicationContext. Ca je sais faire. Mais le souci c'est qeu ce job a besoin d'utiliser des beans Spring pouraccéder la DB, donc en d'autres termes dans le job j'ai besoin d'avoir accès aux beans Spring, à leurs champs et méthodes... Donc je ne peux pas écrire juste un POJO puisque j'ai besoin d'injecter l'application context ou le bon bean à mon Job, au démarrage de ce Job... mais je ne sais pas comment faire.

    Donc voilà je demande votre help, merci :o)

  9. #9
    Rédacteur
    Avatar de Hikage
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 177
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 177
    Points : 6 301
    Points
    6 301
    Par défaut
    Ton job est géré au niveau du fichier de configuration Spring ?

  10. #10
    Membre à l'essai
    Profil pro
    Inscrit en
    Juillet 2009
    Messages
    16
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2009
    Messages : 16
    Points : 17
    Points
    17
    Par défaut spring quartz
    Bonsoir à tous,
    Voilà je suis débutante en spring et quartz et j'aimerais avoir une idée ou un exemple de comment gérer la politique de reprise d'un job, c'est à dire que quand le job failed ,le scheduler doit le rescheduler (le relancer ) et celà tant que le jo echou et que la reprise est accepté.
    S'il vous plait quelqu'un a une idée , une orientation ou peu importe j'en ai vraiment besoin et je suis pressé par le temps .

    Merci à vous.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [MVC] Dozer mapper intégration avec Spring MVC
    Par aitBaamran dans le forum Spring Web
    Réponses: 4
    Dernier message: 26/07/2012, 12h22
  2. Problème à l'étape d'intégration avec Spring
    Par denzelboy dans le forum Tapestry
    Réponses: 1
    Dernier message: 04/12/2009, 20h51
  3. Intégration avec Winforms ?
    Par shifty.net dans le forum Ogre
    Réponses: 1
    Dernier message: 11/05/2007, 16h16
  4. Intégration avec runge kutta
    Par pedigus dans le forum Mathématiques
    Réponses: 1
    Dernier message: 27/02/2007, 14h02
  5. [Vc++ 2005] intégration avec Qt
    Par Creasy dans le forum MFC
    Réponses: 2
    Dernier message: 06/11/2005, 23h55

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo