Monday, April 14, 2014

BAM Alerts: Cannot start service BAMAlerts on computer


When installing BAM Alerts on BizTalk 2013, we encountered an error; it was preventing us from moving ahead with our plans for BAM. We investigated, asked the relevant people and nothing helped.
The error is below:

Exception object: 02d61034

Exception type: Microsoft.BizTalk.Bam.CfgExtHelper.BAMConfigurationException

Message: Error executing process: C:\Program Files (x86)\Microsoft BizTalk Server 2013\Tracking\bm.exe

InnerException: Microsoft.BizTalk.Bam.CfgExtHelper.BAMConfigurationException, Use !PrintException 02d60dc4 to see more.

StackTrace (generated):

<none>

StackTraceString: <none>

HResult: 80131600

0:001> !PrintException 02d60dc4

Exception object: 02d60dc4

Exception type: Microsoft.BizTalk.Bam.CfgExtHelper.BAMConfigurationException

Message: Microsoft (R) Business Activity Monitoring Utility Version 3.10.229.0

Copyright (C) Microsoft Corporation. All rights reserved.


ERROR: Failed to set up BAM database(s).

The alert infrastructure was not created.

Cannot start service BAMAlerts on computer '.'.

The service did not respond to the start or control request in a timely fashion


InnerException: <none>

StackTrace (generated):

<none>

StackTraceString: <none>

HResult: 80131600

The root problem was the BAM alerts service was being created, but failing to start in the allocated timeout, and thus it failed. We had this working on our development machine fine, however this was UAT and it was not fine.

In UAT like most good setup’s we had various domain policies applied, that locked down the environment, for good reason. The service was trying to start, and waiting for verification that it could start.

What it was trying to do was a verification operation that took quite long time(> 60 seconds) because it was calling winhttp to download Certificate Trust List (CTL) but the download action was not successful.

This would not work, as it’s a locked down environment and we do not allow this. Then because the service does not start in time, it fails the install….

The solution, as simple as it is now… was to implement a setting in the bamalerts service that would tell it to bypass the checking of the security.

Create a bamalerts.exe.config, in the folder where BAMAlerts.exe is installed usually:  C:\Program Files (x86)\Microsoft BizTalk Server 2013\Tracking.

Place this simple config into the file.

<configuration>

     <runtime>

           <generatePublisherEvidence enabled="false"/>

     </runtime>

</configuration>

Retry the configuration of bam alerts, and it should work. (Be sure to clean up the alerts database, and see my other post, and remove the role NSEventReader from the BAM Primary import database or you will get a different error and it still will not work.)

This is a known issue, and there are some fixes out there for this, but it will also prevent other windows services from starting, not just BAMAlerts. In in locked down configurations, like ALL BizTalk environments should be, you can not just allow internet access for all things. It should be SOME not ALL things have internet access.

Monday, March 17, 2014

ERROR: Failed to set up BAM database(s). The specified account is already in the view.

We have had this error occur when installing BAM Alerts.

It's a pain which was caused by another part of BAM not working, and leaving bits left over......

Solution is simple enough:

SQL Server Management Console
 BAMPrimaryImportDB
  Security
   Roles
    DatabaseReoles
     BAM_ManagementNSReader
        Remove the account here.

Remove the BAMAlerts Database.

Try again.
 

Sunday, January 26, 2014

IDOC to SAP and the hierarchy is all wrong?


In SAP, have you ever come across this scenario, sending an IDOC to SAP and the hierarchy is all wrong?

I am working on the ORDERS message to SAP.

Have a look below, my E1EDP01 Segment needs to have children beneath it, E1EDP02 is a child of E1EDP01, however it does not have this… 




This is what I need to see in SAP, however they are coming all below each other…. Why ??? 

 
 
I looked at the SAP schema in BizTalk, in particular:

DATAHEADERCOLUMN_SEGNUM   - The segment number of this element.
DATAHEADERCOLUMN_HLEVEL – The Hierarchy level of the element
DATAHEADERCOLUMN_PSGNUM – The parent Segment number


Now, you can try mapping to these, however all the documents say that on the inbound iDOC these are not important…

Well the truth is, on the outbound iDOC they are fully populated, and it’s quite nice to see when SAP sends it to you.

On the inbound, these are not required, the KEY is to look at the schema of the IDOC, it’s quite crucial.

Look at my NODE, first of all in the version of the iDOC, its called E2EDP01008, in SAP based on the data structure type, its E1EDP01. 


Look at the MAX occurs, it is just once and it MUST be there, however I have quite a few repeated here….

Look at its parent, it occurs 999999 times; which is enough, underneath the parent are all of the children nodes that were also repeating.


ONE Instance of the parent is for ONE item, and all the children related to that ONE item. It’s the parent that should be looping all of the items, however quite often some of the children do repeat, within EACH item.

For these you need to use table looping, or structure you source message to handle this correctly.

You need to focus  on making the mandatory fields match up and getting the data from various places to ensure this occurs.

These are the steps I followed, and had to work out, and I managed to get it to work, it needs to be followed exactly, once done the potential is endless. 

Tuesday, November 26, 2013

Configuring SAP and BizTalk



SAP BIZTALK & ASSOCIATED ISSUES


I get countless problems with SAP, it’s a pain to get going, but once its working, it’s golden.

Have you ever experienced any of these errors, well here are the errors and the solutions.

ERROR 1: The Messaging Engine failed while executing the inbound map for the message coming from source Details:"Loading property information list by namespace failed or property not found in the list. Verify that the schema is deployed properly. "

ERROR 2: The Messaging Engine failed to add a receive location …. to the adapter "WCF-SAP". Reason: "Microsoft.ServiceModel.Channels.Common.ConnectionException: Details: ErrorCode=RFC_OK. ErrorGroup=RFC_ERROR_BUSY. SapErrorMessage=CMALLC : rc=2 > Connect from SAP gateway to RFC server failed
Connect_PM  DEST=BIZTALK_2, TPNAME=BIZTALK_2

ERROR 3: The receive location "SAPxyz" with URL "sap://CLIENT=100;LANG=ENxyz&ListenerProgramId=BIZTALK_2&RfcSdkTrace=False&AbapDebug=False" is shutting down. Details:"The Messaging Engine failed while notifying an adapter of its configuration. ".

ERROR 4: The Messaging Engine failed to add a receive location "SAPxyz" with URL "sap://CLIENT=100;LANG=EN;@a/xyz…&ListenerProgramId=BIZTALK_2&RfcSdkTrace=False&AbapDebug=False" to the adapter "WCF-SAP". Reason: "Microsoft.Adapters.SAP.RFCException: Details: ErrorCode=RFC_OK. ErrorGroup=RFC_ERROR_SYSTEM_FAILURE. SapErrorMessage=Open file 'saprfc.ini' failed: 'No such file or directory'.

Answer 1: When the sap adapter is deployed, it is supposed to deploy this assembly, however it does not, so you need to add it as a resource to BizTalk. 

 

 Answer 2 & 3

These are related, check you have a receive location setup, with your program ID, go into the SAP GUI and check via the /nsmgw command, look for your host, it will be the one running the BTSNTSvc command. You need to have it appear here first, get a receive location hooked up to this… if not there is your problem.

 


Check /nsm59 look for your entry point under TCP/IP, and sure it exists.




Double click on it, and make sure the activation type is registered service program, it is not the default. Your SAP admin will need to fix this.




Perform the connection test, it must pass…your receive location will need to be configured and running....


Answer 4: 

Read what it says in the description panel, for destination name, there are two of these… make both blank, it will stop asking you for the saprfc.ini