Unable to schedule job on remote service

757 views
Skip to first unread message

Ben

unread,
Jun 23, 2011, 5:14:57 PM6/23/11
to Quartz.NET
I've downloaded the latest code from Github and have installed the
server as a windows service.

I can see Quartz listening away on tcp port 555.

I've then essentially copied the code from example #12:

static void Main(string[] args)
{
NameValueCollection properties = new
NameValueCollection();
properties["quartz.scheduler.instanceName"] =
"RemoteClient";

// set thread pool info
properties["quartz.threadPool.type"] =
"Quartz.Simpl.SimpleThreadPool, Quartz";
properties["quartz.threadPool.threadCount"] = "5";
properties["quartz.threadPool.threadPriority"] = "Normal";

// set remoting expoter
properties["quartz.scheduler.proxy"] = "true";
properties["quartz.scheduler.proxy.address"] = "tcp://
127.0.0.1:555/QuartzScheduler";

// First we must get a reference to a scheduler
ISchedulerFactory sf = new
StdSchedulerFactory(properties);
IScheduler sched = sf.GetScheduler();

// define the job and ask it to run

IJobDetail job = JobBuilder.NewJob<TestJob>()
.WithIdentity("remotelyAddedJob", "default")
.Build();

JobDataMap map = job.JobDataMap;
map.Put("msg", "Your remotely added job has executed!");

ITrigger trigger = TriggerBuilder.Create()
.WithIdentity("remotelyAddedTrigger", "default")
.ForJob(job.Key)
.WithSchedule(CronScheduleBuilder.CronSchedule("/5 *
* ? * *"))
.Build();

// schedule the job
sched.ScheduleJob(job, trigger);
}

Then I hit the last line of code `ScheduleJob` I get the following
exception:

"Could not load file or assembly 'QuartzDemo, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
system cannot find the file specified."

Where "QuartzDemo" is the name of my project. I can't seem to find any
detailed documentation on how to work with a remote scheduler. Is
there anything obvious I'm missing here?

Thanks,
Ben

Ben

unread,
Jun 24, 2011, 5:09:32 AM6/24/11
to Quartz.NET
Problem solved - needed to ensure my job's assembly was inside the
server installation directory.

j. barrett strausser

unread,
Jun 25, 2011, 2:54:38 PM6/25/11
to quar...@googlegroups.com
Glad you found the issue. I was just going to suggest this. As a general rule the moment you have an assembly bind issue you should just start using the fuslogviewer. Save a bit of headache.

--
You received this message because you are subscribed to the Google Groups "Quartz.NET" group.
To post to this group, send email to quar...@googlegroups.com.
To unsubscribe from this group, send email to quartznet+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/quartznet?hl=en.


Reply all
Reply to author
Forward
0 new messages