cancel
Showing results for 
Search instead for 
Did you mean: 

jco connection :null

prasad
Participant
0 Kudos

Hi sap gurus

I am using rfc connection for executing bapi using some jco connections. but if the jco are being used for one time it is being executed . but when we deploy application another time . the exception is received as dynamicrfcexecution error jco connection:null.

when we change the poolsize it is being . the rfc is executed for only one time.

please suggest a way to close jco connections . if already present.

Thanks & Regards

prasad

Accepted Solutions (1)

Accepted Solutions (1)

lokesh_kamana
Active Contributor
0 Kudos

Hi,

What is the logon mechanism your using while creating the JCO Destinations.

Is it Logon Ticket,Userid/Password.

Please let us know how you have configured your JCO Destinations. Please recheck the JCO Destination configuration once and paste the RFC model execution code which you are using so that we can help you.

Thanks & Regards,

Lokesh Kamana

prasad
Participant
0 Kudos

hi , logon mechanism while creating the JCO Destinations.

Is Logon Ticket

This is code what iam using for rfc access

Zhr_Emp_List_Input input = new Zhr_Emp_List_Input();

wdContext.nodeZhr_Emp_List_Input().bind(input);

wdContext.nodeZhr_Emp_List_Input().currentZhr_Emp_List_InputElement().setPernr("10" );

try {

wdContext.nodeZhr_Emp_List_Input().currentZhr_Emp_List_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

} catch (WDDynamicRFCExecuteException e) {

wdComponentAPI.getMessageManager().reportSuccess(e.toString());

// TODO Auto-generated catch block

e.printStackTrace();

}finally {

wdContext.currentZhr_Emp_List_InputElement().modelObject().modelInstance().disconnectIfAlive();

}

for the above code where Zhr_Emp_List_Input is the rfc . which will return employee details when we set the Pernr(personal number) to rfc

the exception is

com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException: Error connecting using JCO.Client: null

for only one time the rfc is executing . for the other time if we increase the pool size or change the whole jco references for webdynprojava application . we are able to execute the application

lokesh_kamana
Active Contributor
0 Kudos

Hi,

Ru running the webdypro java application inside a portal or standalone from NWDS.

You have these issues when you run ur application from ur NWDS.

Please try keeping this application in a Portal Role and assign it to a user and then check ur still facing the issue.

You said that when you increased the pool size its working what is the pool size you are currently using.

One more thing is if your running ur application from NWDS. Maintain the Application property sap-authentication=true and check if you still face the same issue.

Thanks & Regards,

Lokesh Kamana.

lokesh_kamana
Active Contributor
0 Kudos

Small Code change

try this.


Zhr_Emp_List_Input input = new Zhr_Emp_List_Input();
 input.setPernr("10" );
wdContext.nodeZhr_Emp_List_Input().bind(input); 
try {
wdContext.nodeZhr_Emp_List_Input().currentZhr_Emp_List_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
} catch (WDDynamicRFCExecuteException e) {
wdComponentAPI.getMessageManager().reportSuccess(e.toString());
// TODO Auto-generated catch block
e.printStackTrace();
}finally { 
wdContext.currentZhr_Emp_List_InputElement().modelObject().modelInstance().disconnectIfAlive(); 

}

Thanks & Regards,

Lokesh Kamana

p330068
Active Contributor
0 Kudos

Hi Prasad,

Please use the code like below


Zhr_Emp_List_Input input = new Zhr_Emp_List_Input();
input.setPernr("10" );
wdContext.nodeZhr_Emp_List_Input().bind(input); 

try {
input.execute();
wdContext.nodeOutput().invalidate();
} catch (WDDynamicRFCExecuteException e) {
        wdComponentAPI.getMessageManager().reportSuccess(e.getLocalizedMessage());
        e.printStackTrace();
} catch(Exception ex) {	
        wdComponentAPI.getMessageManager().reportSuccess(ex.getLocalizedMessage());
}finally { 
wdContext.currentZhr_Emp_List_InputElement().modelObject().modelInstance().disconnectIfAlive(); 
}

Make sure you used the correct name of the JCO destination in the webdynpro. Please check the JCO destination name used for the webdynpro project and verify in the content administator > webdynpro > maintain jco destincation > test cnnection for the used JCO in webdynpro.

Refer to Verify [Logical System Names after Model Import|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3083] [original link is broken];

[Efficient Use of JCo Connections in Web Dynpro Java|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/705f2b2e-e77d-2b10-de8a-95f37f4c7022?quicklink=events&overridelayout=true], check the connection pool size and make neccesary changes.

Hope it will helps

Best Regards

Arun Jaiswal

prasad
Participant
0 Kudos

hi,

how to Maintain the Application property sap-authentication=true in nwds application

Regards

Prasad

junwu
Active Contributor
0 Kudos

double click the application you create in wd dc, you will find it

lokesh_kamana
Active Contributor
0 Kudos

Hi,

Double click on the Applications--->Ur Application.

You find a tab called "Application Properties".

Click on New

Select Pre-defined

Beside Name you find a button Browse click on that.

U find an option Authentication ang give the value as true.

Thanks & Regards,

Lokesh Kamana

prasad
Participant
0 Kudos

Thanks for reply

but enabling the authentication =true is always asking for the username and password while the application is deployed from nwds

Regards

prasad

lokesh_kamana
Active Contributor
0 Kudos

Hi,

Give any portal userid & password you have.

Userid/password--->Portal login credentails.

Thanks & Regards,

Lokesh Kamana

Answers (1)

Answers (1)

p330068
Active Contributor
0 Kudos

Hi Prasad,

Please close the connection modelInstance once you execute the RFC in the finally block.


try {
    // RFC Execution code
}catch(Exception ex) {
   // print message if there is any exception on RFC Execution 
 } finally {		
 wdContext.current<RFC NODE NAME>Element().modelObject().modelInstance().disconnectIfAlive();	
}

Once you update the code then try again and check the issue.

Refer to Web Dynpro Best Practices: [How to Configure the JCo Destination Settings|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/3103eb90-0201-0010-71af-be6f4a6f61d1?quicklink=index&overridelayout=true]

[System Landscape Directory Process and JCo Configuration|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0c1d495-048e-2b10-babd-924a136f56b5?quicklink=index&overridelayout=true]

Also refer to [FAQ - Models - Adaptive RFC |http://wiki.sdn.sap.com/wiki/display/WDJava/FAQ-Models-Adaptive+RFC]

Hope it will helps

Best Regards

Arun Jaiswal