gpt4 book ai didi

sharepoint - 场类型初始化程序异常中的 MOSS 2007 站点

转载 作者:行者123 更新时间:2023-12-01 08:42:28 26 4
gpt4 key购买 nike

我们有一些针对 MOSS 农场构建的解决方案,其中包括一个计时器作业。这份工作几个月来一直很好。最近管理员将另一台服务器加入场,我们的计时器作业自动开始在这台新机器上运行。一旦发生此切换,我们的计时器作业就开始产生以下错误(在 SP 日志中找到)。

一开始我以为是权限问题,但是以前工作的机器上的定时器服务和新的机器上的定时器服务在同一个域帐户下运行。仅在其中一个站点/网站上循环站点集合中的站点列表时似乎失败了(下面的代码片段)。我知道这个域帐户可以访问它,因为它可以在同一帐户下的另一个盒子上工作。有没有人知道为什么会发生这个神秘的错误?或者,是否需要在这台新机器上执行任何特殊程序以确保它具有适用于 MOSS 场中所有数据库的正确 ACL?

代码:

public static void Main(string[] args)
{
SPSecurity.RunWithElevatedPrivileges(delegate() { setInputParameters(); });
}

private static void setInputParameters()
{
SPFarm farm = SPFarm.Local;
SPWebService service = farm.Services.GetValue<SPWebService>("");
foreach (SPWebApplication webApp in service.WebApplications)
{
foreach (SPSite siteCollection in webApp.Sites)
{
using(siteCollection)
{
siteCollection.CatchAccessDeniedException = false;

try
{
/* Here is the line that it fails on */
foreach (SPWeb web in siteCollection.AllWebs)

异常(exception):

The Execute method of job definition LMSDataImport (ID 4b37b285-ef8a-407c-8652-391639449790) threw an exception. 
More information is included below.
The type initializer for 'Microsoft.SharePoint.Administration.SPPersistedObjectCollection`1' threw an exception.

Exception stack trace:

at Microsoft.SharePoint.Administration.SPPersistedObjectCollection`1.get_BackingList()
at Microsoft.SharePoint.Administration.SPPersistedObjectCollection`1.GetEnumerator()
at Microsoft.SharePoint.Administration.SPAlternateUrlCollectionManager.LookupAlternateUrl(Uri canonicalRequestUri)
at Microsoft.SharePoint.Administration.SPAlternateUrl.LookupCore(Uri uri, SPFarm farm)
at Microsoft.SharePoint.Administration.SPWebApplication.Lookup(SPFarm farm, Uri requestUri, Boolean fallbackToHttpContext, SPAlternateUrl& alternateUrl, SiteMapInfo& hostHeaderSiteInfo, Boolean& lookupRequiredContext)
at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, SPUserToken userToken)
at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite)
at Microsoft.SharePoint.Administration.SPSiteCollection.get_Item(String strSiteName)
at Microsoft.SharePoint.Administration.SPSiteCollection.get_Item(Int32 index)
at Microsoft.SharePoint.Administration.SPSiteCollection.ItemAtIndex(Int32 iIndex)
at Microsoft.SharePoint.SPBaseCollection.SPEnumerator.System.Collections.IEnumerator.get_Current()
at LMSDataImporter.setInputParameters()
at Microsoft.SharePoint.SPSecurity.CodeToRunElevatedWrapper(Object state)
at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass4.<RunWithElevatedPrivileges>b__2()
at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
at Axian.AxianCalendar.LMSDataImporter.Main(String[] args)
at Microsoft.SharePoint.Administration.SPTimerJobInvoke.Invoke(TimerJobExecuteData& data, Int32& result)

最佳答案

检查 SharePoint 的 DLL,是否都存在并且都是相同的版本?尝试为 TypeInitializationException 设置一个 catch,看看该异常内部有什么问题。

关于sharepoint - 场类型初始化程序异常中的 MOSS 2007 站点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/744419/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com