Why isn't Spring running my @Scheduled method?

前端 未结 8 1673
天涯浪人
天涯浪人 2020-12-29 03:18

I\'m a bit befuddled because I\'m trying use use @Scheduled annotations, but Spring doesn\'t seem to be finding my methods. The end result is that, none of my m

8条回答
  •  醉话见心
    2020-12-29 03:54

    In spite of that I am using Spring 3.1.2, I am running into the same problem in case i place my executor and scheduler tag in ApplicationContext.xml. i have two xml configuration file for spring in my project which are :

    1. applicationContext.xml
    2. dispatcher-servlet.xml

    So try to move your configuration to the last configuration file which spring reads. in my case it is start working by moving my configuration to dispatcher-servlet.xml

    here is my example:

    applicationContext.xml

    
    
    
        
            
        
    
        
        
            
                
                    
                        
                    
                    
                
            
        
    
        
        
    
        
        
            
                
            
            
                
                    
                    org.hibernate.dialect.PostgreSQLDialect
                    update
                    true
                    
                    
                    
                    
                    true
                    UTF-8
                    false
                    false
                    false
                
            
            
        
    
        
            
        
    
        
            
                
            
        
    
        
    
    
    
    
    

    dispatcher-servlet.xml

    
    
    
        
    
        
        
    
        
        
            
        
    
        
            
        
    
        
            
            
            
        
    
        
            
            
                
                    
                
            
        
    
        
            
        
    
        
        
            
        
    
        
    
        
        
        
         
    
    

    hope it helps.

提交回复
热议问题