on 07-26-2011 3:10 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.