on 07-28-2008 12:52 PM
I am new to WDJ.
I am trying to fill the dropdown(index) frm model. I have called RFC in the model ,added it to the used model and
mapped view context elements to the custom controller context elements.
The project was built with no errors.
But i am getting the 500 internal server error while running the application.
Here am giving the code which i wrote to fill up the dropdwon.
Can anybodly please guide me is the following code correct ? am missing something ?
Controller's method :
public void ExecuteSales_Document( )
{
//@@begin ExecuteSales_Document()
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try
{
wdContext.currentSales_DocuemntElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
}
catch(WDDynamicRFCExecuteException e)
{
manager.reportException(e.getMessage(),
false);
}
IWDAttributeInfo attributeInfo = wdContext.nodeOutput().getNodeInfo().getAttribute("vbeln");
ISimpleTypeModifiable attrType = attributeInfo.getModifiableSimpleType();
IModifiableSimpleValueSet valueSet = attrType.getSVServices().getModifiableSimpleValueSet();
int size = wdContext.nodeOutput().size();
for(int i=0;i<size;i++)
{
valueSet.put(wdContext.nodeOutput().nodeSalesdocument().getSalesdocumentElementAt(i).getVbeln(),wdContext.nodeSalesdocument().getSalesdocumentElementAt(i).getVbeln());
}
//@@end
}
If you get an internal server error 500, please check the default trace file and find the exception that causes this error. Post the complete stack trace, otherwise no one can help you.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Armin,
This is default trace file.
#1.5#0011258F6E960072000000660002AC0C0004534A769C3497#1217479189546#com.sap.tc.webdynpro.sessionmanagement#sap.com/tcwddispwda#com.sap.tc.webdynpro.sessionmanagement.ExceptionHandler.handleThrowable#Guest#0####b08b73825eba11dd88cb0011258f6e96#SAPEngine_Application_Thread[impl:3]_49##0#0#Error#1#/System/UserInterface#Java###Exception occured during processing of Web Dynpro application . The causing exception is nested.
[EXCEPTION]
#2#local/Adaptive_RFC/Adaptive_RFC#com.sap.tc.webdynpro.services.exceptions.TypeNotFoundException: type extern:com.sap.rfc.sales.types.RFC_SalesDocument:com.sap.rfc.sales.types.Zlt_Vbeln could not be loaded: com.sap.dictionary.runtime.DdException: TypeBroker failed to access SLD: Error while obtaining JCO connection.
at com.sap.tc.webdynpro.services.datatypes.core.DataTypeBroker.getStructure(DataTypeBroker.java:305)
at com.sap.tc.webdynpro.progmodel.context.DataNodeInfo.doInit(DataNodeInfo.java:234)
at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:671)
at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:674)
at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:674)
at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:674)
at com.sap.tc.webdynpro.progmodel.context.Context.init(Context.java:40)
at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:199)
at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:709)
at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:579)
at com.sap.tc.webdynpro.progmodel.view.ViewManager.init(ViewManager.java:155)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.doOpen(WebDynproWindow.java:295)
at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.show(ApplicationWindow.java:183)
at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.open(ApplicationWindow.java:178)
at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:364)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:707)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:269)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:759)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:712)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:261)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: com.sap.dictionary.runtime.DdException: TypeBroker failed to access SLD: Error while obtaining JCO connection.
at com.sap.tc.webdynpro.services.datatypes.core.DataTypeBroker$1.fillSldConnection(DataTypeBroker.java:90)
at com.sap.dictionary.runtime.ProviderFactory.internalResolveLogicalNameToJCODestination(ProviderFactory.java:377)
at com.sap.dictionary.runtime.ProviderFactory.resolveLogicalNameToJCODestination(ProviderFactory.java:322)
at com.sap.dictionary.runtime.ProviderFactory.internalGetProvider(ProviderFactory.java:181)
at com.sap.dictionary.runtime.ProviderFactory.getProvider(ProviderFactory.java:146)
at com.sap.dictionary.runtime.DdDictionaryPool.getProvider(DdDictionaryPool.java:97)
at com.sap.dictionary.runtime.DdDictionaryPool.getDictionary(DdDictionaryPool.java:79)
at com.sap.dictionary.runtime.DdDictionaryPool.getDictionary(DdDictionaryPool.java:48)
at com.sap.dictionary.runtime.DdBroker.getDataType(DdBroker.java:149)
at com.sap.dictionary.runtime.DdBroker.getStructure(DdBroker.java:180)
at com.sap.tc.webdynpro.services.datatypes.core.DataTypeBroker.getStructure(DataTypeBroker.java:303)
... 38 more
Caused by: com.sap.tc.webdynpro.services.sal.sl.api.WDSystemLandscapeException: Error while obtaining JCO connection.
at com.sap.tc.webdynpro.serverimpl.wdc.sl.SystemLandscapeFactory.getJCOClientConnection(SystemLandscapeFactory.java:152)
at com.sap.tc.webdynpro.serverimpl.wdc.sl.SystemLandscapeFactory.getJCOClientConnectionUnMapped(SystemLandscapeFactory.java:178)
at com.sap.tc.webdynpro.services.sal.sl.core.SystemLandscapeInternal.getJCOClientConnectionUnMapped(SystemLandscapeInternal.java:62)
at com.sap.tc.webdynpro.services.datatypes.core.DataTypeBroker$1.fillSldConnection(DataTypeBroker.java:77)
... 48 more
Caused by: com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to resolve JCO destination name 'WD_RFC_METADATA_SalesDocument_DEST' in the SLD. No such JCO destination is defined in the SLD.
at com.sap.tc.webdynpro.serverimpl.wdc.sl.JCOClientConnection.resolveConnectionParameter(JCOClientConnection.java:467)
at com.sap.tc.webdynpro.serverimpl.core.sl.AbstractJCOClientConnection.init(AbstractJCOClientConnection.java:233)
at com.sap.tc.webdynpro.serverimpl.core.sl.AbstractJCOClientConnection.<init>(AbstractJCOClientConnection.java:218)
at com.sap.tc.webdynpro.serverimpl.wdc.sl.JCOClientConnection.<init>(JCOClientConnection.java:129)
at com.sap.tc.webdynpro.serverimpl.wdc.sl.SystemLandscapeFactory.getJCOClientConnection(SystemLandscapeFactory.java:150)
... 51 more
#
Thanks & regards
Sireesha.
Hi,
+TypeNotFoundException: type extern:com.sap.rfc.sales.types.RFC_SalesDocument:com.sap.rfc.sales.types.Zlt_Vbeln could not be loaded:+
By this error we can say that, there is some change in the back end. they have changed some data type or field.
re import the model and check the mapping again. if required restart the j2ee engine
check this thread its similar to yours
Caused by: com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to resolve JCO destination name 'WD_RFC_METADATA_SalesDocument_DEST' in the SLD. No such JCO destination is defined in the SLD.
check this error. its with JCO destinations. contact your BASIS team
PradeeP
Edited by: pradeep bondla on Aug 1, 2008 1:32 PM
Hi Sireesha,
Your RFC interface seems to be changed. Try this:
Reimport the RFCmodel ,
Edit the context mapping, and check the bindings and
Restart the server.
Then deploy the application.
Check you JCo Destinations too once.
because of this com.sap.dictionary.runtime.DdException: TypeBroker failed to access SLD: Error while obtaining JCO connection in your stock trace. Particularly this line
WDRuntimeException: Failed to resolve JCO destination name 'WD_RFC_METADATA_SalesDocument_DEST' in the SLD. No such JCO destination is defined in the SLD.
You can test your JCo destinations like this.
Open your Portal -> Go to Content Administration -> Click on Web Dynpro. Here in left side, you can see all your deployed WD applications. Browse and select your application. In right side you can see the JCo destinations for your application. You can test your JCo destinations. If they are not working properly, you can edit them also.
Regards,
Siva
Hi Ramesh,
Do i need to create JCO destinations for how many models that i created in my application or one JCO destination is enough.
While creating model in defining logical system dropdown one JCO destination is available : WD_RFC_METADATA_DEST and WD_MODELDATA_DEST.
Can i use the above model instance and RFC metadata ? or do i need to create a separae for my model ?
Thanks & Regards
Sireesha.
Hi Ramesh,
I have created JCO destinations for metadata and dictionary type.Both are successfully running in the server side.
In NWDS i should replace the old JCO destinations with the new one for my application. So for that i was able to replace old JCO JCO destination with the new one for dictionary type which is for RFC.. but for the application data i could not find any property "Model Settings " of model my class Input. I do not understand where should i replace this old application data with the new JCO destination.
Can anyone please tell me how to replace the application name ?
Regards
Sireesha.
Hi Sireesha,
Yes , you can replace the other JCO destination (application scope) through the model classes.
Just go to your model name XYZ --> Model Classes --> And Double click on any of the RFCs classes( some..Zrfc_xyz_input). Then in the properties you can replace the old JCO with the new one.
Regards,
Narendra.
Hi Narendra / Gopal,
I have told that i have already tried this way but i can see only three properties for my model class which are name,package, path. But i cannt see model class settings and model settings. So my doubt is where should i change this application data destination in my model since i am not getting model settings properties.
Regards
Sireesha.
Hi Sireesha,
As you are using the custom RFC, first the field should be populated with data. In your case I suppose your field is not populated with data -- I mean you had not written any code for the population for data into that particular field in RFC.
When that field is populated with data in RFC , automatically in the webdynpro, when you bind to the texts property, the data populates in the runtime.
Regards,
Narendra.
Edited by: Narendra on Aug 7, 2008 11:07 AM
hi,
call RFC in DoInit method if you want to populate the values at initialization time.
and bind the"tests" properties of DropDownByIndex Element with RFC Attribute.
example if your RFC context Structure is
zsd_fm_get_input -
node
output -
node
t_input -
node
description -- attributre
id -- attribute
bind the"tests" properties of DropDownByIndex Element with "id" or "description" as per your requirement.
Thanks,
Ramesh
Edited by: Ramesh Babu V on Jul 28, 2008 5:53 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sireesha,
You can do so just by assigning the corresponding context attribute (e.g vbeln) to the texts property of the DropDownByIndex UI .
Hope this should work out.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sireesha,
For ex. If your required field has different values (like 51001,51002,51003,etc), just you can simply bind the texts property to the same field. In the runtime you can see the field populated with data like (51001,51002,51003, etc)..
No code is necessary...
But only see that the backend RFC has the field populated with data.
Regards,
Narendra.
Hi Narendra,
I had already binded the texts property of dropdown to the context element attribute. and in the doInit method i called the method which is defined in the controller.
Do u mean no code is required to fill the dropdown when dropdown by index is used ?
Can u pls tell me where else code is required to fill this..?
Thanks & Regards
Sireesha.
Hi Ramesh,
Thank you for your reply.
I have not added the code which u have posted. But i have declared a method in the controller which am calling in the view doinit method as below.
wdThis.wdGetSalesItemListController().ExecuteSales_Document();
My doubt is this user-defined method ExecuteSales_Document need to be implemented or not ? or is it necessary to call this in view doinit method ?
and in your code after the bind can u give me the proper syntax how to define this RFC node...
my RFC root node is Sales_Document. so after in the bind method i do not understand how to call the RFC node?
is this correct ? wdContext.nodeSales_Docuemnt().bind(new <Sales_Document>())
with the above syntax am getting errors at "new"
can u pls correct me the above one?
Thanks & Regards
Sireesha.
Hi,
please follow the below instructions
1.in Controller DoInit()
paste this code
wdContext.nodeSales_Document().bind(new Sales_Document());
2.and implement the "ExecuteSales_Document" method in controller with below code
public void ExecuteSales_Document( ){
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try
{
wdContext.currentSales_DocumentElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
}
catch(WDDynamicRFCExecuteException e)
{
manager.reportException(e.getMessage(), false);
}
}
and
3. call wdThis.wdGetSalesItemListController().ExecuteSales_Document();
method in Doinit method of Your view
Regards,
Ramesh
Ramesh,
I did the same as you suggested.
But getting the error at Sales_Document in the below code as " Sales_Document" cannot be resolved or is not a type.
Code In the controller doinit() method
wdContext.nodeSales_Document().bind(new Sales_Document());
Sales_Document is my RFC root node (Controller contexts root node).
Which bind method i should select in the context menu.I have tried with the 3 bind methods which are available in the context menu. But still am getting this exception...
Can u pls correct me the above one ?
Ramesh,
As u said in your first reply in this thread after the wdcontext i will be getting the controller's Context Nodes in the context menu but how will i be getting the RFC name itself (Zsales_Document) in the context menu...?
I mean .nodeZSALES_DOCUMENT() cannt be getting in the context menu (Popup Menu)
Here is my Controllers Context Structure
Sales_Document
Output |
salesdocument
|
vbeln.
use this code wdContext.nodeZSALES_DOCUMENT().bind(new ZSALES_DOCUMENT());
As per the my above structurte i will be getting .nodeSales_Document. bind etc.,
But how i will be getting for Zsales_Document in the popu menu.?
Thanks & Regards
Sireesha.
Hi Narendra,
As u said only binding the texts property is enough for to fill the dropdown by index. I have tried by removing my previous code and treid by binding the texts property but still am getting 500 internal server error...
can u advice me where it was wrong..
and also can u advice me on the below code as ramesh suggested in this post..
wdContext.nodeSales_Docuemnt().bind(new Sales_Document());
In the above line am getting error at sales_document as cannt be resolved or is not a type.
can u pls tell me clearly after the new operator what element need to be mentioned?
Thanks & Regards
Sireesha.
Hi Sireesha,
I suppose you are not calling the rfc related to data that was supposed to fill for the particular field.
I am giving a small example.
if your rfc has field VBELN, then this field has to be filled up with data by SELECT * --- statement in the source code of the rfc.
And then this rfc when called in your application, automatically populates to the binded DropDownByIndex UI.
Try with this.
Regards,
Narendra
Hi Sireesha,
Press Ctrl + Space placing the cursor inside brackets of bind
wdContext.nodeSales_Docuemnt().bind();
You will find some options on what all correct parameters can be passed. Ignore the Collection parameter, choose the other option
where user have to pass instance of the RFC Model class. You will get the name of correct Model Class. If Model Class name is
"Sales_Doc" then write code as wdContext.nodeSales_Docuemnt().bind(new Sales_Doc());.. If it is something else then pass instance
of that model class.
After writing the code still you find error then press CtrlShifto.. This will organize your imports.
Regards,
Gopal
Hi Gopal,
Thank u so much for your valuable reply.
As of now i am calling the Controllers context attribute in the bind method but as you said it should be model class instance parameter.
Not getting the exception after specifying the correct parameter. But still am getting the 500 Internal Server Error after ruuing the application.
Here am giving the model clas structure , controllers context structure and also RFC's struct...
Can u pls indentify where its wrong..
Model Class
RFC_Salesdocument (Model name)
____Model Classes |
Zlt_Vbeln(Line Type which contains vbeln field) |
Zsales_Document_Input |
Output | Salesdocument |
Zsales_Document_Ouput |
| Salesdocument
Custom Controllers Context Structure
Context
|
Sales_Document |
Output
Salesdocument |
Vbeln
This is how i defined my rfc structure in model and controller.
You can go thru my previous posts in this thread to check the code written method execute..
And the doinit() method of controller
wdContext.nodeSales_Docuemnt().bind(new Zsales_Document_Input());
Its not throwing any exceptions while deploying but at runtime getting 500 internal server error.
Can u please check this?
Thanks & Regards
Sireesha.
Hi Sireesha,
I think error is not on your coding. Check out following link. Its better you contact your Basis team or admin.
http://pcsupport.about.com/od/findbyerrormessage/a/500servererror.htm
Regards,
Gopal
Hi Sireesha,
I am unable to give any further hint. May be you can try with restarting the J2EE Server. Do not know whether it will help your cause
or not.
And ya do what Ramesh is suggesting. It will help people here in SDN to solve your problem.
Regards,
Gopal
Edited by: Gopal on Jul 30, 2008 3:50 PM
Hi,
Am using csutom controller only to implement the RFC execute method.
I checked with the basis reg this its not problme with the network or anything but its problem with the code. because all other applicatipns are running perfectly fine. Only this application is throwing some runtime error.
Regards
Sireesha.
Hi Ramesh,
Just now i have done same thing by dusing component controller.
1. In the first step i have checked by not wrting code, i just binded the texts property of the dropdown and tested it, but its still giving this 500 internal error.
2. In the second step i have implemented the method which ia defined in this component controller and implemented doinit method etc...but afte this also am getting this exception at runtime.
Can you please do one thing...
Can you create one sample application by taking only drondown by index and label do the same process at our end.
because am not understanding where its wrong...
can u pls check the same at your end if its working let me know the steps so that i will check what i have missed out..
Thanks & Regards
Sireesha.
Hi,
For drop down by index you can bind it from the context attribute that contains data.
Code what you have written is for the dropdown by key.
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.