on ‎2009 May 14 8:16 AM
Hi All,
Can Any one tell me abt java.lang.NullPointerException.
when we will get this type of error and how to solve this.
if we get this error where we have to check the error.
Request clarification before answering.
Hi Sreelakshmi,
You get a Null Pointer Exception, when you are trying to use (not just read , but use) an object which has null value ( eg: when you try to invoke a function on a null object). It is something like, there is no object created on the heap, but still you are trying to invoke a method using this non-existent object.
Below are some ways of seeing the details of this exception:
1. Wrap your code in a try- catch block. In the catch block write the code :
try{......[code]....... }
catch(Exception e) {
e.printStackTrace();
wdComponentAPI.getMessageManager().reportException(e.getMessage());
}
This will display the exception on the screen.
2. If you are unable to see the exception, then go to:
http://[server-name]:[port-no]/nwa -> Problem Management -> Logs and Traces -> Log Viewer -> Show: General View and Select View as "Default Trace (Java)".
Hope this helps.
Regards,
Gaurav.
Edited by: Gaurav Narkar on May 14, 2009 9:39 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.