Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAXP 1.1 with tomcat is giving Exception

 
prathibha, ar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic