on 01-20-2010 5:34 PM
Hello,
I dont know why when I run my WD application that is calling the enterprise service "PurchaseOrderByIdQueryResponse_In" I am getting the following error:
java.lang.NullPointerException: Setting related objects to empty collection not allowed for mandatory target role 'Item' of model
class 'pe.com.minsur.wd_po_v7.ecc_purchaseorder002qr.PurchaseOrder' with cardinality 'ONE_TO_MANY'
com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Exception was thrown in preprocessing phase of application session ApplicationSession(id=dd04241105e511dfc4bd0017a477042a, name=pe.com.minsur.wd_po_v7.wdpov7_app.Wdpov7_App). The causing exception is nested.
Caused by: java.lang.NullPointerException: Setting related objects to empty collection not allowed for mandatory target role 'Item' of model class 'pe.com.minsur.wd_po_v7.ecc_purchaseorder002qr.PurchaseOrder' with cardinality 'ONE_TO_MANY'
at com.sap.tc.cm.base.model.BaseGenericModelClass.setRelatedModelObjectsInternal(BaseGenericModelClass.java:561)
I dont know if I have to add some code.
Please help
Thanks & Regards
SU
Edited by: soauniverse on Jan 21, 2010 2:30 PM
Hi,
usually there is a block like this in wdDoInit()-Method of the component controller.
//$$begin Service Controller
...
java.util.List<yourType> yourlist = new ArrayList<yourType>();
...
//$$end
Because there is no element in this list you get an error.
To avoid this, you can add a line like this:
yourlist.add(new yourType(yourModell));
Regards
Timo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Answer to your first question. please check your WD applications is using any GP or BPM (PurchaseOrderByIdQueryResponse)?
it may be the reasson as service automaticaly execute when application starts.
If it is, then you can check the reason for no data coming through it, you can start search from interface controller.
creating the node element or changing its cardinality may solve the problem only if you know root cause.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Open you Context and set the Cardinality of nod PurchaseOrder to 0..*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I've changed the property "Selection Cardinality" to 0..n for ITEM node, the property "Collection Cardinality" is disabled for editing. After that I deploy & run the application again, I've got the same exception.
java.lang.NullPointerException: Setting related objects to empty collection not allowed for mandatory target role 'Item' of model class 'pe.com.minsur.wd_po_v7.ecc_purchaseorder002qr.PurchaseOrder' with cardinality 'ONE_TO_MANY'
Thanks
SU
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.