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?

2
  • How does your base constructor looks like?
    – StupidOne
    Commented Jan 30, 2014 at 10:55
  • Add your timer job code so we can have a look Commented Jan 30, 2014 at 12:48

1 Answer 1

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!

7
  • I tried your script following was the output: Commented Jan 30, 2014 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 Commented Jan 30, 2014 at 11:29
  • but still execute method is not getting called only base constructor is getting called when I debug it. Commented Jan 30, 2014 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
    Commented Jan 30, 2014 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 Commented Feb 4, 2014 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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