cancel
Showing results for 
Search instead for 
Did you mean: 

Destination configuration already initialized!?

Former Member
0 Kudos

I am prototyping with Visual Studio 2005 and have had wonderful results. The only problem that I am experiencing is the following error message AFTER the INITIAL request to my page right after my application has been built. Any subsequent requests to the page result in the following error:

"Destination configuration already initialized" from this line

RfcDestinationManager.RegisterDestinationConfiguration(new MyBackendConfig()) ;

Does anyone know a way to determine whether the destination has already been configured? Any help is greatly appreciated.

Edited by: Richard M. Mendez on Feb 3, 2011 8:52 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I've found that the following code works:

Config c = new Config();

RfcDestinationManager.RegisterDestinationConfiguration(c);

...

(processing code)

...

RfcDestinationManager.UnregisterDestinationConfiguration(c);

Former Member
0 Kudos

Could try


        public void RegisterDestination(string destinationName)
        {
      
            bool destinationIsInialised=((_rfcDestination !=null) && string.Equals(_rfcDestination.Name, destinationName));

            // Only register if not already initialised
            try
            {
                // ? destinantion already configured and initialised
                if (!destinationIsInialised)
                {
                    
                    RfcDestinationManager.RegisterDestinationConfiguration(new SAPIDocDestinationConfiguration(new XmlDocument()));//1

                    _rfcDestination = RfcDestinationManager.GetDestination(destinationName);
                    
                }
            }
            // ignore as destination already configured
            catch (RfcInvalidStateException rfcEx)
            {   
                // cascade up callstack
                throw rfcEx;   
            }
 

            System.Diagnostics.Trace.WriteLine(
                String.Format("Destination Confgured to:{0}", _rfcDestination.Monitor.OriginDestinationID));
        }

Daniel_KASIMIR
Participant
0 Kudos

Hi,

I'm facing the same problem. Any solutions so far?

Regards

Daniel

Former Member
0 Kudos

I never found a solution; however, I was able to workaround the issue by simply ignoring the error with the following:

try {

RfcDestinationManager.RegisterDestinationConfiguration(new MyBackendConfig());

} catch {

}

This should suffice in the interim until we can find a real solution later.

Daniel_KASIMIR
Participant
0 Kudos

Thank you Richard,

that was my first approach, too.

Now I put the code into the global.asax file where it is executed just once in "Application_Start". Works quite well.

Regards

Daniel