【发布时间】:2016-12-16 05:51:23
【问题描述】:
尝试将 Service Fabric 应用程序发布到本地群集时,群集无法加载应用程序并在标题中说明错误。堆栈跟踪将我指向 OwinCommunicationListener.cs 中的异常行:
try
{
this.eventSource.LogInfo("Starting web server on " + this.listeningAddress);
this.webApp = WebApp.Start(this.listeningAddress, appBuilder => this.startup.Invoke(appBuilder));
this.eventSource.LogInfo("Listening on " + this.publishAddress);
return Task.FromResult(this.publishAddress);
}
catch (Exception ex)
{
var logString = $"Web server failed to open endpoint {endpointName}. {ex.ToString()}";
this.eventSource.LogFatal(logString);
this.StopWebServer();
throw ex; // points to this line from cluster manager
}
我无法检查抛出的异常,但除了 TargetInvocationException 之外没有其他有用的异常信息,其中包含指向上述行的堆栈跟踪。为什么此应用程序不会加载到我的本地集群上?
【问题讨论】:
-
这个服务是一个实例吗?我的意思是,它有多少个副本?看起来它需要几个副本。可能例外是无法在特定端口上启动服务,因为每个副本都会这样做,并且端口应该已经被第一个副本占用,因此每个下一个副本都会失败。
-
既然你叫'throw ex;'您无法检查的异常是“ex”本身,带有新的堆栈跟踪。您可以在 catch 块中放置一个更高的断点并检查“ex”。可能 WebApp.Start 失败了。
-
在任何情况下都无法检查异常,我已经尝试了所有可能的方法
-
我的应用参数如下:
-
现在可以了。从字面上看,方程式中的任何变量都没有改变,它只是在第二天早上起作用。 Service Fabric 有点卡夫卡式了。