You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Roytman, Alex" <ro...@peacetech.com> on 2000/11/21 07:15:10 UTC

FW: SAXParser Validator Errors when running from multiple threads : [E rror] Datatypevalidator for attribute descr not found in element typ e typ e

I forward this message to xalan list because I've read you have been having
some threading problems with Xerces

-----Original Message-----
From: Roytman, Alex [mailto:roytmana@peacetech.com]
Sent: Tuesday, November 21, 2000 1:13 AM
To: 'xerces-j-dev@xml.apache.org'
Subject: SAXParser Validator Errors when running from multiple threads:
[E rror] Datatypevalidator for attribute descr not found in element type
typ e


another problem is bunch of error messages when parsing a document with
VALIDATION ON from multiple threads

[Error] Datatypevalidator for attribute descr not found in element type type

[Error] Datatypevalidator for attribute column not found in element type
element 
[Error] Datatypevalidator for attribute column not found in element type
element 
[Error] Datatypevalidator for attribute column not found in element type
element

No problems when VALIDATION OFF or if I span only one test thread

import org.w3c.dom.Document;
import org.apache.xerces.parsers.DOMParser;
import org.apache.xerces.parsers.SAXParser;

public class Test {
  public static final Object syncObj = new Object();

  public static void main(String[] args) {
    for (int i = 0; i < 8; i++) {
      new SaxThread().start();
    }
  }

  public static class SaxThread extends Thread {
     public void run() {
      for (int i = 0; i < 50; i++) {
        try {
          DOMParser parser;
          synchronized(syncObj) {
            parser = new DOMParser();
          }

 
parser.setFeature("http://apache.org/xml/features/continue-after-fatal-error
", false);
 
parser.setFeature("http://apache.org/xml/features/validation/warn-on-undecla
red-elemdef", true);
          parser.setFeature("http://xml.org/sax/features/validation", true);
 
parser.setFeature("http://apache.org/xml/features/validation/dynamic",
false);
          parser.setFeature("http://xml.org/sax/features/namespaces",
false);
 
parser.setFeature("http://apache.org/xml/features/dom/create-entity-ref-node
s", false);
 
parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion",
false);
 
parser.setFeature("http://apache.org/xml/features/dom/include-ignorable-whit
espace", false);
 
parser.parse("file:/Z:/Projects/Gao/gwiz/web/gwiz/WEB-INF/xmap/eng.xml");

        } catch (Exception ex) {
          ex.printStackTrace();
        }
      }
      System.out.println("\nDONE " + this);
    }
  }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org