GeeCON Prague 2014*
The moose likes XML and Related Technologies and the fly likes feature not recognized for SAX driver parser.XMLReaderI 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 "feature not recognized for SAX driver parser.XMLReaderI" Watch "feature not recognized for SAX driver parser.XMLReaderI" New topic
Author

feature not recognized for SAX driver parser.XMLReaderI

john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
I run the following in Eclipse and everything is fine however when I run it somewhere else I get the error which follows the code. Is it possible that im using old jars?

import java.io.*;
import java.util.*;
import org.jdom.*;
import java.util.regex.*;
import org.jdom.xpath.*;
import org.jdom.input.*;

public class Test2 {

public static void main(String []args)
{
Test2 s = new Test2();
try
{
s.test();

}
catch(Exception e)
{
e.printStackTrace();
}
}


public void test() throws Exception
{
try
{
Document doc = null;
SAXBuilder saxBuilder =new SAXBuilder();
saxBuilder.setFeature("http://xml.org/sax/features/validation", true);
saxBuilder.setFeature("http://apache.org/xml/features/validation/schema", true);
saxBuilder.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
saxBuilder.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation","test.xsd");

doc = saxBuilder.build("test.xml");

org.jdom.JDOMException: http://apache.org/xml/features/validation/schema feature not recognized for SAX driver org.apache.crimson.parser.XMLReaderImpl
at.org.jdom.input.SAXBuilder.internalSetFeature(SaxBuilder.java:731)
at.org.jdom.input.SAXBuilder.setFeaturesAndProperties(SaxBuilder.java:670)
at.org.jdom.input.SAXBuilder..createParser(SAXBuilder.java:552)
at.org.jdom.input.SAXBuilder..build(SAXBuilder.java:426)
at.org.jdom.input.SAXBuilder..build(SAXBuilder.java:426)
.......
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12792
    
    5
Since the error mentions:

org.apache.crimson.parser.XMLReaderImpl

I think you need the crimson parser package, not the standard Java one.
According to http://xml.apache.org/ the crimson parser project is inactive.

Which version of Java SDK do you have?
Bill
john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
the crimson.jar is included
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
That is a Xerces feature, not Crimson. In other words, you need to download Xerces.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
thank you so much lasse that was the issue
 
GeeCON Prague 2014
 
subject: feature not recognized for SAX driver parser.XMLReaderI