• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

xerces SAX2 parser giving error

Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following very basic Java code -
import org.xml.sax.*;
import org.xml.sax.helpers.*;
public class BasicSAXExample
public static void main(String[] args)
XMLReader producer;
producer = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");

catch(Exception e)
This code gets compiled fine. When I run it, I get the following run time error stack trace -
Exception in thread "main" java.lang.VerifyError: (class: org/apache/xerces/validators/common/XMLValidator, method: resolveSchemaGrammar signature: (Ljava/lang/
String;Ljava/lang/String V) Incompatible object argument for function call
at org.apache.xerces.framework.XMLParser.<init>(XMLParser.java:213)
at org.apache.xerces.framework.XMLParser.<init>(XMLParser.java:205)
at org.apache.xerces.parsers.SAXParser.<init>(SAXParser.java:164)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:306)
at java.lang.Class.newInstance(Class.java:259)
at org.xml.sax.helpers.NewInstance.newInstance(NewInstance.java:44)
at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:119)
at BasicSAXExample.main(BasicSAXExample.java:19)
I have the xerces.jar in the classpath.
Any ideas what's wrong ?
    Bookmark Topic Watch Topic
  • New Topic