• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

feature not recognized for SAX driver parser.XMLReaderI

 
john mattucci
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the crimson.jar is included
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is a Xerces feature, not Crimson. In other words, you need to download Xerces.
 
john mattucci
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you so much lasse that was the issue
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic