views:

58

answers:

2

Hi all,

I'm having trouble getting a client/server implementation of Quartz.NET working.

I have a SQL Server on ServerA, a server running Quartz as a service (ServerB) and a server which hosts an ASP.NET application (ServerC).

I have followed all the tutorials and delved into the code a fair amount but I can't see what I'm doing wrong. The server is definitely listening and I can see the port is open from ServerC. No firewalls involved.

ServerB, which is running the service included in the download package (Quartz.Server.Service) has the following config file settings:

<quartz>
    <add key="quartz.server.serviceName" value="quartz" />
    <add key="quartz.server.serviceDisplayName" value="Job Scheduler" />
    <add key="quartz.scheduler.instanceName" value="RemoteServer" />
    <add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
    <add key="quartz.threadPool.threadCount" value="10" />
    <add key="quartz.threadPool.threadPriority" value="Normal" />
    <add key="quartz.scheduler.exporter.type" value="Quartz.Simpl.RemotingSchedulerExporter, Quartz" />
    <add key="quartz.scheduler.exporter.port" value="5656" />
    <add key="quartz.scheduler.exporter.bindName" value="QuartzScheduler" />
    <add key="quartz.scheduler.exporter.channelType" value="tcp" />
    <add key="quartz.jobStore.type" value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz" />
    <add key="quartz.jobStore.driverDelegateType" value="Quartz.Impl.AdoJobStore.SqlServerDelegate, Quartz" />
    <add key="quartz.jobStore.tablePrefix" value="qrtz_" />
    <add key="quartz.jobStore.dataSource" value="db" />
    <add key="quartz.dataSource.db.provider" value="SqlServer-20" />
    <add key="quartz.dataSource.db.connectionString" value="Data Source=ServerA;Initial Catalog=dev;User ID=dev;Password=dev" />
    <add key="quartz.jobStore.useProperties" value="true" />
    <add key="quartz.jobStore.lockHandler.type" value="Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz" />
</quartz>

The ASP.NET app has the following config:

<quartz>
    <add key="quartz.scheduler.instanceName" value="RemoteClient" />
    <add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
    <add key="quartz.threadPool.threadCount" value="5" />
    <add key="quartz.threadPool.threadPriority" value="Normal" />
    <add key="quartz.scheduler.proxy" value="true" />
    <add key="quartz.scheduler.proxy.address" value="tcp://ServerB:5656/QuartzScheduler" />
</quartz>

I have tried numerous things. Occasionally I get an error that the scheduler already exists instead of the one in the question title.

I have read elsewhere that due to threading issues I should create the scheduler in a singleton, which I have done:

    private static readonly ISchedulerFactory _schedulerFactory;
    private static readonly IScheduler _scheduler;

    static JobScheduleService() {
        _schedulerFactory = new StdSchedulerFactory();
        _scheduler = _schedulerFactory.GetScheduler();
    }

    public static IScheduler GetScheduler() {
        return _scheduler;
    }

What have I missed? TIA


If I open up a telnet box on the web server and connect to the quartz server then the service is definitely responding. If I type a few characters I get an error from Quartz.

Does this help? I.e. it's not a connectivity issue?

Telnet

A: 

Try NOT setting any of the quartz.threadpool.xxxxxx properties.

TskTsk
I commented them out on the quartz server and restarted the service, then on the web server. I still get the same error.
enashnash
I should have been more specific... comment them out only on the client side. It might not help, but this is the only difference I see in what we're doing and what you're doing.
TskTsk
Same error I'm afraid. Any other suggestions?
enashnash
Nothing really. I'm assuming you've already tried connecting to the port from the server with the asp.net application using the same user, just to exclude connectivity and permissions.
TskTsk
The service is running under the local system account, do you have a different configuration?
enashnash
Yes, we run the service using a domain account and we do the same for the web application.
TskTsk
Have you seen any documentation that states this as a requirement? I've looked around and can't find any. Our servers are not on a domain.
enashnash
I haven't seen anything in the documentation, it's just how we have them set up.
TskTsk
I now have this working. I have not had to use domain accounts. I have removed the threadpool properties on the client side, but it was not the source of the problem. I've posted a separate response with the solution in my case. Thanks for your help.
enashnash
A: 

It turns out that the error message is just a bit misleading. The error wasn't in the communication with the server at all. The problem was a missing DLL file that wasn't being copied as part of the deployment. The underlying error was due to the schedulers inability to find the DLL.

enashnash