2

In a newly created farm I have deployed a timer job which is working fine on another farm.

When I debug this timer job it calls the base constructor, however the execute method is never called and never gets into debug mode. I have already redeployed the solution, restarted timer service and restarted IIS but no dice.

Does anybody have any ideas what might be wrong?

  • How does your base constructor looks like? – StupidOne Jan 30 '14 at 10:55
  • Add your timer job code so we can have a look – Robert Lindgren Jan 30 '14 at 12:48
1

on this newly created farm i presume this timer job is new and you havent updated it? i know you have restarted the timer service but could you run this powershell script:

[array]$servers= Get-SPServer | ? {$_.Role -eq "Application"}            
$farm = Get-SPFarm            
foreach ($server in $servers)            
{            
    Write-Host "Restarting Timer Job on $server"                                      
    $Service = Get-WmiObject -Computer $server.name Win32_Service -Filter "Name='SPTimerV4'"                        
    if ($Service -ne $null)                         
    {                             
        $Service.InvokeMethod('StopService',$null)            
        Start-Sleep -s 7            
        $service.InvokeMethod('StartService',$null)                             
        Start-Sleep -s 7            
        Write-Host "Timer Job successfully restarted on $server"                        
    }             
    else            
    {            
        write-host -ForegroundColor Yellow "Could not find Sharepoint 2010 Timer Service on $server"            
    }            
}

iv done it before using ui but to no avail, doing it through powershell worked for me!

  • I tried your script following was the output: – Dharam Padia Jan 30 '14 at 11:29
  • Restarting Timer Job on SPServer Name=SP-FARM2-APP1 0 0 Timer Job successfully restarted on SPServer Name=SP-FARM2-APP1 Restarting Timer Job on SPServer Name=SP-FARM2-WEB1 0 0 Timer Job successfully restarted on SPServer Name=SP-FARM2-WEB1 – Dharam Padia Jan 30 '14 at 11:29
  • but still execute method is not getting called only base constructor is getting called when I debug it. – Dharam Padia Jan 30 '14 at 11:30
  • is it ok so see some of your time job class? for some reason your execute method is not overriding the base class execute! – Ali Jafer Jan 30 '14 at 11:57
  • 2
    Resolved issue by increasing the version, build the project, package, deployed to sharepoint then restarted timer job service with the help of above script then done iisreset and then execute method stated executing – Dharam Padia Feb 4 '14 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.