Monday, April 22, 2013

Error: Schema referenced by Map has been deleted. The local, cached version of the BizTalk Server group configuration is out of date.

One of my colleges started getting following error on the development machine:

Schema referenced by Map '<Namespace>.<MappName>' has been deleted. The local, cached version of the BizTalk Server group configuration is out of date. You must refresh the BizTalk Server group configuration before making further changes. (Microsoft.BizTalk.Administration.SnapIn)



The deployment script stop working as deploying any DLL using BTSTask.exe was causing the same error:



I figured out that this issue has been fixed for BizTalk Server 2010 as part of KB2516201 and suggested to install the Cumulative Update 1 for BizTalk Server 2010. But it turned out that installing the KB article was not helping in this scenario.

Apart from the bugs fixed in Cumulative Update 1 this error can be caused by one more reason which was the case in this scenario.

You can re-produce this error by following these steps:

Step 1: Create a BizTalk project and add 2 sample schemas to it.
Step 2: Create another project add reference to the above BizTalk Project and add a mapper and use the 2 sample schemas created in Step 1 as source and destination in this map.
Step 3: Deploy the solution to BizTalk.
Step 4: Add another sample schema to the project created in Step 1.
Step 5: Update the mapper created in step 2 and replace either the source or destination schema with the new schema created in Step 4.
Step 6: Deploy only the DLL for the mapper project only.
Step 7: Try to refresh the BizTalk group in the BizTalk Administration Console or use the BTSTask you will start getting this error.

So be careful when using the deployment script and in script try to deploy the assemblies having schema first and if the deployment of any BizTalk assemblies having schema have been failed then script should not  proceed further.

As BTSTask was not able to add/remove any resource so the entry for this mapper from the BizTalk Management DB was removed manually by executing the following queries in SQL management studio:

Step 1: Open the SQL management Studio and connect to the instance having BizTalkMgmtDb. Run this query:

SELECT [id] FROM [BizTalkMgmtDb].[dbo].[bts_item]
WHERE FullName = '<CopyTheNameOfTheMapFromErrorMessage>'
GO

Step 2: Get the value of id and replace it in below query:

DELETE FROM [BizTalkMgmtDb].[dbo].[bt_MapSpec] WHERE itemid = <Value of id from above query>

It will delete the entry for map from the BizTalk Management Database now you can rectify the issue with your deployment script and can redeploy the solution.

Cheers
Rohit Sharma

11 comments:

Birgen said...

Thanks, this solution works for us. We had installed until CU 5 but the problem remained. After deleting two maps, everything is fine again.

Anonymous said...

Thanks for this fix. Worked perfectly for me. I didn't relish reconfiguring BizTalk unnecessarily.

Jean-Paul Smit said...

Thanks! After seeing this error message I was already afraid I had to fix it in the databases themselves. I was very happy to see you already figured it out!
Saved me lots of time!

Gautham Melanta said...

Thanks for this Rohit. Came up with this issue in BT 2013 as well. Couldn't figure out what was happening. This article really helped me out.

Anonymous said...

Thanks for the post Rohit, saved my day :)

Deepak Shaw said...

Thanks it helped.

Unknown said...

Thank you Rohit; worked perfectly!

Anonymous said...

Thanks Rohit you da man

Deepak Shaw said...

If you just want to open admin console>> BT Group>>Applications, create a new application (a test application), surprisingly it open the BT Gr Application tree..

kemal said...

seferihisar transfer
balıklıova transfer
ıldır transfer
davutlar transfer
gümüldür transfer

3İL3CG

melis said...

bergama transfer
güzelbahçe transfer
foça transfer
mordoğan transfer
aliağa transfer
balıkesir transfer

NPG

Post a Comment