cancel
Showing results for 
Search instead for 
Did you mean: 

Could not create JCOClientConnection

Former Member
0 Kudos

hi everybody

we have a webdynpro application which runs in a portal .

starting it, a connection to an r/3 backend is opened using a JCO Destination .

after some logins we have the problem , that no additional JCO Connection can be created ==> error :

Could not create JCOClientConnection for logical System: 'WD_MODELDATA_DEST' - Model: 'class com.lgs.hr.gg.searchemployee.model.SearchEmployeeModel'.

calling webdynpr

for me it seems , that the max. number of connections is created . does anybody know , which parameter i have to change to increase this value?

thank you for your help .

hannes toefferl ==> hannes.toefferl@leica-geosystems.com

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi Bhavik, just wanted to say thanks it looks like it will resolve my problem but i have one final question.

I remember in the past "HTMLB" that it was difficult to find the object that will give me access to the log on ticket. Please if possible could you tell me how i can get the log on ticket .... some code or something or where i can find the webdyn pro API.

Thanks

Former Member
0 Kudos

Hi Juan,

you can get log information for ticket from default_trc log file. you can watch this file from Log viewer service in Visual administrator.

Regards,

Bhavik

P.S. : Award points for helpful answers.

Former Member
0 Kudos

Hi, thats looks like it will work fine but there is no mention in the Jco docs about how to open a connection using a SSO tick ie the currently logged on user.

Any suggestions?

Former Member
0 Kudos

Hi Juan,

you can pass "MYSAPSSO2" as username and pass whole SAP logon ticket as password.

Regards,

Bhavik

Former Member
0 Kudos

Hi Bhavik, I have question : is it possible to bypass the "adaptive rfc model" and write the jco connection insted directly in the application of a webdynpro. If so do you perhaps know where i can find a doc that out lines how to do this or some sample code.

I ask because i used to wirte jsp's with htmlb tags on portal ep5sp5 and there i had to wirte the jco connection in the code.

Thanks

Former Member
0 Kudos

Hi Juan,

Yes you can also use JCO manually inside your code. For that you require sapjco.jar at design time and need to provide sharing reference to library, com.sap.mw.jco, deployed on server.

You can download this JAR from service.sap.com site. Find link for Java connectors there. With this Jar you will also get sample codes to call JCO.

If you find answer helpful then please assign award points.

Regards,

Bhavik

Former Member
0 Kudos

Hi Bhavik, thank you for your reply. I will only be able to implement and test Monday.

Will keep you posted.

Former Member
0 Kudos

Hi, i am having the sam problem but i am using the adaptive RFC model and not writing the code in my application.

Here is some of my code :

private String getEmployeeFromUser(IUser user) throws Exception {

String pernr = "No pernr";

try{

IWDMessageManager msgManager = wdThis.wdGetAPI().getComponent().getMessageManager();

HR_GETEMPLOYEEDATA_FROMUSER rfc = new HR_GETEMPLOYEEDATA_FROMUSER();

Hr_Getemployeedata_Fromuser_Input input = new Hr_Getemployeedata_Fromuser_Input();

input.setUsername(user.getUniqueName().toUpperCase());

Hr_Getemployeedata_Fromuser_Output output = rfc.hr_Getemployeedata_Fromuser(input);

Bapiret2 bapiret = output.getReturn();

if (bapiret.getNumber().equals("000") == false) {

errorOut("bapiret.getNumber() : "bapiret.getNumber()" bapiret.getMessage() : "+bapiret.getMessage());

}

pernr = output.getEmployeenumber();

//Disconnect

rfc.disconnectIfAlive();

}catch(Exception ex){

this.errorOut("Could not get employee number for this user! MESSAGE : "+ex.getMessage());

}

return pernr;

}

Former Member
0 Kudos

dear jari

many thanks for your tip . can you tell me how i have to create this pool .i can't find the mentioned tutorial.pdf.

could you please send me this documentation or describe how to change/create it .

hannes.toefferl@leica-geosystems.com.

thank you !!

br. hannes toefferl

Former Member
0 Kudos

Hi Hannes,

If i am not wrong, you have created two jco destinations in Webdynpro Content administrator. Here, at the time of creating your JCO destinations, you can specify the max no. of connection should open for this JCO. Increase the size of it.

Regards,

Bhavik

Former Member
0 Kudos

Yes that is correct , the values that i have set there are as follows:

Maxpoolsize = 100.

Maxconnection = 200

MaxTimewait = 10

connectionTimeout = 8

It still doing the same thing.

Former Member
0 Kudos

Hi Juan,

There is another way also to avoid this situation. After executing your BAPI close the connection to SAP R/3.

Write following code to disconnect with SAP R/3.

wdcontext.current<node>element().modelobject().modelInstance().disconnectIfAlive();

It will close connection with R/3. and this error won't come again.

Regards,

Bhavik

Former Member
0 Kudos

Hi,

have you created Pool with JCO.addClientPool?

Here is example from jco tutorial.pdf:

JCO.addClientPool(

POOL_NAME, // pool name

5, // maximum number of connections

logonProperties); // properties

Remember to release unused clients also:

JCO.releaseClient()

Br. Jari Schwartz