I have a class that runs as a ConsoleApplication background job. The JobClass has a null constructor. However, Hangfire (Dashboard) complains that the class does not have a null constructor.
- I do note, in the Dashboard error message, that the namespace of the calling class was injected into the backgroungjob container. Could this be the issue? Do they need to be in the same namespace and the error message is a side-effect?.
** Note as well that this does run as a static class, but I am trying to get background job distributed lock working per [DisableConcurrentExecution(timeoutInSeconds: 10 * 60)], so
that I can queue multiple jobs, yet constrain each server to running jobs sequentially to
avoid config file clashes. The jobs themselves contain highly and deeply nested parallel processing, so each server will be saturated. My intent is to set up a SignalR Scaleout backplane across a network of Hangfire Servers - each server having a WebFarm of Windows VMs (running in VMWare Fusion) managed by the local Hangfire server.).
Up to now (see previous posts) I have muddled my way through the combinations without guidance and gotten it mostly working. I think I’ll need some help on this one…but I’ll keep banging away at it to see if I can find a way to get it working. Any help is greatly appreciated.
Here’s the call Setup:
KESConsoleRunner.KvmBackgroundJob backgroundJob = new KESConsoleRunner.KvmBackgroundJob();
backgroundJob.SubmitJob(
runstring,
mongoDBConnectionString,
JobStoreConnectionstring
);
Heres the Backend Job Class
namespace KESConsoleRunner
{
public class KvmBackgroundJob
{
public KvmBackgroundJob()
{
}
public void SubmitJob(
string runstring,
string mongoDBConnectionString,
string JobStoreConnectionstring
)
{
Program.ExecuteBackgroundJob(
runstring,
mongoDBConnectionString,
JobStoreConnectionstring
);
}
}
}
Here’s the Dashboard error message
using KvmTLA.Services;
Job job = Activate();
job.ExecuteBackgroundJob(
“E:\Transactions\Transaction_Run_20140814_Set-1(RevisedModels)|Transaction_Run_20140814_Set-1(RevisedModels)_KES|Transaction_Run_20140814_Set-1(RevisedModels)_DocType|5445a23c7f9dbf2a447b05ea”,
“10.0.1.43:27017”,
“10.0.1.43:6379”);
Failed An exception occurred during job activation.
System.MissingMethodException
No parameterless constructor defined for this object.
System.MissingMethodException: No parameterless constructor defined for this object.
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at Hangfire.JobActivator.ActivateJob(Type jobType)
at Hangfire.Common.Job.Activate(JobActivator activator)