cancel
Showing results for 
Search instead for 
Did you mean: 

sapnco 3.0 with .net framework 4.0 web application problem

Former Member
0 Kudos

Hello,

I have a problem.

I connect to rfc function with sapnco 3.0 in my web application.

First, my code is works fine.

But second time i have this error.

System.ArgumentNullException:Value cannot be null.Parameter name : key at System.Collections.Generic.Dictionary'2.

Find Entry(Tkey key) at System.Collections.Generic.Dictionary'2 TryGetValue(Tkey key,Tvalue& value) at SAPMiddleware.Connector.RfcRepositoryManager.GetRepository

(Rfcdestination destination ) at SAPMiddleware.Connector.RfcDestination.get_Repository() at WebApplication......

Error pointed out by the line below.


Accepted Solutions (0)

Answers (1)

Answers (1)

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Aysegul,

the pattern you are using is wrong. Do not register a IDestinationConfiguration within your web application code but within a more central place. A check for null when looking up a destination is simply invalid. null is returned whenever a destination is not found in the IDestinationConfiguration implementation that is registered or in the default one. In case it is not there it means it is not configured and you need to throw an exception that this destination is required for your application.

If you do the IDestionationConfiguration in a central place the exception should no longer occur.

Best regards,

Markus

hynek_petrak
Active Participant
0 Kudos

Hello Aysegul,

for ASP.NET such a central place can be Application_OnStart() in your Global.asax.

The line to be moved over  there is:


RfcDestinationManager.RegisterDestinationConfiguration(new MyBackendConfig());

Hynek

Former Member
0 Kudos

Hello Hynek,

I tried.

first time , it worked.

Bu second time (after 20 minutes ) i have same error.

I have any idea.I tried many things but problem didnt solved.


hynek_petrak
Active Participant
0 Kudos

And what is the exception now and the line that triggers the error? Please paste the line with context.

Former Member
0 Kudos

I created global.asax page. I transport connection infos and RfcDestinationManager.RegisterDestinationConfiguration(new BackendConfig())

Error is below.


hynek_petrak
Active Participant
0 Kudos

What happens if you call Ping() right after GetDestination(xxx)?

E.g.:


RfcDestination prd = RfcDestinationManager.GetDestination("PRD_000");

prd.Ping();

Former Member
0 Kudos

TRNETSMS0 is connection username.

hynek_petrak
Active Participant
0 Kudos

please increase the MAX_POOL_SIZE value to some value higher then one. Not sure why, perhaps your previous connection was not yet properly closed and/or not yet returned back to the connection pool.

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Hynek,

actually, metadata pools and application pools are completely separated. Best approach is to specify a REPOSITORY_USER and corresponding REPOSITORY_PASSWD so that metadata connections are using a user with limited premissions only. Nevertheless, you are right. Using 1 as MAX_POOL_SIZE is a problem, when using it for a destination used in a multithreaded application ...

Best regards,

Markus