Re: Xml doc = dom.parseString(request.getReader());



On Sep 24, 5:36 am, gert <gert.cuyk...@xxxxxxxxx> wrote:
On Sep 24, 5:34 am, Daniel Pitts <googlegrou...@xxxxxxxxxxxxx> wrote:



On Sep 23, 8:05 pm, gert <gert.cuyk...@xxxxxxxxx> wrote:

On Sep 24, 4:31 am, Daniel Pitts <googlegrou...@xxxxxxxxxxxxx> wrote:

On Sep 23, 6:05 pm, gert <gert.cuyk...@xxxxxxxxx> wrote:

On Sep 24, 2:46 am, gert <gert.cuyk...@xxxxxxxxx> wrote:

I get a java.lang.NullPointerException when i do this ?

try {doc = parser.parse(xmlText);}
catch (SAXException ex){out.println(" <error>"+ex+"</error>\n");}

Debugger or compiler doesn't give me any warnings or anything ?

Why do i always get a 500 response ?

try {doc = parser.parse(new InputSource(in));}
catch (SAXException ex){out.println(" <error>"+ex+"</error>\n");}

deployed with moduleid = www
StandardWrapperValve[query]: PWC1406: Servlet.service() for servlet
query threw exception
java.lang.NullPointerException
at query.doPost(query.java:37)

What is on line 37 of query.java?

BTW, Class names (and therefor .java files) should always start with a
capitol case letter. "Query" would then be appropriate.

Make sure that "parser" is an actual value, and not just null. You
need to get it from the
DocumentBuilderFactory().newInstance().newDocumentBuilder()

Here is the source code.http://appwsgi.googlecode.com/svn/trunk/java/query.java
Feel free to give allot of suggestions :)

NullPointerException refers to,
doc = parser.parse(new InputSource(in));

Add somewhere:
parser = DocumentBuilderFactory().newInstance().newDocumentBuilder()

import javax.xml.parsers.*;

DocumentBuilder parser = null;
parser = DocumentBuilderFactory().newInstance().newDocumentBuilder();

I am sorry i must misunderstand something because the compiler doesn't
like it telling me it cant find the symbols.

I'm sorry, I had a typo. I added a spurious "()"
Try this: DocumentBuilderFactory.newInstance().newDocumentBuilder()

Also, try using you own discretion when copying peoples examples. You
aren't going to be successful as a programmer unless you can figure
things out on your own.

.



Relevant Pages

  • Re: question about SQL Parser
    ... query I send it. ... The parser currently won't break on foo.bar syntax but can't handle foo.bar.baz, that wouldn't be too hard to add. ... For Data Definition Language (DDL), you should check out SQL::Translator, it is much more complete for DDL. ... At the moment your best option may be wrapping the parsing in an eval and creating two output files - one of successfully parsed statements and one of statements that couldn't be parsed. ...
    (perl.dbi.users)
  • Re: Look ups with multiple parameters
    ... Yes, the query is defined with two parameters, that's why if i send one ... However, if i send two parameters, the parser finds an error as i said. ... Please check the definition of the lookup again. ... You may also consider using explicit casting of data types to e.g. a ...
    (microsoft.public.sqlserver.dts)
  • Re: "Order by" clause
    ... While there is no actual ambiguity, the parser is not so sure. ... explicitly as the first column and once again in the *. ... parser does not try to figure out the meaning of the query. ...
    (microsoft.public.sqlserver.mseq)
  • Re: Xml doc = dom.parseString(request.getReader());
    ... capitol case letter. ... "Query" would then be appropriate. ... Feel free to give allot of suggestions:) ... parser = DocumentBuilderFactory.newInstance.newDocumentBuilder ...
    (comp.lang.java.programmer)
  • Re: Different query plans for view and view definition statement
    ... A VIEW is handled two ways in SQL. ... into the query that uses it and then the parser and optimizer handle it ... as if the query had been written with a derived table. ... Trust in the optimizer, Luke. ...
    (comp.databases.ms-sqlserver)