Sharepoint学习笔记—习题系列--70-576习题解析 -(Q99-Q101)

Question  99
You have designed a new SharePoint 2010 Web Part that was deployed to the testing environment. A tester has reported that clicking a custom button in the Web Part has no effect in the browser. You need to ensure that the button works as designed. Which approach should you recommend?
A. Set the Load User Profile property to False in the SharePoint Central Administration v4 application pool. Then restart IIS.
B. Verify that JavaScript is enabled in the tester’s browser and that User Account Control is not causing the issue.
C. Enable the Full Control permission policy level in the Manage Permission Policy Levels dialog box.
D. Clear the browser cache on the tester’s machine and reopen the browser.


解析:
  你开发并部署了一个Web Part到Sharepoint测试环境中,测试人员报告说当点击此WebPart中的一个按钮时没有任何反应,你需要确认这个按钮是正常工作的,你该如何做呢?
  对于按钮没反应,一般要么是服务器端代码没有定义对应的事件,要么就是客户端阻止了相关功能。
  选项A. 属于应用程序池的相关设置,用于决定在应用程序池开启时是否加载User Profile信息。 很明显与按钮事件无关。
  选项B. 检查客户端的Javascript功能是否开启,本选项有可能会引起按钮事件无响应。
  选项C. 设置Sharepoint的相关权限管理,此处的设置直接影响到用户是否可以访问到相关的页面内容以及对网站内容的操作限制,既然用户都已经看到按钮了,说明他不存在对页面的访问权限问题。如果是按钮后台代码的权限问题则自然应该跳出系统提示框说明。但本题是点击按钮无响应,所以与权限无关。
  选项D. Cahce是用来提高页面响应速度的,本题不是响应速度问题,而是根本无响应,所以此选项也与本题无关。
因此本题答案应该选 B

参考 
http://msdn.microsoft.com/zh-cn/library/microsoft.web.administration.applicationpoolprocessmodel.loaduserprofile(v=vs.90).aspx
http://technet.microsoft.com/zh-cn/library/ff608071.aspx


Question  100 
You have a SharePoint 2010 farm that has one existing Web application. You have designed a new Web application. After the Web application is implemented, you immediately navigate to the URL. An error is returned saying the page cannot be found. You need to ensure that when users navigate to the URL of the new Web application, the standard SharePoint 2010 landing page is displayed. Which approach should you recommend?
A. Ensure that the Start Automatically property is set to True in the application pool under which the URL of the new Web application runs.
B. Ensure that the Application _Layouts pages reference site master pages property is set to Yes in the Web  Application General Settings dialog box of the new Web application.
C. Enter the URL of the new Web application in the Add a New Path property in the Define Managed Paths dialog box of the new Web application.
D. Create a new site collection associated with the URL of the new Web application.

解析:
 你的Sharepoint2010场中已经有一个Web Application了,你又创建了一个新的Web Application。当你应用了这个新的Web Application并马上访问它的URL地址时,你得到了报错页面告诉你页面没有找到。你需要解决这个问题,以保证当用户访问到这个URL时,这个新的Web Application的相关页面能正确呈现。
  我们知道,网站集应该在 SharePoint 2010管理中心创建,一个Web应用程序可以包括多个网站集,但是一个网站集中只能有一个顶级网站,而顶级网站下面可以有多个子网站。本题只是创建了Web应用程序,但是还没有创建基于其上的网站集及其顶级网站,所以,当使用URL访问时就会报错。因此选项D是本题正解。
  选项A.设置应用程序池的Start Automatically属性,即为应用程序池配置自动启动。此操作是针对应用程序池的,与是否能找到URL无关。而且如果应用程序池没启动,系统会报类似于” Service Unavailable.HTTP Error 503. The service is unavailable.”这样的错误,而不是与URL相关的错误。所以排除此选项。
  选项B.是关于把母板页应用到应用程序页面的设置,也与URL找不到无关。
  选项C. 通过定义管理路径,可以指定 Web 应用程序的 URL 命名空间中的哪些路径用于网站集。您可以指定在指定的路径中存在一个或多个网站集。这会是合并各部门中的不同用户的多个网站访问的简便方法。一个显式命名的路径(如 http://server/sites/team)用于单个网站集;而一个通配符路径“sites”(如 http://server/sites/)表示路径的子 URL 是网站集。所以,本选项并没有创建直接可访问网站,应该排除。
  因此本题答案应该选 D

参考 
http://technet.microsoft.com/zh-cn/library/cc288705(v=office.14).aspx
http://technet.microsoft.com/zh-cn/library/cc263165(v=office.14).aspx
http://technet.microsoft.com/zh-cn/library/cc772112(v=ws.10).aspx
http://technet.microsoft.com/zh-cn/library/cc261845(v=office.14).aspx

 

Question  101 
Your development team has discovered that a SharePoint 2010 application has performance issues. The application is experiencing periodic application pool recycling due to memory thresholds being exceeded. You need to determine the cause of this behavior. Which logs should you tell your team to analyze?
A. Analyze the IIS logs for entries related to SPPersistedObject objects.
B. Analyze the IIS logs for entries related to SPRequest objects.
C. Analyze the Unified Logging Service (ULS) logs for entries related to SPPersistedObject objects.
D. Analyze the ULS logs for entries related to SPRequest objects.


解析:
  你的开发小组发现Sharepoint2010应用程序有执行性能问题,每隔周期性的一段时间,内存阀值被突破,从而引起Application Pool被回收。你需要依靠何种方法才能找出具体的原因呢?
  根据题意,我们很容易判断是由于”内存泄露”造成的问题。
  关于Sharepoint的内存泄露,我们了解如下的知识点:
  Sharepoint对象模型中的对象可用作处理 SharePoint Foundation数据的接口。开发人员经常调入对象模型以从 SharePoint Foundation 2010 和 SharePoint Server 2010 数据存储中读取数据或向其中写入新数据。Sharepoint对象模型包含实现 IDisposable 接口的对象。使用这些对象时必须采取防范措施,防止它们长期保留在 Microsoft .NET Framework 使用的内存中。
具体地说,在使用完这些实现 IDisposable 的 SharePoint 对象后,应该明确释放它们。
在广泛使用 SharePoint 对象的情况下 - 例如,在使用自定义 Web 部件的 SharePoint 网站中 - 如果在使用完 SharePoint 对象之后不释放它们,则可能会导致以下异常行为。

  •  SharePoint Foundation 应用程序池频繁进行回收,尤其是在使用高峰期【本题的情况】
  •  应用程序崩溃,在调试程序中表现为堆损坏
  •  Internet Information Services (IIS) 工作进程使用大量内存
  •  系统和应用程序性能低下

如果网站有上面描述的任意异常行为,则通过检查 ULS 日志(可在 C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\LOGS 处获得)中是否有与 SPRequest 对象相关的条目,可以确定原因是否是由于错误释放对象而引起的内存泄露。  
SPSite 和 SPWeb 的每个实例都包含对 SPRequest 对象的引用,而该对象又包含对非托管的 COM 对象的引用,此非托管的 COM 对象处理与数据库服务器之间的通信。SharePoint Foundation 将监视每个特定线程和并行线程中存在的 SPRequest 对象的数目,并在以下三种情况下向日志中添加有用的条目:

  •  SPRequest 对象的总数超出了可配置的阈值。
  •  SPRequest 对象在线程结束后继续存在。
  •  SPRequest 对象已通过垃圾收集从堆中移除

  了解到这儿,我们就已经能够定位本题的答案了,即: 在ULS中分析SPRequest 对象相关的条目。
因此本题答案应该选 D

参考 
http://msdn.microsoft.com/zh-cn/library/ee557362(v=office.14).aspx
http://msdn.microsoft.com/en-us/library/aa973248(v=office.12).aspx

posted @ 2013-12-26 14:13  wsdj  阅读(604)  评论(0编辑  收藏  举报