Quartz.net 2.2.3 - 无法启动Windows服务

时间:2014-05-20 19:15:34

标签: c# quartz.net

我目前正试图在我的Windows服务器上使用Quartz.net 2.2.3运行新创建的Web服务。但我收到以下错误:

Topshelf.Hosts.StartHost Error: 0 : The service failed to start., System.Invalid
OperationException: Cannot start service QuartzTest on computer '.'. ---> System
.ComponentModel.Win32Exception: The service did not respond to the start or cont
rol request in a timely fashion
   --- End of inner exception stack trace ---
   at System.ServiceProcess.ServiceController.Start(String[] args)
   at Topshelf.Runtime.Windows.WindowsHostEnvironment.StartService(String servic
eName)
   at Topshelf.Hosts.StartHost.Run()

这是我正在使用的配置:

quartz.scheduler.instanceName = ServerScheduler

quartz.jobStore.type = Quartz.Impl.AdoJobStore.JobStoreTX, Quartz
quartz.jobStore.useProperties = true
quartz.jobStore.dataSource = default
quartz.jobStore.driverDelegateType = Quartz.Impl.AdoJobStore.SqlServerDelegate, Quartz
quartz.jobStore.tablePrefix = QRTZ_
# if running MS SQL Server we need this
quartz.jobStore.lockHandler.type = Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz

quartz.dataSource.default.connectionString = {connectionstring}
quartz.dataSource.default.provider = SqlServer-20

# configure thread pool info
quartz.threadPool.type = Quartz.Simpl.SimpleThreadPool, Quartz
quartz.threadPool.threadCount = 1
quartz.threadPool.threadPriority = Normal

# job initialization plugin handles our xml reading, without it defaults are used -->
quartz.plugin.xml.type = Quartz.Plugin.Xml.JobInitializationPlugin, Quartz
quartz.plugin.xml.fileNames = ~/quartz_jobs.xml

# export this server to remoting context
quartz.scheduler.exporter.type = Quartz.Simpl.RemotingSchedulerExporter, Quartz
quartz.scheduler.exporter.port = 571
quartz.scheduler.exporter.bindName = QuartzServerTest
quartz.scheduler.exporter.channelType = tcp

我知道它与topshelf相关,但我不知道该怎么做。

感谢。

1 个答案:

答案 0 :(得分:0)

尝试重新安装Quartz Server。 您可以使用从注册表中将其清除 如何手动删除服务

  1. 打开Regedit

  2. 找到注册表项“HKEY_LOCAL_MACHINE / SYSTEM / CurrentControlSet / Services”

  3. 在那里查找服务并将其删除。你可以看一下键来了解一下 服务正在使用的文件并删除它们(如有必要)。

  4. 然后重新安装石英服务器。在cmd管理模式下使用命令quartz.service.exe对其进行测试。 然后再试一次你的东西。希望这在一定程度上有所帮助。注意:这可能不是您的最终解决方案,但您会弄清楚错误。因为Windows服务具有系统依赖性。