I'm getting an exception when I send a doPost to my servlet... I think it has something to do with the container
because I keep getting the exception at line 101 even if add whitespace(so the exception should be at line 102 etc...). I think the server is running an older version or something... I included the stack trace and the relevent info but to be honest I don't think thats the problem
Please help this is a huge headache
LoginDoc = "<?xml version="1.0" encoding="UTF-8"?> <newUser><username>username</username><password>pass</password><email>
mail@mail.com</email><firstName>chris</firstName><lastName>bo</lastName></newUser>";
Line 100: Node newUserNode = loginDoc.selectSingleNode("//newUser");
Line 101: logger.info((newUserNode.selectSingleNode("/username").getText()));
STACK TRACE:
SEVERE: Servlet.service() for servlet TestServlet threw exception
java.lang.NullPointerException
at com.borodic.TestServlet.doPost(TestServlet.java:101)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:613)