我已经在 127.0.0.1 端口 555 上运行 Quartz 调度程序 Windows 服务大约 2 年了。从几天前开始,我无法再开始我的服务。当我查看代码时,我发现无法启动 TcpChannel 对象。
IChannel chan;
chan = new TcpChannel(props, null, formatprovider);
当我在我的 cmd 上执行 netstat 时,我没有在 Listening 或 Established 中找到地址。我在我的防火墙上也找不到任何与此端口有关的新规则。
该服务基于 Quartz.net 调度程序。
服务日志:
2016-02-25 10:19:58,847 [9] INFO Quartz.Impl.StdSchedulerFactory [(null)] - Quartz.NET properties loaded from configuration file 'C:\Users\pedram.mobedi\Documents\GitHub\Postbag\build\Debug\quartz.config'
2016-02-25 10:19:58,958 [9] INFO Quartz.Util.DBConnectionManager [(null)] - Registering datasource 'default' with db provider: 'Quartz.Impl.AdoJobStore.Common.DbProvider'
2016-02-25 10:19:58,965 [9] INFO Quartz.Impl.StdSchedulerFactory [(null)] - Using default implementation for object serializer
2016-02-25 10:19:58,996 [9] INFO Quartz.Impl.StdSchedulerFactory [(null)] - Using custom data access locking (synchronization): Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore
2016-02-25 10:19:59,002 [9] INFO Quartz.Impl.StdSchedulerFactory [(null)] - Using default implementation for ThreadExecutor
2016-02-25 10:19:59,099 [9] INFO Quartz.Core.SchedulerSignalerImpl [(null)] - Initialized Scheduler Signaller of type: Quartz.Core.SchedulerSignalerImpl
2016-02-25 10:19:59,107 [9] INFO Quartz.Core.QuartzScheduler [(null)] - Quartz Scheduler v.2.2.4.400 created.
2016-02-25 10:19:59,128 [9] INFO Quartz.Impl.AdoJobStore.JobStoreTX [(null)] - JobStoreTX initialized.
2016-02-25 10:19:59,263 [9] INFO Quartz.Core.QuartzScheduler [(null)] - Scheduler QuartzScheduler_$_NON_CLUSTERED shutting down.
2016-02-25 10:19:59,270 [9] INFO Quartz.Core.QuartzScheduler [(null)] - Scheduler QuartzScheduler_$_NON_CLUSTERED paused.
2016-02-25 10:19:59,287 [9] INFO Quartz.Core.QuartzScheduler [(null)] - Scheduler QuartzScheduler_$_NON_CLUSTERED Shutdown complete.
2016-02-25 10:19:59,321 [9] ERROR Quartz.Server.QuartzServer [(null)] - Server initialization failed:Unable to bind scheduler to remoting.
Quartz.SchedulerException: Unable to bind scheduler to remoting. ---> System.Net.Sockets.SocketException: No such host is known
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostEntry(String hostNameOrAddress)
at System.Runtime.Remoting.Channels.CoreChannel.GetMachineIp()
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.SetupMachineName()
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(IDictionary properties, IServerChannelSinkProvider sinkProvider, IAuthorizeRemotingConnection authorizeCallback)
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(IDictionary properties, IServerChannelSinkProvider sinkProvider)
at System.Runtime.Remoting.Channels.Tcp.TcpChannel..ctor(IDictionary properties, IClientChannelSinkProvider clientSinkProvider, IServerChannelSinkProvider serverSinkProvider)
at Quartz.Simpl.RemotingSchedulerExporter.RegisterRemotingChannelIfNeeded() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Simpl\RemotingSchedulerExporter.cs:line 120
at Quartz.Simpl.RemotingSchedulerExporter.Bind(IRemotableQuartzScheduler scheduler) in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Simpl\RemotingSchedulerExporter.cs:line 71
at Quartz.Core.QuartzScheduler.Bind() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Core\QuartzScheduler.cs:line 375
at Quartz.Core.QuartzScheduler.Initialize() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Core\QuartzScheduler.cs:line 352
--- End of inner exception stack trace ---
at Quartz.Core.QuartzScheduler.Initialize() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Core\QuartzScheduler.cs:line 366
at Quartz.Impl.StdSchedulerFactory.Instantiate() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Impl\StdSchedulerFactory.cs:line 1046
at Quartz.Impl.StdSchedulerFactory.GetScheduler() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Impl\StdSchedulerFactory.cs:line 1120
at Quartz.Server.QuartzServer.GetScheduler() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\server\Quartz.Server\QuartzServer.cs:line 62
at Quartz.Server.QuartzServer.Initialize() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\server\Quartz.Server\QuartzServer.cs:line 47 [See nested exception: System.Net.Sockets.SocketException (0x80004005): No such host is known
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostEntry(String hostNameOrAddress)
at System.Runtime.Remoting.Channels.CoreChannel.GetMachineIp()
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.SetupMachineName()
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(IDictionary properties, IServerChannelSinkProvider sinkProvider, IAuthorizeRemotingConnection authorizeCallback)
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(IDictionary properties, IServerChannelSinkProvider sinkProvider)
at System.Runtime.Remoting.Channels.Tcp.TcpChannel..ctor(IDictionary properties, IClientChannelSinkProvider clientSinkProvider, IServerChannelSinkProvider serverSinkProvider)
at Quartz.Simpl.RemotingSchedulerExporter.RegisterRemotingChannelIfNeeded() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Simpl\RemotingSchedulerExporter.cs:line 120
at Quartz.Simpl.RemotingSchedulerExporter.Bind(IRemotableQuartzScheduler scheduler) in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Simpl\RemotingSchedulerExporter.cs:line 71
at Quartz.Core.QuartzScheduler.Bind() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Core\QuartzScheduler.cs:line 375
at Quartz.Core.QuartzScheduler.Initialize() in c:\Users\pedram.mobedi\Documents\GitHub\Postbag\Quartz.NET-2.2.4\src\Quartz\Core\QuartzScheduler.cs:line 352]
更新:主机文件
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 localhost
更新 2:quartz.config
# Quartz Config
quartz.threadPool.type = Quartz.Simpl.SimpleThreadPool, Quartz
quartz.threadPool.threadCount = 10
#quartz.threadPool.threadPriority = Normal
# Settings for using Quartz as a windows service
quartz.scheduler.exporter.type = Quartz.Simpl.RemotingSchedulerExporter, Quartz
quartz.scheduler.exporter.port = 555
quartz.scheduler.exporter.bindName = Postbag
quartz.scheduler.exporter.channelType = tcp
quartz.scheduler.exporter.channelName = httpQuartz
# SQLite settings
quartz.jobStore.type = Quartz.Impl.AdoJobStore.JobStoreTX, Quartz
quartz.jobStore.misfireThreshold = 60000
quartz.jobStore.lockHandler.type = Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz
quartz.jobStore.useProperties = true
quartz.jobStore.dataSource = default
quartz.jobStore.tablePrefix = qrtz_
quartz.jobStore.driverDelegateType = Quartz.Impl.AdoJobStore.SQLiteDelegate, Quartz
quartz.dataSource.default.provider = SQLite-10
quartz.dataSource.default.connectionString = Data Source=.\jobs.db;Version=3
最佳答案
这意味着您绑定(bind)了一个不存在的主机名。也许您已将其指向另一个位置。
1、是否修改了防火墙规则?可能是你阻止了你的程序或者你已经阻止了对 127.0.0.1 的所有访问
2、你的主机名是域名吗?如果是,则意味着域不再指向这台机器。您应该在 HOST 文件中重新指向它:
Win+R,输入以下命令:
notepad.exe %windir%\system32\drivers\etc\hosts
然后您可以检查域是否已经在该文件中。如果是并且以“#”开头,则删除“#”。如果没有,请输入以下内容:
127.0.0.1 [your domain name]
例如:
127.0.0.1 test.cn
3、如果主机名是“127.0.0.1”,应该不会发生。那可能是你操作系统的问题
关于c# - 无法在 127.0.0.1 端口 555 上打开 TCP channel (SocketException : No Such Host Is Known),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35623041/
我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-
使用带有Rails插件的vim,您可以创建一个迁移文件,然后一次性打开该文件吗?textmate也可以这样吗? 最佳答案 你可以使用rails.vim然后做类似的事情::Rgeneratemigratonadd_foo_to_bar插件将打开迁移生成的文件,这正是您想要的。我不能代表textmate。 关于ruby-使用VimRails,您可以创建一个新的迁移文件并一次性打开它吗?,我们在StackOverflow上找到一个类似的问题: https://sta
我对最新版本的Rails有疑问。我创建了一个新应用程序(railsnewMyProject),但我没有脚本/生成,只有脚本/rails,当我输入ruby./script/railsgeneratepluginmy_plugin"Couldnotfindgeneratorplugin.".你知道如何生成插件模板吗?没有这个命令可以创建插件吗?PS:我正在使用Rails3.2.1和ruby1.8.7[universal-darwin11.0] 最佳答案 随着Rails3.2.0的发布,插件生成器已经被移除。查看变更日志here.现在
我尝试运行2.x应用程序。我使用rvm并为此应用程序设置其他版本的ruby:$rvmuseree-1.8.7-head我尝试运行服务器,然后出现很多错误:$script/serverNOTE:Gem.source_indexisdeprecated,useSpecification.Itwillberemovedonorafter2011-11-01.Gem.source_indexcalledfrom/Users/serg/rails_projects_terminal/work_proj/spohelp/config/../vendor/rails/railties/lib/r
我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e
我花了三天的时间用头撞墙,试图弄清楚为什么简单的“rake”不能通过我的规范文件。如果您遇到这种情况:任何文件夹路径中都不要有空格!。严重地。事实上,从现在开始,您命名的任何内容都没有空格。这是我的控制台输出:(在/Users/*****/Desktop/LearningRuby/learn_ruby)$rake/Users/*******/Desktop/LearningRuby/learn_ruby/00_hello/hello_spec.rb:116:in`require':cannotloadsuchfile--hello(LoadError) 最佳
我在pry中定义了一个函数:to_s,但我无法调用它。这个方法去哪里了,怎么调用?pry(main)>defto_spry(main)*'hello'pry(main)*endpry(main)>to_s=>"main"我的ruby版本是2.1.2看了一些答案和搜索后,我认为我得到了正确的答案:这个方法用在什么地方?在irb或pry中定义方法时,会转到Object.instance_methods[1]pry(main)>defto_s[1]pry(main)*'hello'[1]pry(main)*end=>:to_s[2]pry(main)>defhello[2]pry(main)
我使用的是Firefox版本36.0.1和Selenium-Webdrivergem版本2.45.0。我能够创建Firefox实例,但无法使用脚本继续进行进一步的操作无法在60秒内获得稳定的Firefox连接(127.0.0.1:7055)错误。有人能帮帮我吗? 最佳答案 我遇到了同样的问题。降级到firefoxv33后一切正常。您可以找到旧版本here 关于ruby-无法在60秒内获得稳定的Firefox连接(127.0.0.1:7055),我们在StackOverflow上找到一个类
当我尝试安装Ruby时遇到此错误。我试过查看this和this但无济于事➜~brewinstallrubyWarning:YouareusingOSX10.12.Wedonotprovidesupportforthispre-releaseversion.Youmayencounterbuildfailuresorotherbreakages.Pleasecreatepull-requestsinsteadoffilingissues.==>Installingdependenciesforruby:readline,libyaml,makedepend==>Installingrub
GivenIamadumbprogrammerandIamusingrspecandIamusingsporkandIwanttodebug...mmm...let'ssaaay,aspecforPhone.那么,我应该把“require'ruby-debug'”行放在哪里,以便在phone_spec.rb的特定点停止处理?(我所要求的只是一个大而粗的箭头,即使是一个有挑战性的程序员也能看到:-3)我已经尝试了很多位置,除非我没有正确测试它们,否则会发生一些奇怪的事情:在spec_helper.rb中的以下位置:require'rubygems'require'spork'