N
Nicolas
Hi all,
I have been developing in Java for a while now, but have never
encountered this :
In a try block, an NullPointerException is thrown. I catch it and call
printStackTrace() to display the message and mostly see the stack.
Problem : none is output in the stream. Only the message is displayed
:
java.lang.NullPointerException
My code is very common :
try{
.... // several checks on null values in this code + processing
}
catch( Exception e ){
e.printStackTrace( pw ); // pw is a PrintWriter
}
I also tried to output the stack in the standard error stream (ie
e.printStackTrace()), but I got the same result.
This is a problem, since I want to know what caused the exception.
Does anyone know what happens ?
Thanks in advance,
Nico
I have been developing in Java for a while now, but have never
encountered this :
In a try block, an NullPointerException is thrown. I catch it and call
printStackTrace() to display the message and mostly see the stack.
Problem : none is output in the stream. Only the message is displayed
:
java.lang.NullPointerException
My code is very common :
try{
.... // several checks on null values in this code + processing
}
catch( Exception e ){
e.printStackTrace( pw ); // pw is a PrintWriter
}
I also tried to output the stack in the standard error stream (ie
e.printStackTrace()), but I got the same result.
This is a problem, since I want to know what caused the exception.
Does anyone know what happens ?
Thanks in advance,
Nico