Re: Xml doc = dom.parseString(request.getReader());
gert wrote:
I get a java.lang.NullPointerException when i do this ?
...
Add somewhere:
parser = DocumentBuilderFactory().newInstance().newDocumentBuilder()
..
parser = DocumentBuilderFactory().newInstance().newDocumentBuilder();
"I think what Mr. Pitts* meant to say was.."
parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
However, when code is breaking, it is best to break it
down to the simnplest units possible. For that reason,
I would change that single line to.
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
System.out.println("factory: " + factory);
parser = factory.newDocumentBuilder();
System.out.println("parser: " + parser);
...
I am sorry i must misunderstand something because the compiler doesn't
like it telling me it cant find the symbols.
It would be mighty useful to you if you figure how
to read those exceptions, and always copy/paste
any you do not understand.
But ultimately, I agree with Lew's suggestion of
preparing an SSCCE. You will get more help
from an SSCCE short enough to post to the
group, than either posting code snippets, or
linking to a 'problemsource.zip'.
* Said in the tone of a spokesperson/spin doctor,
rather than anyone's mum.
--
Andrew Thompson
http://www.athompson.info/andrew/
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-general/200709/1