none
ESB 2.2 Alert Service will not start

    Question

  • Hi Vlad,

    Thanks for the update on ESB 2.2 I did manage to get the ESB.Portal to install correctly and I can successfully browse to it, but I just cannot get the ESB.AlertService to start I have spent hours on this.

    I get the following exception any help welecome

    Cheers

    Jim Mclay

    Service cannot be started. Microsoft.Practices.ServiceLocation.ActivationException: Activation error occured while trying to get instance of type Database, key "" ---> Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Data.Database", name = "(none)".

    Exception occurred while: while resolving.

    Exception is: InvalidOperationException - The type Database cannot be constructed. You must configure the container to supply this value.

    -----------------------------------------------

    At the time of the exception, the container was:

      Resolving Microsoft.Practices.EnterpriseLibrary.Data.Database,(none)

    ---> System.InvalidOperationException: The type Database cannot be constructed. You must configure the container to supply this value.

       at Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.GuardTypeIsNonPrimitive(IBuilderContext context, SelectedConstructor selectedConstructor)

       at Microsoft.Practices.ObjectBuilder2.DynamicMeth...

    Wednesday, April 10, 2013 4:17 PM

All replies

  • Jim,

      Did you already setup the connection string like mentioned here: http://msdn.microsoft.com/en-us/library/ff647933.aspx? Sorry this is an old BizTalk version, I wonder if this changed or not. I could not find an ESB 2.2 version of this documentation. You went through the ESB configuration wizard already right?

      Could you paste in the full stack trace?

      I will mention the documentation gap to Microsoft Support and also mention this may be a bug you are facing too.

      I split this thread off for better tracking purposes.

    Thanks,

    Ben Cline


    If this answers your question, please use the "Answer" button to say so | Ben Cline






    Thursday, April 11, 2013 4:19 PM
    Moderator
  • Hi Ben,

    Thanks for the reply.

     A bit of background to what I have done so far to install the ESB 2.2/Management Portal.

    The VM I am using is as follows

    WS2008 R2

    BizTalk 2013

    VS2010

    VS2012

    SQL 2008 R2 - separate machine/instance

    ESB 2.2

    ENTLIB 4.1

    ENTLIB 5.0

    I have gone through the usual steps to install ESB this time from the BizTalk setup. I then ran the ESB config app successfully, although the 'Apply Configuration' did not work by supplying the default config settings on the first page I had to set each of the configuration screens manually but it did eventually work. I have to admit is better than having to manually do it as in previous versions but I never really had issues with the installation of ESB and its configuration, my main contention is with the ESB Samples.

    I then unziped the ESBSource to deploy the ESB Portal.

    As per my ESB install checklist I opened the ESB.AlertService solution in VS2012 (it had already been upgraded to VS2012), but the load failed due to the setup project now being WIX. After several searches I downloaded and installed WIX 3.7 for Visual Studio 2012, this allowed me to load, compile and build a WIX MSI file for both the Alert and UDDIPublisher services. I successfully deployed these services using the WIX MSI files.

    The UDDIPublisher service started with no issues, but the Alert service failed with the exception detailed in my first message, I have copied the exception from the event viewer which is all I have got. The following is the entries in the app.config file

    <dataConfiguration defaultDatabase="EsbExceptionDb"/> <connectionStrings> <add name="EsbExceptionDb" connectionString="Data Source=MyServer\MyInstance;Initial Catalog=EsbExceptionDb;Integrated Security=True" providerName="System.Data.SqlClient"/> </connectionStrings> <connectionStrings>

    The link you mention in your reply is compliant with the app.config file entries.

    The Alert service code between ESB 2.1 and 2.2 versions appears to be the same although they are using different ENTLIB versions. I have spent hours trawling the internet and this does seem to be a well known error within Enterprise Library but having tried many of the suggested fixes for this I still cannot get a fix for this. I would be grateful for any help that you can offer.

    One question have the Microsoft developers ever tried this, sometimes I do get the feeling that they care very little for the ESB samples apart from upgrading them to the newest and greatest VS version and even then they don't always do this very well i.e. the management Portal is still VS2010 (and therefore unchanged since ESB 2.0) but a number of the samples have been updgraded, this has been the case now for all releases of BizTalk since Microsoft took over the ownership of ESB in 2009, ESB always seems to be an afterthought.

    Another gripe are Microsoft ever going to change this from SAMPLES to something more professional, I have had a few raised eyebrows over the years when clients find out I am deploying into their production environments SAMPLE code, it just doesn’t sit well.

    Has anybody downloaded the Doc files that Microsoft put up on the 1st April (fools day?) opening the ESBToolkit.chm file you get this

    Navigation to the webpage was canceled

    Bad enough that that it doesn't display anything but somebody at Microsoft can't spell.

    Once again many thanks to Vladimir Kirnishni's thread I managed to compile and deploy the Portal using VS2012.

    Cheers

    Jim McLay

    Friday, April 12, 2013 9:47 AM
  • Hey the help file issue is probably you have to right-click on it and go to properties and then check to enable it - this is a security weakness.

    As for the spelling issue, I am smiling too. :)

    Thanks,


    If this answers your question, please use the "Answer" button to say so | Ben Cline


    Tuesday, April 16, 2013 9:00 PM
    Moderator
  • Hi,

    Re-Help file yep that worked, thats a new one on me thanks.

    Still haven't resolved Alert Service startup failure, any updates. I have tried in vain to get this service to start, even copying the old code from ESB 2.1, as I have both ENTLIB 4 and 5 installed, I thought this would be a workaround, so successfully compiled (VS2010) deployed the Setup Msi but service startup now fails with the following -

    Service cannot be started. System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Unexpected end of file has occurred. The following elements are not closed: configuration. Line 213, position 1. (C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Config\machine.config line 213) ---> System.Xml.XmlException: Unexpected end of file has occurred. The following elements are not closed: configuration. Line 213, position 1.

       at System.Xml.XmlTextReaderImpl.Throw(Exception e)

       at System.Xml.XmlTextReaderImpl.ThrowUnclosedElements()

       at System.Xml.XmlTextReaderImpl.ParseElementContent()

       at System.Configuration.XmlUtil.StrictSkipToNextElement(ExceptionAction action)

       at System.Configuration.BaseConfigurationRecord.ScanSectionsRecursive(XmlUtil xmlUtil, String parentConfigKey, Boolean inLocation, String locationSubPath, OverrideModeSetting overrideMode, Boolean skipInChildApps)

       at System.Configuration.BaseConfigurationRecord.ScanSect...

    I have spent too much time on this already so having to admit defeat for the time being, so once again any help would be much appreciated.

    Cheers

    Jim McLay

    Wednesday, April 17, 2013 9:05 AM
  • Jim,

    I am facing the same issue, did you ever fixed it? If yes can you share the steps to resolve it?

    Thanks,

    Madhu.

    Monday, August 12, 2013 6:07 PM
  • Madhu,

    Can you please explain your system configuration ? BT Version and stuff??

    And what error you are getting?


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.

    Monday, August 12, 2013 6:13 PM
  • Sure, We are using BT 2013, 2008R2 and SQL 2012. Here is the error 

    Service cannot be started. Microsoft.Practices.ServiceLocation.ActivationException: Activation error occured while trying to get instance of type Database, key "" ---> Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Data.Database", name = "(none)".
    Exception occurred while: while resolving.
    Exception is: InvalidOperationException - The type Database cannot be constructed. You must configure the container to supply this value.
    -----------------------------------------------
    At the time of the exception, the container was:

      Resolving Microsoft.Practices.EnterpriseLibrary.Data.Database,(none)
     ---> System.InvalidOperationException: The type Database cannot be constructed. You must configure the container to supply this value.
       at Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.GuardTypeIsNonPrimitive(IBuilderContext context, SelectedConstructor selectedConstructor)
       at Microsoft.Practices.ObjectBuilder2.DynamicMeth...

    Monday, August 12, 2013 6:26 PM
  • Any luck for anyone?
    Wednesday, August 14, 2013 2:29 PM
  • I've found a solution to this issue. This worked for me.

    1) Changed the config section dataConfiguration section to:

    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true"/>

    2) Changed the database connection string to:

    <add name="EsbExceptionDb" connectionString="Data Source=(local);Initial Catalog=EsbExceptionDb;Integrated Security=True" providerName="System.Data.SqlClient"/>

    3) Add this section to the end of the App config file:

        <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <qualifyAssembly partialName="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling" fullName="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <qualifyAssembly partialName="Microsoft.Practices.EnterpriseLibrary.Data" fullName="Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </assemblyBinding> </runtime>


    Wednesday, September 04, 2013 8:54 AM
  • Hi Paul and Jim,

    I am facing the same issue as well.

    We are using VS 2012 with BizTalk 2013 on a Windows 7 machine.

    I tried the config changes but it dint help. Have you found the resolution for this? If yes, can you please share it.

    Tuesday, September 17, 2013 6:04 PM
  • Paul, Jim , LBRam,

    Anyone find a resolution?   I also tried the configuration suggestions from Maheshkumar and they did not resolve for me.

    Hoping that someone has found and will share resolution.

    Thanks!

    Dennis

    Sunday, September 22, 2013 9:09 PM
  • Hi,

    There are two issues with this service to be fixed after the installation to make it work. Assuming the service has been installed in the default folder "C:\Program Files (x86)\Microsoft BizTalk ESB Toolkit\Exception Notification Service", make the following changes:

    1. Rename "BizTalkESBExceptionNotification.exe.config" to "BizTalk ESB Exception Notification.exe.config"

    2. Open "BizTalk ESB Exception Notification.exe.config" file and replace the following line

    <add name="AlertService" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35" filePath="BizTalk ESB Exception Notification.exe.config"/>

    with

    <add name="AlertService" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35" filePath="C:\Program Files (x86)\Microsoft BizTalk ESB Toolkit\Exception Notification Service\BizTalk ESB Exception Notification.exe.config"/>

    Regards,

    --Vlad


    Vladimir Kirnishni

    • Proposed as answer by LBRam Tuesday, October 01, 2013 9:11 PM
    Tuesday, October 01, 2013 7:27 PM
  • Vlad,

    Thanks for responding and sharing your findings.  I will verify/try both.

    Thanks again!

    Dennis

    Tuesday, October 01, 2013 8:24 PM
  • Thanks Vlad,

    The suggestion worked! I had to change few things -

    1. My ESB installation has not created any folder in C:\Program Files (x86)\ , so I have my BizTalkESBExceptionNotification.exe.config in  "C:\Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\ESB.AlertService\bin\Debug " which I renamed.

    2. I had to change "App.Config" in Alert Service solution - to give the right path of AlertService

    3. Rebuild the solution

    4. Uninstall the existing service and reinstall it again

    5. Start the service, it works!

    Tuesday, October 01, 2013 9:15 PM
  • This solution worked for me to enable me to start the service. 

    FYI I am working with BizTalk 2013 R2 on Windows 2012 with SQL Server 2012. Thanks for posting this solution!

    Thursday, January 08, 2015 3:27 PM