• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

feature not recognized for SAX driver parser.XMLReaderI

 
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
.......
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the crimson.jar is included
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you so much lasse that was the issue
 
Tomorrow is the first day of the new metric calendar. Comfort me tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic