之所以屡屡构成误导,爬了一宿怎么都不曾爬到

环境描述

条件描述

在Silverlight+WCF 福特ExplorerIA Service可能WCF
Service的架构中,常常会境遇WCF连串化65536大小范围的标题。由于WCF GL450IA
Service没有提供明显的可怜信息和错误音信,所以一再构成误导。

  Windows 2012 R2,SharePoint 2013(没有sp1补丁),sql server 2012

  Windows 2012 R2,SharePoint 2013(没有sp1补丁),sql server 2012

WCF 宝马X3IA Service没有提供精确的13分信息和不当原因

比如说本人就赶上Silverlight客户端调用WCF LX570IA
Service退步,极度消息是:System.ServiceModel.DomainServices.Client.DomainOperationException:
Load operation failed for query ‘GetProducts’. Inner exception message:
Timeout expired.
,居然12分新闻是超时TimeOut,难道调用WCF 福特ExplorerIA
Service供给这样多时间呢?

换了2个数据库和机器,依然Silverlight客户端调用WCF 劲客IA
Service失利,至极音讯化为:System.ServiceModel.DomainServices.Client.DomainOperationException:
Load operation failed for query ‘GetProducts’. The remote server
returned an error: NotFound. —>
System.ServiceModel.CommunicationException: The remote server returned
an error: NotFo
und. 非凡音讯又成为了Server Not Found。

骨子里,当客户端调用WCF服务的时候比如调用WCF
服务的*.svc地址时候比如http://localhost:8562/ClientBin/MyNameSpace-DomainServices-MyDomainService.svc/binary/GetProducts?model=&productCode=&type=mp,借使服务端*.svc产生了其余处境不能够交到200的应答码,就会回去八个荒唐比如404,而*.svc没有这些404重定向,就给个Server
NotFound的卓绝新闻,真是令人夭亡。

谬误描述

荒谬描述

开辟诊断采取找到WCF内部非常原因

实际借使必要查阅Domain
瑟维斯和Client的非凡音信,能够在Web.config打开诊断选用并且用WCF服务跟踪查看器(SvcTraceViewer.exe)查看错误日志:

   1: <configuration>

   2:  <system.diagnostics>

   3:     <sources>

   4:       <source name="System.ServiceModel" switchValue="Information, ActivityTracing"

   5:               propagateActivity="true">

   6:         <listeners>

   7:           <add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener"

   8:               initializeData= "C:\WCFLogs\Traces.svclog" />

   9:         </listeners>

  10:       </source>

  11:     </sources>

  12:   </system.diagnostics>

  13: </configuration>

  搜索服务符合规律,不过爬网向来在Crawling
Full,然而爬不到别的事物,而且不会停下,爬了一宿怎么都未曾爬到:

  搜索服务寻常,但是爬网平昔在Crawling
Full,可是爬不到其余事物,而且不会终止,爬了一宿怎么都不曾爬到:

使用WCF Sevice Trace Viewer定位卓殊

我用WCF服务跟踪查看器(SvcTraceViewer.exe)查看了错误日志,发现不是Server
Not Found错误,而是WCF体系化65536大小范围,错误音讯是:There was an
error while trying to serialize
parameter
http://tempuri.org/:GetProductsResult.
The InnerException message was ‘Maximum number of items that can be
serialized or deserialized in an object graph is ‘65536’. Change the object graph or
increase the MaxItemsInObjectGraph quota. ‘.  Please see InnerException
for more details.,
上面是截图:

图片 1

Stacktrace:

System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameterPart(XmlDictionaryWriter
writer, PartInfo part, Object graph) 
System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameter(XmlDictionaryWriter
writer, PartInfo part, Object graph) 
System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeBody(XmlDictionaryWriter
writer, MessageVersion version, String action, MessageDescription
messageDescription, Object returnValue, Object[] parameters, Boolean
isRequest) 
System.ServiceModel.Dispatcher.OperationFormatter.SerializeBodyContents(XmlDictionaryWriter
writer, MessageVersion version, Object[] parameters, Object
returnValue, Boolean isRequest) 
System.ServiceModel.Dispatcher.OperationFormatter.OperationFormatterMessage.OperationFormatterBodyWriter.OnWriteBodyContents(XmlDictionaryWriter
writer) 
System.ServiceModel.Channels.BodyWriter.WriteBodyContents(XmlDictionaryWriter
writer) 
System.ServiceModel.Channels.BodyWriterMessage.OnWriteBodyContents(XmlDictionaryWriter
writer) 
System.ServiceModel.Channels.Message.OnWriteMessage(XmlDictionaryWriter
writer) 
System.ServiceModel.Channels.Message.WriteMessage(XmlDictionaryWriter
writer) 
System.ServiceModel.DomainServices.Hosting.PoxBinaryMessageEncodingBindingElement.PoxBinaryMessageEncoder.WriteMessage(Message
message, Int32 maxMessageSize, BufferManager bufferManager, Int32
messageOffset) 
System.ServiceModel.Channels.HttpOutput.SerializeBufferedMessage(Message
message) 
System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout) 
System.ServiceModel.Channels.HttpRequestContext.OnReply(Message message,
TimeSpan timeout) 
System.ServiceModel.Activation.HostedHttpContext.OnReply(Message
message, TimeSpan timeout) 
System.ServiceModel.Channels.RequestContextBase.Reply(Message message,
TimeSpan timeout) 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Reply(MessageRpc&
rpc) 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage9(MessageRpc&
rpc) 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage8(MessageRpc&
rpc) 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&
rpc) 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc&
rpc) 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&
rpc) 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&
rpc) 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&
rpc) 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&
rpc) 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&
rpc) 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&
rpc) 
System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean
isOperationContextSet) 
System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext
request, Boolean cleanThread, OperationContext
currentOperationContext) 
System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext
request, OperationContext currentOperationContext) 
System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult
result) 
System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult
result) 
System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult
result) 
System.ServiceModel.Diagnostics.TraceUtility.<>c__DisplayClass4.<CallbackGenerator>b__2(AsyncCallback
callback, IAsyncResult result) 
System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) 
System.Runtime.InputQueue`1.AsyncQueueReader.Set(Item item) 
System.Runtime.InputQueue`1.EnqueueAndDispatch(Item item, Boolean
canDispatchOnThisThread) 
System.Runtime.InputQueue`1.EnqueueAndDispatch(T item, Action
dequeuedCallback, Boolean canDispatchOnThisThread) 
System.ServiceModel.Channels.SingletonChannelAcceptor`3.Enqueue(QueueItemType
item, Action dequeuedCallback, Boolean canDispatchOnThisThread) 
System.ServiceModel.Channels.HttpChannelListener.HttpContextReceived(HttpRequestContext
context, Action callback) 
System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult
result) 
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() 
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() 
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object
state) 
System.ServiceModel.AspNetPartialTrustHelpers.PartialTrustInvoke(ContextCallback
callback, Object state) 
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequestWithFlow(Object
state) 
System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) 
System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32
error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped) 
System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

 

图片 2

图片 3

消除办法

既然如此难题早就家喻户晓是WCF序列化和反系列化的65536大小范围导致Silverlight客户端接收不到,那就调动这么些参数,极度消息已经交由提醒能够配备MaxItemsInObjectGraph其一参数。大家修改Web.config即可:

   1: <configuration>

   2:   <system.serviceModel>

   3:     

   4:     <serviceHostingEnvironment aspNetCompatibilityEnabled="true"

   5:         multipleSiteBindingsEnabled="true" />

   6:     

   7:     <!--设置 maxItemsInObjectGraph -->

   8:     <services>

   9:  

  10:       <!--注意下面这个name属性,必须改成你自己的namespace+DomainService类名!! -->

  11:       <service name="MyNamespace.MyDomainServiceClass" 

  12:                behaviorConfiguration="MyWCFConfig" />

  13:     </services>

  14:     <behaviors>

  15:       <serviceBehaviors>

  16:         <behavior name="MyWCFConfig">

  17:           <dataContractSerializer maxItemsInObjectGraph="2147483647" />

  18:         </behavior>

  19:       </serviceBehaviors>

  20:     </behaviors>

  21:     

  22:   </system.serviceModel>

  23: </configuration>

地点是最简便的布局情势,当然你的WCF假如很复杂,建议配置binding,
endpoint等等,关于WCF配置Web.config,参考这个这个。在SilverlightChina上专家MVP有以此帖子化解同样标题标,作者使用下来不管用,而且没申明怎么调节和测试难点。

  爬网不止,爬了一宿怎么都不曾爬到,错误如下:

  爬网不止,爬了一宿怎么都未曾爬到,错误如下:

图片 4

图片 5

   去15/logs里面找日志;
Non-OAuth request. IsAuthenticated=True,
UserIdentityName=0#.w|domain\user, ClaimsCount=125
b5b2d49c-feb7-e08b-ecf7-28204da68508

   去15/logs里面找日志; Non-OAuth request. IsAuthenticated=True,
UserIdentityName=0#.w|domain\user, ClaimsCount=125
b5b2d49c-feb7-e08b-ecf7-28204da68508
UserAgent not available, file operations may not be optimized.    at
Microsoft.SharePoint.SPFileStreamManager.CreateCobaltStreamContainer(SPFileStreamStore
spfs, ILockBytes ilb, Boolean copyOnFirstWrite, Boolean disposeIlb)    
at
Microsoft.SharePoint.SPFileStreamManager.SetInputLockBytes(SPFileInfo&
fileInfo, SqlSession session, PrefetchResult prefetchResult)     at
Microsoft.SharePoint.CoordinatedStreamBuffer.SPCoordinatedStreamBufferFactory.CreateFromDocumentRowset(Guid
databaseId, SqlSession session, SPFileStreamManager spfstm, Object[]
metadataRow, SPRowset contentRowset, SPDocumentBindRequest& dbreq,
SPDocumentBindResults& dbres)     at
Microsoft.SharePoint.SPSqlClient.GetDocumentContentRow(Int32 rowOrd,
Object ospFileStmMgr, SPDocumentBindRequest& dbreq,
SPDocumentBindResults& dbres…
The crawler could not communicate with the server. Check that the server
is available and that the firewall access is configured correctly.
  事件查看器报错; WebHost failed to process a request. Sender
Information:
System.ServiceModel.ServiceHostingEnvironment+HostingManager/63363381
Exception: System.ServiceModel.ServiceActivationException: The service
‘/90ac4adbb96a4e89892b2ad7ab02da51/MetadataWebService.svc’ cannot be
activated due to an exception during compilation.  The exception message
is: The farm is unavailable.. —> System.InvalidOperationException:
The farm is unavailable.    at
Microsoft.SharePoint.Administration.Claims.SPSecurityTokenServiceManager.get_Local()
   at
Microsoft.SharePoint.IdentityModel.SPServiceIssuerNameRegistry..ctor()
   at
Microsoft.SharePoint.SPServiceHostOperations.Configure(ServiceHostBase
serviceHost, SPServiceAuthenticationMode authenticationMode)    at
Microsoft.SharePoint.Taxonomy.MetadataWebServiceHostFactory.CreateServiceHost(String
constructorString, Uri[] baseAddresses)    at
System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String
normalizedVirtualPath, EventTraceActivity eventTraceActivity)    at
System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo
serviceActivationInfo, EventTraceActivity eventTraceActivity)    at
System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String
normalizedVirtualPath, EventTraceActivity eventTraceActivity)    — End
of inner exception stack trace —    at
System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String
normalizedVirtualPath, EventTraceActivity eventTraceActivity)    at
System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String
relativeVirtualPath, EventTraceActivity eventTraceActivity) Process
Name: w3wp Process ID: 6004

UserAgent not available, file operations may not be optimized.    at
Microsoft.SharePoint.SPFileStreamManager.CreateCobaltStreamContainer(SPFileStreamStore
spfs, ILockBytes ilb, Boolean copyOnFirstWrite, Boolean disposeIlb)    
at
Microsoft.SharePoint.SPFileStreamManager.SetInputLockBytes(SPFileInfo&
fileInfo, SqlSession session, PrefetchResult prefetchResult)     at
Microsoft.SharePoint.CoordinatedStreamBuffer.SPCoordinatedStreamBufferFactory.CreateFromDocumentRowset(Guid
databaseId, SqlSession session, SPFileStreamManager spfstm, Object[]
metadataRow, SPRowset contentRowset, SPDocumentBindRequest& dbreq,
SPDocumentBindResults& dbres)     at
Microsoft.SharePoint.SPSqlClient.GetDocumentContentRow(Int32 rowOrd,
Object ospFileStmMgr, SPDocumentBindRequest& dbreq,
SPDocumentBindResults& dbres…

图片 6

The crawler could not communicate with the server. Check that the server
is available and that the firewall access is configured correctly.

缓解格局

  事件查看器报错;
WebHost failed to process a request.
Sender Information:
System.ServiceModel.ServiceHostingEnvironment+HostingManager/63363381
Exception: System.ServiceModel.ServiceActivationException: The service
‘/90ac4adbb96a4e89892b2ad7ab02da51/MetadataWebService.svc’ cannot be
activated due to an exception during compilation.  The exception message
is: The farm is unavailable.. —> System.InvalidOperationException:
The farm is unavailable.
   at
Microsoft.SharePoint.Administration.Claims.SPSecurityTokenServiceManager.get_Local()
   at
Microsoft.SharePoint.IdentityModel.SPServiceIssuerNameRegistry..ctor()
   at
Microsoft.SharePoint.SPServiceHostOperations.Configure(ServiceHostBase
serviceHost, SPServiceAuthenticationMode authenticationMode)
   at
Microsoft.SharePoint.Taxonomy.MetadataWebServiceHostFactory.CreateServiceHost(String
constructorString, Uri[] baseAddresses)
   at
System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String
normalizedVirtualPath, EventTraceActivity eventTraceActivity)
   at
System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo
serviceActivationInfo, EventTraceActivity eventTraceActivity)
   at
System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String
normalizedVirtualPath, EventTraceActivity eventTraceActivity)
   — End of inner exception stack trace —
   at
System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String
normalizedVirtualPath, EventTraceActivity eventTraceActivity)
   at
System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String
relativeVirtualPath, EventTraceActivity eventTraceActivity)
Process Name: w3wp
Process ID: 6004

  事件查看器错误,参考上面link消除,不过没有消除爬网的标题:

图片 7

https://social.technet.microsoft.com/Forums/en-US/ef415574-2e89-4fd9-8538-c49eef3366c6/searchservicesvc-cannot-be-activated-due-to-an-exception-during-compilation-the-exception?forum=sharepointsearch

化解格局

  经过一天的垂死挣扎,终于决定删掉搜索服务,重建!经过重建,发现报错更严重了,搜索主机控征服务连不上了;然后,查看搜索主机控战胜务,发现和寻找服务运维账号不是二个,更新成3个事后,搜索服务不荒谬了,爬网也并未难点了!

  事件查看器错误,参考上面link消除,但是并未化解爬网的题材:

其余参考

https://social.technet.microsoft.com/Forums/en-US/ef415574-2e89-4fd9-8538-c49eef3366c6/searchservicesvc-cannot-be-activated-due-to-an-exception-during-compilation-the-exception?forum=sharepointsearch

  焚薮而田进程中,发现其余人蒙受过类似题材,跟本人原因莫衷一是,备注上边给我们三个参考;

  经过一天的垂死挣扎,终于决定删掉搜索服务,重建!经过重建,发现报错更要紧了,搜索主机控打败务连不上了;然后,查看搜索主机控制服务,发现和摸索服务运作账号不是1个,更新成二个从此,搜索服务平时了,爬网也尚未难题了!

http://blog.csdn.net/abrahamcheng/article/details/11216087

其它参考

 

  消除进程中,发现其余人蒙受过类似问题,跟自个儿原因莫衷一是,备注下边给我们多个参阅;

******************************************************************************

http://blog.csdn.net/abrahamcheng/article/details/11216087

作者:霖雨
出处:http://www.cnblogs.com/jianyus 本文版权归
霖雨和网易共有,欢迎转发,但请注脚出处。

相关文章