I have an intermittent error from a null pointer in a generated SOAP serializer classes. Despite the warning posted at the top of the source, I went ahead and edited the class, recompiled, massaged it into my EAR and redeployed. I can see the stack traces that incriminate the null pointer for the times when it does occur (and it doesn't always), but I can't use Log4j, System.out, or even throwing new Error() to get any details about what exactly is null those times when the failure occurs.
The application runs on SunONE Java System App Server v72004Q2. Anyone have any ideas how I can get the details out when the error occurs? The stack traces don't show what was null, just a series of exceptions.
I guess the way I'd do this is log the SOAP messages being serialised/deserialised and compare them to the ones that throw exceptions. One way of doing this is to add a JAX-RPC handler to one end of the service that simply logs the messages, though I imagine you have a mechanism already in place.
If you were lucky, it'd only be throwing NPEs where your XML Schema says the field is mandatory...but it ain't guaranteed =\
I guess the answer is that I don't know of a JAX-RPC-specific way of doing this. I've found Sun's tools to have attrocious error reporting, the sort of thing you've described is typical of this - the information you *really* want just ain't there. My favourite error (which came out of Sun's wscompile utility) is "error: generator error: internal error (should not happen): tie.generator.002"