ESB Management Portal Installation Error

Anyone who has worked with the ESB Guidance Toolkit will tell you that the complex and troublesome installation of the toolkit is one of the most common reasons for the toolkit not getting wider coverage and usage.  The next release of the toolkit (due at around the same time as BizTalk 2006 R3) will make the installation process significantly simpler.  In the meantime, however, those wanting to use the functionality of the toolkit will find that the installation guide created by Peter Kelcey (available at ESBInstallProcess_V1.pdf) is a great guide that helps avoid most of the issues encountered during the installation.

Recently, however, a customer installed the toolkit and everything was moving along smoothly until they got to the final step of the ESB Management Portal installation: "Open the portal at https://localhost/esb.portal/ to validate that the portal loads correctly".  When launching this URL the customer was presented with the standard ASP.Net "Runtime Error" page, and 3 events were logged to the event log, stating "An exception of type 'System.NullReferenceException' occurred and was caught. Object reference not set to an instance of an object. ", "An unhandled exception has occurred. ", and "An exception of type 'System.Web.HttpException' occurred and was caught. Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive ... ".

This topic has been discussed on the ESB Codeplex site (https://www.codeplex.com/esb/Thread/View.aspx?ThreadId=17667) in which reference was made to the knowledgbase article for enabling ASP.Net applications to run on a SharePoint virtual server (https://support.microsoft.com/kb/828810).  The KB article states that the path for the ESB Management Portal should be configured as an excluded path in SharePoint and that the server's web.config file may need to be changed as well.  After excluding the esb.portal path from SharePoint's managed paths the error still remained.  The customer was reluctant, however, to change the server's web.config file as the server used hosted a number of other applications in IIS, and wanted to find out what changes could be made to the esb.portal web.config file to get the Management Portal to function correctly. 

Hence, the reason for this post is to detail the changes that were made to the web.config file of the ESB Management Portal to get the portal to function correctly on a server that has SharePoint Team Services 2.0 or SharePoint Server 2003 installed.

Following the guidelines given in the KB article, and through a process of trial and error the minimum set of changes to be made are as follows:

  1. After the httpHandlers section, add the following:
    <httpModules>   <add name="Session" type="System.Web.SessionState.SessionStateModule"/> </httpModules>
  2. Change the <pages> tag to:
    <pages enableSessionState="true" enableViewState="true" enableViewStateMac="true" validateRequest="false">

In addition to these changes you will still need to ensure that the esb.portal virtual directory is part of SharePoint's list of excluded paths.

A final note on this: if you encounter this error, make the changes to the config file, and then refresh the page you may still get an error in the browser.  This is because the ESB Management Portal is configured to use custom errors, so the error page is redirected to the URL https://localhost/esb.portal/DisplayError.aspx?aspxerrorpath=/ESB.Portal/Home/HomePage.aspx, and when you refresh your browser the error page is then refreshed, and not the home page located at https://localhost/esb.portal.  So, just check the URL before refreshing.

Hopefully this will save someone else the time and hassle associated with finding a solution for this error.