Thursday, December 13, 2012

mismatched ‘braces’ ‘{}’

Working on a project that involved a lot of changes to existing orchestrations I got this strange build error:
unexpected keyword: ‘service’                      MyOrchestration_1
unexpected keyword: ‘module’                     MyOrchestration_1
mismatched ‘braces’ ‘{}’                              MyOrchestration_2

I had been working on MyOrchestration_2 but not with MyOrchestration_1.
Reverting the changes on MyOrchestration_2 solved the problem but when adding my changes again the build error came back.
My own changes were valid and did not contain any missing closing braces. Something else had happened under the hood of Visual Studio.
I found the solution in a MSDN forum that discussed the problem. http://social.msdn.microsoft.com/Forums/en-GB/biztalkgeneral/thread/cc1dda1d-7b52-4082-8bbf-8d66e2377a85
Anders Elmén from Need2Code AB gave me the solution (I have left out some of code for better formatting):
I've got exactly the same issue with Visual Studio 2010 and BizTalk 2010.
Besides that the memory gets corrupt every now and then, especially when adding a new variable in a scope, this braces issue is verry annoying.
What's happening is that somewhere in VS2010 the Orcestration greneration class misses to add an closing of braces to the last body in the configuration.
1. Open your orchestration with notepad and look at the end of the file.
2. Add the missing brace closing.
3. Restart your VS2010 environment.
Sample of .odx file with missing closing brace.
    [Microsoft.XLANGs.BaseTypes.BPELExportable(false)]
    internal service Configuration
    {
        [Microsoft.XLANGs.BaseTypes.LogicalBinding()]
        port uses PortType_2 EIPMgmtDb;
        message [.......] Select;
        message [......]  SelectResponse;
        System.Xml.XmlDocument xmlDoc;
        body (System.Int32 ApplicationID, System.String KeyValue, out System.String ReturnValue)
        {
        [Add your closing braces here. Note that i can be more than one missing brace if you are using scopes or groups]
               }
/Anders Elmén
And now, looking at the code abowe (that I edited) I realized that I recognise the naming of some of the objects. Making some extended investigation I found that Anders Elmén actually worked as a consultatnt on the company I'm at. Thoough this is not the same project as I had problems with it is not that far fetched that Anders and I are actually having this problem in the same virtual development environment. Small world!

And Anders, if you read this - I don´t like the whay you named and structured the maps in the project. But on the other hand, it may not have been you that set up the original structure...

3 comments:

  1. While opening orchestration in note pad some brackets missing as listed in url:
    http://biztalksolutionstoproblems.blogspot.in/2012/12/working-on-project-that-involved-lot-of.html

    also some code also missing .

    Solution is to remove the links of recive shapes in orchestration and reconnect and build again .

    take back up of bindings before deploying.. because bindings may missed after deploying it is easy for import bindings.

    ReplyDelete

  2. شركة مكافحة النمل الابيض بالرياض
    عندما تستعين بشركة متخصصة في عمل التنظيف الخاصة بالمنازل والشقق والفلل والموكيت ،عندما تكون الشركة لها سمعة طيبة في مجال التنظيف ستحصل على منزل براق وأرضيات و
    حوائط نظيفة تماما مع الحفاظ على ألوانها من مواد التنظيف لنظافة شيئا ضروريا وخاصة عند تواجد اطفال صغار يخشي عليهم من الاتربة
    شركة تنظيف واجهات بالرياض
    شركة تنظيف موكيت بالرياض
    شركة تنظيف فلل بالرياض


    ReplyDelete