cancel
Showing results for 
Search instead for 
Did you mean: 

java.lang.NullPointerException error seen on deplying web dynpro applicati

Former Member
0 Kudos

Hi,

This is very simple RFC web dynpro application

the error java.lang.NullPointerException is seen

this happens whenver i access my model node

error is for the code line where i pass value to the model node or when i initialise the model node

cardinality of this node is 0....1

kindly help

thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member192434
Active Contributor
0 Kudos

Hi

Change cardinality 1:n

Thanks

bhakti2
Active Participant
0 Kudos

Hi,

I added the code of adding element to the node

i got the message

com.sap.tc.webdynpro.progmodel.context.ContextException: DataNodeInfo(Datacust.Bapi_Repmanconf_Create_Mts_Input.Bflushdatagen): value node is created without a reference

data is passed

from node 1...1(this ones mapped to the view)

to node 0...1 (this is a model node and its sub node of a node which is also 0..1)

my code is simple -

wdContext.currentBflushdatagenElement().setBackflquant(wdContext.currentCtx_inputElement().getBackflquant());

kindly help

thanks

bhakti2
Active Participant
0 Kudos

I am not able to change the cardinality . its sub node of modal node. i changed cardinality of the parent node to 1...1 but that didnt help. same error occured.

thanks

Former Member
0 Kudos

Hi,

Did you execute the model before accessing elements?

Regards

Ayyapparaj

former_member192434
Active Contributor
0 Kudos

Hi Rita.

Change and save the cardinality on component controller side it will automatically get change on view side

Thanks

pravesh_verma
Active Contributor
0 Kudos

Hi Rita,

In the component controller, you need to execute that model as well. RFC call is handled automatically by the model.

Please look into this code snippet.

wdcontext.current<XYX>_input_elements().modelObject.execute();

This code will execute the model and hence the RFC call for getting the input data.

You need to execute the model for getting the data.

Thanks and Regards

Pravesh

bhakti2
Active Participant
0 Kudos

hi,

I have already done rfc call.

now its working

wid different combinations of cardinalities and also to make sure that empty node is not passed to 1...1 cardinality node

but as it worked with random settings, i dont know the exact rules

cud u please recommend any document which i can always refer while coding ?

thanks very much fr helpful inputs

Former Member
bhakti2
Active Participant
0 Kudos

hi,

I am not able to find the fundamentals of cardinality in this link

pravesh_verma
Active Contributor
0 Kudos

Hi Rita,

Please refer to my first reply. There I have explained the reason why and how the cardinality is effecting the output and the error is displayd to you.

When cardinality is

0:1

0:n

Then that means that there are initially no element for that node and you need to create the element explicitly. Please refer to the code I have sent in my first reply.

If the cardinality is:

1:1

1:n

That means that there is a defualt element created for thisn ode and you can access this element without creating a new element.

Cardinalities depend on your requirements. Please refer to the link posted by Ayyapparaj above. Hope these inputs will help you.

Also close this thread if the problem is solved.

Thanks and Regards,

Pravesh

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

before reading it call the rfc.

Regards,

ramesh

pravesh_verma
Active Contributor
0 Kudos

Hi Rita,

Try to create an element of the node first and then access this particular element. I think you are accessing the nod element without creating it. Since the node cardinality set by you is 0:1, therefore initiallly there will no elements in the node.

Just try this line of code..

wdContext.createAndAdd<Node_Name>Element();

OR

Change the cradinality of the node to 1:1 if you require only 1 element in the node always OR ELSE change it to 1:n if there are more than 1 elements.

If you need any further information please revert back.

Thanks and Regards

Pravesh

Former Member
0 Kudos

Hi,

Can you post the entire stack of the error and the code that you are using?

Regards

Ayyapparaj