aspose file tools*
The moose likes Servlets and the fly likes What does this error mean?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "What does this error mean??" Watch "What does this error mean??" New topic
Author

What does this error mean??

fiza jay
Greenhorn

Joined: Apr 09, 2003
Posts: 10
Im doin jsp using Tomcat4.1 and j2sdk1.4.1_02.. When i try to add a record, it will display this error:
org.apache.jasper.JasperException: Adding text to an XML document must not be null
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Unknown Source)

root cause
java.lang.IllegalArgumentException: Adding text to an XML document must not be null
at org.dom4j.DocumentFactory.createText(DocumentFactory.java:136)
at org.dom4j.tree.AbstractElement.addText(AbstractElement.java:740)
at org.apache.jsp.SaveStaff_jsp._jspService(SaveStaff_jsp.java:83)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Unknown Source)
What does it mean ??? Is there sth wrong wif my classpath???
Juanjo Bazan
Ranch Hand

Joined: Feb 04, 2002
Posts: 231
It seems you are dealing with a null value somewhere in your SaveStaff.jsp
What are you trying to do there?
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Apparently the record that you are trying to add is "empty" or null.
jayiza,
Please change your name to be compliant with JavaRanch's naming policy. It should not be obviously fictitious.
Your displayed name should be 2 separate names with more than 1 letter each. We really would prefer that you use your REAL name.
You can change your name: here.
Thanks,
Cindy


"JavaRanch, where the deer and the Certified play" - David O'Meara
fiza jay
Greenhorn

Joined: Apr 09, 2003
Posts: 10
This is my code for SaveStaff.jsp.. Im trying to add a record using XML database and Jsp..
%@ page import="java.io.File,
org.dom4j.Document,
org.dom4j.Element,
org.dom4j.io.SAXReader" %>
lt%
// get the parameters:
int id = 0;
try
{
id = Integer.parseInt( request.getParameter("id") );
} catch ( NumberFormatException ne ) {}
String name = request.getParameter("name");
String school = request.getParameter("school");
String centre = request.getParameter("centre");
String staffcategory = request.getParameter("staffcategory");
String staffinvolvement = request.getParameter("staffinvolvement");
String areasofresearch = request.getParameter("areasofresearch");
String qualifications = request.getParameter("qualifications");
String citizenship = request.getParameter("citizenship");
String staffparticulars = request.getParameter("staffparticulars");
// parse the document:
SAXReader reader = new SAXReader();
String path = application.getRealPath("/ViewStaff_list.xml");
Document doc = reader.read( new File(path) );
if ( id == 0 )

{
// if we have a new project then we generate the id by
// adding 1 to the ID of the last node:
java.util.List list = doc.selectNodes( "//staff-list/staff" );
org.dom4j.Node lastStaff = (org.dom4j.Node) list.get( list.size()-1 );
id = Integer.parseInt( lastStaff.valueOf("@id") ) + 1;
// create the new element
Element newStaff = doc.getRootElement().addElement( "staff" )
.addAttribute( "id", Integer.toString(id) );
newStaff.addElement("name").addText(name);
newStaff.addElement("school").addText(school);
newStaff.addElement("centre").addText(centre);
newStaff.addElement("staffcategory").addText(staffcategory);
newStaff.addElement("staffinvolvement").addText(staffinvolvement);
newStaff.addElement("areasofresearch").addText(areasofresearch);
newStaff.addElement("qualifications").addText(qualifications);
newStaff.addElement("citizenship").addText(citizenship);
newStaff.addElement("staffparticulars").addText(staffparticulars);

}

else
{
// we locate the project that we are going to modify
Element staff = (Element) doc.selectSingleNode( "//staff-list/staff[@id=" + id + "]" );
// and then we modify the values
staff.selectSingleNode( "name" ).setText(name);
staff.selectSingleNode( "school" ).setText(school);
staff.selectSingleNode( "centre" ).setText(centre);
staff.selectSingleNode( "staffcategory" ).setText(staffcategory);
staff.selectSingleNode( "staffinvolvement" ).setText(staffinvolvement);
staff.selectSingleNode( "areasofresearch" ).setText(areasofresearch);
staff.selectSingleNode( "qualifications" ).setText(qualifications);
staff.selectSingleNode( "citizenship" ).setText(citizenship);
staff.selectSingleNode( "staffparticulars" ).setText(staffparticulars);
}
// write the file:
java.io.FileWriter output = new java.io.FileWriter( path );
doc.write( output );
output.close();
%>
Juanjo Bazan
Ranch Hand

Joined: Feb 04, 2002
Posts: 231
One of the parameters(name, school,...,staffpsrticulars) you are pretending to add is null.
Before trying to add them, check if they are null:

HTH
fiza jay
Greenhorn

Joined: Apr 09, 2003
Posts: 10
Now, my error came out at as dis when i try to save my add records:
java.lang.NullPointerException
at org.apache.jsp.SaveProj_jsp._jspService(SaveProj_jsp.java:102)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)
What does dis mean??
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What does this error mean??
 
Similar Threads
JasperException: For input string: ""
admin page
Error in JSP
DynaActionForm - Exception creating bean
jasperException: oracle.jdbc.driver. OracleDriver