wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes JAXP 1.1 with tomcat is giving Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "JAXP 1.1 with tomcat is giving Exception" Watch "JAXP 1.1 with tomcat is giving Exception" New topic
Author

JAXP 1.1 with tomcat is giving Exception

prathibha, ar
Greenhorn

Joined: Jun 22, 2001
Posts: 13
Hi,
I am writing the xml file reading a simple text file. This xml file is parsed through a parser using Schema Validation(XSD).
But this works fine in the command prompt. But if I call this class from a JSP it gives the following error.
I am using JAXP 1.1. parser and tomcat3.2.1 and JDK1.3.1 and SAX parser
I have placed all the recent jar files which I had in the jdk1.3.1/lib directory in the
jakarta-tomcat/lib directory.
Once I removed tomcat and installed freshly also inorder to avoid old jar files.
But still it is giving following error

Unhandled error! You might want to consider having an error page to report such
errors more gracefully
java.lang.NoSuchMethodError
at org.apache.xerces.parsers.DOMParser.startElement(DOMParser.java:1132)
at org.apache.xerces.validators.common.XMLValidator.callStartElement(XML
Validator.java:1197)
at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumen
tScanner.java:1862)
at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.disp
atch(XMLDocumentScanner.java:1005)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
canner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1035)
at org.apache.xerces.validators.common.XMLValidator.resolveSchemaGrammar
(XMLValidator.java:2728)
at org.apache.xerces.validators.common.XMLValidator.bindNamespacesToElem
entAndAttributes(XMLValidator.java:2610)
at org.apache.xerces.validators.common.XMLValidator.callStartElement(XML
Validator.java:1152)
at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumen
tScanner.java:1862)
at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.disp
atch(XMLDocumentScanner.java:1005)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
canner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1035)
at xmljava.ValidateWithSchemaJAXPmain.Validate(ValidateWithSchemaJAXPmai
n.java:72)
at xmljava.Write_XML.Write_XMLFile(Write_XML.java:79)
at jsp._0002fjsp_0002fvalidatexml_0002ejspvalidatexml_jsp_4._jspService(
_0002fjsp_0002fvalidatexml_0002ejspvalidatexml_jsp_4.java:92)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspSer
vlet.java:174)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:2
61)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.ja
va:503)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559
)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnectio
n(HttpConnectionHandler.java:160)
at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.j
ava:338)
at java.lang.Thread.run(Thread.java:484)




Can anybody help in solving this error

Thanks and Regards
prathibha
Mahendran Duraisamy
Greenhorn

Joined: Jun 27, 2001
Posts: 7
Hi,
When i look at ur error log. I see errors from Xerces or Xalan parser which is strange because u r using a different parser like JAXP1.1. The method not found exception for StartElement is the error message from the application which is looking for Xerces or Xalan parser jar files in the classpath.
U said u r using "JAXP 1.1. parser and tomcat3.2.1 and JDK1.3.1 and SAX parser " i have no idea about JAXP1.1 but what is the SAX parser ? u didn't give the name of the parser. why don't put the jar files from Xerces or Xalan in Tomcat's classpath.
Those jar files are available in www.apache.org.
Regards,
mahendran
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
As I recall, only Tomcat 4.0 can use the JAXP 1.1 package.
That error msg indicates a need for the Xerces paraser.
prathibha, ar
Greenhorn

Joined: Jun 22, 2001
Posts: 13
Hi
Thankyou for your suggestion. WE got it worked. It was becuase of xerces.jar files which was not there in the tomcat's lib directory.
prathibha
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JAXP 1.1 with tomcat is giving Exception