none
ESB Toolkit 2.2: Error in using the dynamic itinerary resolver (BRI)

    Question

  • Hi,

    I'm currently starting a new project using the ESB Toolkit 2.2. So far everything appears to work as expected, except for the dynamic itinerary selection based on the BRE.

    The test scenario I have is a FILE receive location using the pipeline 'ItinerarySelectReceiveXML' with the following settings:

    FactKey: Resolver.Itinerary

    ResolverConnectionString: BRI:\\policy=DemoSelection;

    I have a BR in the BRE with that particular name, and the rule states If 1=1 then return itinerary DemoItinerary.

    The error I get is:

    Exception has been thrown by the target of an invocation. 

    Source: Microsoft.Practices.ESB.Resolver.ResolverMgr 

    Method: System.Collections.Generic.Dictionary`2[System.String,System.String] Resolve(Microsoft.Practices.ESB.Resolver.ResolverInfo, Microsoft.BizTalk.Message.Interop.IBaseMessage, Microsoft.BizTalk.Component.Interop.IPipelineContext) 

    Error Source: mscorlib 

    Error TargetSite: System.Object InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)  

    Error StackTrace:    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
       at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
       at System.Activator.CreateInstance(Type type, Object[] args)
       at Microsoft.Practices.ESB.Resolver.ResolverFactory.Create(String key)
       at Microsoft.Practices.ESB.Resolver.ResolverMgr.GetResolver(ResolverInfo info)
       at Microsoft.Practices.ESB.Resolver.ResolverMgr.Resolve(ResolverInfo info, IBaseMessage message, IPipelineContext pipelineContext)

    If I statically define the itinerary in the pipeline with a BRE statement and everything works fine (so the itinerary is fine). I've notice it doesn't seem to matter what values I use for FactKey or ResolverConnectionString, I get the same error. I suspect this is a configuration issue with ESB.config, but I've double checked everything. I noticed version 2.2 of the ESB toolkit uses Enterprise Library 5.0 instead of 4.1, but just to make sure their isn't any old libraries using 4.1 I've installed 4.1 in the GAC, and just for fun tried running the whole toolkit using 4.1 (which doesn't work).

    If anyone can confirm this functionality works with version 2.2 of the toolkit that would be great! And if anyone has any ideas as to what's causing the issue that would be even better :)

    Cheers

    Friday, April 26, 2013 2:06 AM

Answers

All replies

  • Hi,

    I have the same error. The itinary is found when I use the ESB.BusinessRules.Tester tool but at runtime in BizTalk an error occurs in the ResolverMgr class.  It seems that this is a bug!

    Testing Business Rules in ESB toolkit:
    http://code.msdn.microsoft.com/Testing-Business-Rules-in-28396b66

       

    Kind regards,

    Tomasso Groenendijk

    Blog  |  Twitter
    MCTS BizTalk Server 2006, 2010

    If this answers your question please mark it accordingly





    Friday, April 26, 2013 12:30 PM
  • I am also receiving this error with ESB Toolkit 2.2. I have been testing with a solution that is currently in a production environment using ESB Toolkit 2.1. It looks like a bug to me also.

    Colin Meade (MCTS BizTalk Server)

    Sunday, April 28, 2013 2:58 PM
  • Issue has now been logged with Microsoft Connect. Please visit:

    https://connect.microsoft.com/BizTalk/feedback/details/785966/esb-toolkit-2-2-error-in-using-the-dynamic-itinerary-resolver-bri

    And up vote the issue. Seems a pretty major and obvious failure in the ESB Toolkit!


    • Edited by .Chris.Net Wednesday, May 01, 2013 2:14 AM
    Wednesday, May 01, 2013 2:13 AM
  • Just ran into the same issue while migrating a BizTalk 2010 application to BizTalk 2013. I voted up the issue as well.


    Tuesday, May 07, 2013 11:42 AM
  • Am also facing the same issue after migration to BizTalk 2013, I also voted up this issue.
    Wednesday, May 08, 2013 10:01 AM
  • Hi,

    The “Microsoft.Practices.ESB.Resolver.Unity.ResolveProvider” object in the ESB Toolkit 2.2 uses Microsoft Enterprise Library 5.0 and Unity 2.0 and Unity 2.0 uses a new streamlined configuration schema for configuring Unity. Therefore, the esb.config file from the ESB Toolkit must be modified.

    The following adjustments should be made:

    • Remove the <typeConfig> element
    • Change the <typeAlias> element to <alias>
    • Change the <type> element to <register>.
    • Remove the <containers> elements and <types> elements.

    For more information see:
    http://www.ithero.nl/post/2013/05/12/How-to-fix-the-error-Exception-has-been-thrown-by-the-target-of-an-invocation-when-using-the-BRI-resolver-in-the-ESB-Toolkit-and-BizTalk-2013.aspx

       

    Kind regards,

    Tomasso Groenendijk

    Blog  |  Twitter
    MCTS BizTalk Server 2006, 2010

    If this answers your question please mark it accordingly






    Sunday, May 12, 2013 6:46 PM
  • Great work Tomasso !! I hadn't noticed Unity uses a different configuration schema, good find.

    Cheers,

    Chris

    Monday, May 13, 2013 6:22 AM
  • This same issue would also then affect the ITINERARY-STATIC resolver since it is also composed at runtime using Unity, correct?
    Friday, May 24, 2013 5:51 PM
  • So is a ticket open for this issue?

    Eric Stott [http://esb.stottcreations.com] - Mark as Answer if this reply does.


    • Edited by Eric Stott Friday, May 24, 2013 9:26 PM
    Friday, May 24, 2013 9:25 PM
  • It has been brought to the attention of the product team. They are working on a CU but I don't have confirmation yet as to whether this has been included.

    Colin Meade (MCTS BizTalk Server) http://midheach.wordpress.com

    Friday, May 24, 2013 11:58 PM
  • I tried changing the ESB Config file as per Tomasso's comments without any success.

    Still facing the error :

    Exception has been thrown by the target of an invocation.

    Source: Microsoft.Practices.ESB.Resolver.ResolverMgr

    Method: System.Collections.Generic.Dictionary`2[System.String,System.String] Resolve(Microsoft.Practices.ESB.Resolver.ResolverInfo, Microsoft.BizTalk.Message.Interop.IBaseMessage, Microsoft.BizTalk.Component.Interop.IPipelineContext)

    Error Source: mscorlib

    Wednesday, July 03, 2013 7:28 PM
  • Hi,

    On my blog post is also the modified esb.config available as download. Have you tried that?

    http://www.ithero.nl/downloads/modified_EsbConfig.zip

    Kind regards,

    Tomasso Groenendijk

    Blog  |  Twitter
    MCTS BizTalk Server 2006, 2010

    If this answers your question please mark it accordingly

    Thursday, July 04, 2013 7:20 AM
  • Have you resolved this issue? I to have not had success, even though my ESB.Config file has been updated.
    Friday, September 06, 2013 9:04 PM
  • Hi Dean,

    Changing the esb.config solves the exception: “Exception has been thrown by the target of an invocation.” Do you have this exception? Or another one?

    You can change the machine.config file to see the BizTalk ESB Toolkit trace output.

    To enable the BizTalk ESB Toolkit trace switch, add the following <switches> element to the system.diagnosticssection of the Machine.config file.
    <system.diagnostics>
      <switches>
        <addname="BizTalkESBToolkit"value="4"/>
      </switches>
    </system.diagnostics>

     

    Kind regards,

    Tomasso Groenendijk

    Blog  |  Twitter
    MCTS BizTalk Server 2006, 2010

    If this answers your question please mark it accordingly

    • Proposed as answer by Dean Kasa Tuesday, September 10, 2013 6:17 PM
    Sunday, September 08, 2013 12:40 PM
  • Hi Tommaso,

    I have resolved (sort of) the issue described. I still get the "Exception has been thrown by the target of an invocation.” exception, but when I dig into the details of it, I can determine that the esb.config file is NOT the issue.

    My problem has now morphed into another issue that is related to customised components in our ESB implementation. I will create another question to help resolve that issue.

    Dean

    Tuesday, September 10, 2013 6:17 PM
  • Hi Tomasso,

    I tried setting the value for ResolverConnectionString as : ITINERARY-STATIC:\\headerRequired=false; today and still got the same error

    Exception has been thrown by the target of an invocation.

    Source: Microsoft.Practices.ESB.Resolver.ResolverMgr

     In the meanwhile I was using  ResolverConnectionString  as ITINERARY:\\name=ItineraryFileName;version=1.0 to make my project to work.

    I also compared my esb.config to that of yours and they look same. This error is still there in ESB Toolkit 2.2 and Microsoft has not really released any patch to fix this error till date.

    Thanks

    Sachin


    Monday, October 07, 2013 8:21 PM
  • This has been addressed under hotfix 2887594 http://support.microsoft.com/kb/2887594 which is included in the BizTalk 2013 CU 2 http://support.microsoft.com/kb/2892599

    Colin Meade (MCTS BizTalk Server) http://midheach.wordpress.com

    Friday, November 01, 2013 5:08 PM
  • We got same error, we faced this issue in Static Resolver, Even patch released by Microsoft also applied, ESB.config was also modified but no solution. Complete Error message is as follow 

    There was a failure executing the receive pipeline: "Microsoft.Practices.ESB.Itinerary.Pipelines.ItinerarySelectReceiveXml, Microsoft.Practices.ESB.Itinerary.Pipelines, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "ESB Dispatcher" Receive Port: "ABCD.ESB.XYZ.Receive" URI: "mssql://xyzdeyz/dderss?InboundId=getStudentUpdates" Reason: Exception has been thrown by the target of an invocation.

    Wednesday, December 18, 2013 5:39 PM
  • Hi,

    On my blog post is also the modified esb.config available as download. Have you tried that? Note: You have to change the database settings in the esb.config

    http://www.ithero.nl/downloads/modified_EsbConfig.zip

     

    Kind regards,

    Tomasso Groenendijk

    Blog  |  Twitter
    MCTS BizTalk Server 2006, 2010

    If this answers your question please mark it accordingly

    Thursday, December 19, 2013 9:16 AM
  • A resolver's connection string comprises of a moniker followed by ":\\" and the processing details. See some examples below:

    ITINERARY:\\name=TwoWayTestItinerary;version=; BRE:\\policy=GetCanadaEndPoint;version=;useMsg=False;
     BRI:\\policy=ResolveItinerary;version=;useMsg=True;BRE stands for 'Business Rules Engine Resolver'BRI stands for 'Business Rules Itinerary Resolver'.
     http://www.codeproject.com/Articles/288285/Hello-World-in-BizTalk-ESB-Itinerary-using-a-Purch

    If you want to access to your Business Rules Engine, you should put BRE:\\ and not BRI:\\

    Thursday, July 24, 2014 6:50 AM
  • Hi AliRazaZaidi,

    I'm exactly getting the same error which you are getting. Could you please advise how you managed to resolve this issue. We have recently migrated to new server and moved from ESB2.2 to ESB 2.3.

    Thanks in advance.

    Tuesday, June 09, 2015 4:57 AM