cancel
Showing results for 
Search instead for 
Did you mean: 

Null Pointer Exception

Former Member
0 Kudos

Hi!!

I'm getting a java.lang.NullPointerException after trying to execute a BAPI from a button... The problem is that there is not trace of what's happening, the only message it says is null pointer... I'm sure the BAPI works fine, and the parameters are being passed correctly.

Any ideas?

Thanks a lot!!!

Accepted Solutions (1)

Accepted Solutions (1)

former_member197348
Active Contributor
0 Kudos

Hi Alejandro,

Can you please post the code snippet where you are getting this exception?It is very hard to to guess without viewing the code. (If you are not sure where are getting this error, just post the code for the on action of the button) Most of the times, we get this error whenever we are trying access a current element of a empty node.

Regards,

Siva

Answers (8)

Answers (8)

Former Member
0 Kudos

I finally solved the problem, it was that another the bapi wasn't available for the same model, I still don't know why the system didn't give a better trace than only Null Pointer, but it was it...

Thanks a lot!!!

Former Member
0 Kudos

HI

have you performed external debugging on your application to check whether the parameters you are passing

are working fine .

other thing ask your abaper to give the test data for the bapi that you have provided in the backend

and with which its working fine.

So that you can hard code the same data in the webdynpro and test the application.

Please check this , hope your problem should be solved.

Thanks

Former Member
0 Kudos

This is what I got from the log and trace of the system:

Error 07/07/2009 18:46:15:039 Exception occured during processing of Web Dynpro application local/[Project]/[Aplication]. The causing exception is nested.

[EXCEPTION]

java.lang.NullPointerException

I cannot put any debug flag because the problem is in the production system... and it is working excellent in the development and quality systems.

The dump only says java.lang.NullPointerException, no more lines.

Thanks a lot!

Former Member
0 Kudos

Hi,

Check wheter the application is deployed in your production.

You can check that in Webdynpro Contenet Admin also.

Best Wishes

Idhaya R

Former Member
0 Kudos

Hi Alejandro

Please, put logs in your aplication, in all of your method that generate the exception.

like that:

logger.errorT("Some log here");

put this in your catch block to, to get more details of your exception

Then put the logs and the code here.

We can't help you only with NullpointerException information.

Regards

Marcos

Former Member
0 Kudos

Hi,

You need to put the code written to call the RFC in a "try/catch" block and then put the debugging messages.

And after execution we can find out from where the code has gone wrong.

Thanks

Ritushree

Former Member
0 Kudos

Hi,

If possible please post the code and RFC context structure in Component Controller. And check strongly that you are passing all the mandatory fields required to execute the RFC. And debug like VJR said and check if the error is coming while modelObject()execute() or before that itself?

Regards,

Charan

Former Member
0 Kudos

Hi,

Print the debug messages after each line of code so that you will come to know where exactly the error is coming.

sample code:


try
{
wdComponentAPI.getMessageManager().reportSuccess("Debug 1");
Zcno_Rfc_Test_Input setNode = new Zcno_Rfc_Test_Input();
wdComponentAPI.getMessageManager().reportSuccess("Debug 2");
wdContext.nodeZcno_Rfc_Test_Input().bind(setNode);
wdComponentAPI.getMessageManager().reportSuccess("Debug 3");
wdContext.currentRequestZcno_Rfc_Test_InputElement().modelObject().execute();
wdComponentAPI.getMessageManager().reportSuccess("Debug 4");
}
catch(Exception e)
{
wdComponentAPI.getMessageManager().reportException("Error Message "+e.getMessage,true);
wdComponentAPI.getMessageManager().reportException("Error Cause "+e.getCause,true);
}

By seeing the how many debug messages got printed we can identify which line was throwing Null pointer exception.

Please check this and post the code..

Regards,

Jaya.

Former Member
0 Kudos

I'm downloading the trace from the server... but in the page of the error is nothing else as should be, so I don't have the stack, that's the problem :S

Former Member
0 Kudos

Hi Alejandro

Please, see in the log viewer the complete stack.

Try to debug the application to know what exactly point the error occurs.

We need more references to help you.

Regards

Marcos