ESB Tool kit and Portal configuration
Have got stuck with ESB/ESB Portal configuraiton... as like I did.
Hope the below compilation of troubleshooting steps will help.
1.Building ESB.Portal and dependent web services setups
ESB.Portal source code is available as part of the ESB tool kit installation and could be found at the installation directory:
To move the portal to Acceptance or Production environment its best to create installer for these components this will create the necessary web services and app pools.
Follow these instructions on a development environment, with MS Visual Studio 2008 installed:
Install ESB Toolkit 2.0 (http://www.microsoft.com/download/en/details.aspx?id=11847 ).
- Install Microsoft Chart Controls for Microsoft .NET Framework 3.5 ( http://www.microsoft.com/downloads/details.aspx?FamilyId=130F7986-BF49-4FE5-9CA8-910AE6EA442C&displaylang=en ).
- Extract ESBSource.zip (found in the Program Files\Microsoft BizTalk ESB Toolkit 2.0folder) to a new folder.
- Inside this folder, go to the Keys folder and create a Microsoft.Practices.ESB.snk file, by following the instructions in the Readme.txt file.
- Go to the Source\Samples\Management Portal\ESB.Portal folder and open the ESB.Portal.slnsolution file.
- Select Debug/Release in the solution configuration to choose the type of installation file to build.
- Right click on the ESB.Portal.Setup project, and click on Rebuild.
- Go to th eSource\Samples\Management Portal\ESB.Portal.Setup\Debug or Source\Samples\Management Portal\ESB.Portal.Setup\Release and copy the ESB.Portal.msi and Setup.exe that were just created to the computer where you want to install it.
2.Installation of ESB tool Kit and ESB.Portal
Follow these instructions to get it done:
Install the ESB Toolkit package by following the instructions in the ESB Toolkit documentation
- After this, you need to install the 3 prerequisite sample applications from the ESB Toolkit source code, this is different if you are installing in a 32-bit OS or in a 64-bit OS.
Skip this step if you are only installing the Exception Handling functionality and go to Step 3
In a 32-bit Environment:
-
- If running Windows Server 2008:
a) Open Source\Install\Scripts\ESBFunctions.ps1and find the following text:
if ($SDKPath -eq $null)
{
$SDKPath=(Get-ItemProperty “hklm:SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A”).InstallationFolder
}
b) Add the following text after that line (to allow the script to find the gacutil.exe kfile in the Windows Server 2008 SDK directory):
if ($SDKPath -eq $null)
{
$SDKPath=(Get-ItemProperty “hklm:SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1″).InstallationFolder
}
2. Open up a Command Prompt (Start Menu => Accessories => Command Prompt, run it as administrator).
3. Run the following command:
Powershell Set-ExecutionPolicy unrestricted
4. In the same command prompt, go to the Source\Samples\Dynamic Resolution\Install\Scripts folder
5.Run the following command and type in the required credentials:Setup_bin.cmd
6. In the same command prompt, go to the Source\Samples\Itinerary\Install\Scripts folder
7. Run the following command:
Setup_bin.cmd
8. In the same command prompt, go to the Source\Samples\Multiple WebServices\Install\Scripts folder.
9. Run the following command:
Setup_bin.cmd
B. In a 64-bit environment:
- If running Windows Server 2008:
a) Open Source\Install\Scripts\ESBFunctions.ps1and find the following text:
if ($SDKPath -eq $null)
{
$SDKPath=(Get-ItemProperty “hklm:SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0A”).InstallationFolder
}
b) Add the following text after that line (to allow the script to find the gacutil.exe file in the Windows Server 2008 SDK directory):
if ($SDKPath -eq $null)
{
$SDKPath=(Get-ItemProperty “hklm:SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.1″).InstallationFolder
}
2. All the powershell scripts must run in 32-bit mode, as Microsoft.Biztalk.ExplorerOM cannot be run in a 64-bit process.
To enable this, you need to open the following powershell scripts one by one:
-
-
- Source\Samples\DynamicResolution\Install\Scripts\DynamicResolution_Install.ps1
- Source\Samples\DynamicResolution\Install\Scripts\DynamicResolution_Uninstall.ps1
- Source\Samples\Itinerary\Install\Scripts\Itinerary_Install.ps1
- Source\Samples\ Itinerary \Install\Scripts\Itinerary_Uninstall.ps1
- Source\Samples\MultipleWebServices\Install\Scripts\MultipleWebServices _Install.ps1
- Source\Samples\MultipleWebServices\Install\Scripts\MultipleWebServices _Uninstall.ps1
-
3. And include the following code at top of the files:
if ($env:Processor_Architecture -ne “x86″)
{
write-warning “Running x86 PowerShell…”
&”$env:windir\syswow64\windowspowershell\v1.0\powershell.exe” $myinvocation.Line
exit
}
4. Open up a Command Prompt (Start Menu => Accessories => Command Prompt, run it as administrator).
5. Run the following command:
%windir%\syswow64\windowspowershell\v1.0\powershell.exe Set-ExecutionPolicy unrestricted
6. In the same command prompt, go to the Source\Samples\DynamicResolution\Install\Scriptsfolder
7. Run the following command and type in the required credentials;Setup_bin.cmd
8. In the same command prompt, go to theSource\Samples\Itinerary\Install\Scripts folder.
9. Run the following command:
Setup_bin.cmd
10. In the same command prompt, go to the Source\Samples\MultipleWebServices\Install\Scripts folder
11. Run the following command:
Setup_bin.cmd
3. Open Internet Information Services Manager and create a new application pool, named EsbPortalNetworkAppPool and configure it to run under Network Service account.
4. Open Source\Samples\Management Portal\SQL\ESB.Administration.Database.sql in SQL Server Management Studio, and connect to the Biztalk Database Server.
a) If your Biztalk user groups have custom names, then you need to change them inside this file, find and replace BizTalk Application Users and BizTalk Server Administrators with the custom names.
b) Now run that script in the server, and the ESBAdmindatabase will be deployed.
5. Run the setup.exe file you previously built and when asked for the Application Pool, select the EsbPortalNetworkAppPool one. This will create all the required virtual directories for the ESB Management Portal in the website you chose.
6. Go to the website directory (for Default Website, go toc:\inetpub\wwwroot), and find theESB.Portalfolder. Open theweb.configfile and do the following:
a) Modify the AdminDatabaseServer connection string to point to the right database.
b) Uncomment and modify theEsbExceptionDbconnection string to point to the right database.
c) Remove or changenetwork driverpart of the connection strings if you don’t intend to connect to the databases through TCP/IP.
d) Again, if your Biztalk user groups have custom names, then you need to change them inside this file, find and replace BizTalk Application Users and BizTalk Server Administrators with the custom names in the authorization node.
7. Now find the web.config for the ESB.Exceptions.Service and the ESB.BAM.Serviceapplications and do the same connection string modifications.
8. In Internet Information Services Manager, go to the Authentication configuration for all the 3 applications (ESB.Portal, ESB.Exceptions.Service and ESB.BAM.Service), disable Anonymous Authentication and enable Windows Authentication.
3.Troubleshooting
Below is the list and resolution of various scenarios that may occur during the successful configuration of ESB Portal.
- Scenario: Unhandled error in ESB.Portal (Error 400)
Thread information:
* Thread ID: 7*
* Thread account name: domain\btsserviceaccount*
* Is impersonating: False*
* Stack trace: at System.Net.HttpWebRequest.GetResponse()*
* at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)*
Fix:
Enable the CustomError log to “RemoteOnly”
If the error is at:
List<UserSetting> settings = client.GetUserSettings(context.User.Identity.Name);
Do this:
One possible cause:
Web.Config the connectionstring is with the assumption that you installed SQL Server with the default instance name,and your sql server has a named instance.
So, to solve this problem:
Open C:\Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\ESB.Exceptions.Service\ESB.Exceptions.Service and replace this
<add name="EsbExceptionDbConnectionString" connectionString="Integrated Security=SSPI;Data Source=.;Initial Catalog=EsbExceptionDb" providerName="System.Data.SqlClient" />
With:
<add name="EsbExceptionDbConnectionString" connectionString="Integrated Security=SSPI;Data Source=servername\instancename;Initial Catalog=EsbExceptionDb" providerName="System.Data.SqlClient" />
If this doesn’t fix the problem then run this script pointing to the correct database server.
USE EsbExceptionDb
GO
GRANT SELECT ON [dbo].[Alert] TO [ESBPortal]
GO
GRANT SELECT ON [dbo].[Alert] TO [ESBPortalAdmin]
GO
GRANT SELECT,INSERT,UPDATE,DELETE ON [dbo].[AlertCondition] TO [ESBPortal]
GO
GRANT SELECT,INSERT,UPDATE,DELETE ON [dbo].[AlertCondition] TO [ESBPortalAdmin]
GO
GRANT SELECT,INSERT,UPDATE,DELETE ON [dbo].[AlertSubscription] TO [ESBPortal]
GO
GRANT SELECT,INSERT,UPDATE,DELETE ON [dbo].[AlertSubscription] TO [ESBPortalAdmin]
GO
GRANT SELECT,INSERT,UPDATE ON [dbo].[Configuration] TO [ESBPortal]
GO
GRANT SELECT,INSERT,UPDATE ON [dbo].[Configuration] TO [ESBPortalAdmin]
GO
GRANT SELECT,INSERT,UPDATE ON [dbo].[UserSetting] TO [ESBPortal]
GO
GRANT SELECT,INSERT,UPDATE ON [dbo].[UserSetting] TO [ESBPortalAdmin]
GO
GRANT SELECT ON [dbo].[vw_AggregatedFaults] TO [ESBPortal]
GO
GRANT SELECT ON [dbo].[vw_AggregatedFaults] TO [ESBPortalAdmin]
GO
GRANT EXECUTE ON [dbo].[usp_select_Fault_Count_Over_Time_By_Application] TO [ESBPortal]
GO
GRANT EXECUTE ON [dbo].[usp_select_Fault_Count_Over_Time_By_Application] TO [ESBPortalAdmin]
GO
GRANT EXECUTE ON [dbo].[usp_select_Fault_Count_Over_Time_By_Application_ServiceName] TO [ESBPortal]
GO
GRANT EXECUTE ON [dbo].[usp_select_Fault_Count_Over_Time_By_Application_ServiceName] TO [ESBPortalAdmin]
GO
GRANT EXECUTE ON [dbo].[usp_select_Resubmission_Count_Over_Time_By_Application] TO [ESBPortal]
GO
GRANT EXECUTE ON [dbo].[usp_select_Resubmission_Count_Over_Time_By_Application] TO [ESBPortalAdmin]
GO
GRANT EXECUTE ON [dbo].[usp_select_AlertSubscription_Count_Over_Time_By_Application] TO [ESBPortal]
GO
GRANT EXECUTE ON [dbo].[usp_select_AlertSubscription_Count_Over_Time_By_Application] TO [ESBPortalAdmin]
GO
GRANT EXECUTE ON [dbo].[usp_select_AlertSubscription_Count_Over_Time_By_Application_ServiceName] TO [ESBPortal]
GO
GRANT EXECUTE ON [dbo].[usp_select_AlertSubscription_Count_Over_Time_By_Application_ServiceName] TO [ESBPortalAdmin]
GO
GRANT EXECUTE ON [dbo].[usp_select_Resubmission_Count_Over_Time_By_Application_ServiceName] TO [ESBPortal]
GO
GRANT EXECUTE ON [dbo].[usp_select_Resubmission_Count_Over_Time_By_Application_ServiceName] TO [ESBPortalAdmin]
GO
If Still fails, add these lines to the web.config file of the esb.exception service
<system.web>
<trust level="Full"/>
</system.web>
2. Scenario: You get the below error
There was no endpoint listening at http://localhost/ESB.Exceptions.Service/ExceptionService.svc/GetUserSettings?username=WIN-SDLX10ZUE1K%5cAdministrator that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Fix: you might be able to see the exception (http://localhost/ESB.Exceptions.Service/ExceptionService.svc ) service running fine
Check and correct the end point address in the web.config file for the ESB.Portal.
3. Scenario: You get a “Could not load file or assembly ‘ESB.Exceptions.Service.Implementation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified.” error:
Fix:
Copy the ESB.Exceptions.Service.Implementation.dll from the ESB.Exceptions.Service/bin folder to the ESB.Portal/bin folder.
4. Scenario: If you get a “404: Not Found” error, it ‘s because by default there is no script map for .svc file with default IIS 7.0 installation, so you need to register .svc extension in IIS
Fix:
You need to update IIS script maps to register .svc extension In a command prompt (ran as administrator), execute the following command:
“%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe” -r –y
5. Scenario: If you get a “401: Unauthorized” error:
Fix:
Edit the web.config for ESB.Portaland replace
<transport clientCredentialType=”Windows” />
With
<transport clientCredentialType=”Ntlm” /> in the system.serviceModel/bindings/webHttpBinding node.
6. Scenario: If you get the following error:
Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'"
Fix:
This error can occur when IIS is installed after installing .NET Framework 4, or if the 3.0 version of the WCF Http Activation module is installed after installing IIS and .NET Framework 4.
To resolve this problem, you must use the ASP.NET IIS Registration Tool (Aspnet_regiis.exe,) to register the correct version of ASP.NET. This can be accomplished by using the –iru parameters when running aspnet_regiis.exe as follows:
aspnet_regiis.exe -iru
7. Scenario: if you get the following error:
Exception message: An unexpected error occurred during initialization of the BizTalk Operations Service. ---> Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
Fix:
You need to get the business operations service (asmx) working, i opened the source for it (needs to be c:\projects) under core and redeploy it as a 32 bit application, it calls a BizTalk om which only runs under 32 bit mode....the advanced settings in IIS show a 'allow 32 bit mode' that is default to 64bit.
See Also
Another important place to find a huge amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.