Hi,

I'm trying to add a set of automatic validation of tests of documents being
created against a particular schema.  I'm using JBuilder 6, and I have both
Xerces 2.1.0 and dom4j 1.3 libraries set as required libraries in my
project, in that order. JBuilder later appends a bunch of its own stuff to
the classpath, but I don't see any specific jar files that I know contain
any SAX parsers.  The class being executed is called TestProductFactory,
and it extends JUnit's TestCase.  It's main method is as follows:

      public static void main (String[] args)
      {
            String[] tpfName = { TestProductFactory.class.getName() };
            System.out.println ("org.xml.sax.driver=" + System.getProperty
("org.xml.sax.driver"));
//          System.setProperty("org.xml.sax.driver",
"org.apache.xerces.parsers.SAXParser");
            junit.swingui.TestRunner.main (tpfName);
      }

The problem:  Whether I set the "default parser" using the JVM invocation
(-D) parameter, or by using the System.setProperty() call commented out
above, I get the same exception each time:

Warning: Error occurred using JAXP to load a SAXParser. Will use Aelfred
instead

com.aigtg.tgml.TgMLException: org.dom4j.DocumentException: SAX2 driver
class org.apache.xerces.parsers.SAXParser does not implement XMLReader
Nested exception: SAX2 driver class org.apache.xerces.parsers.SAXParser
does not implement XMLReader
      at
com.aigtg.tgml.ProductFactory.strategyCreate(ProductFactory.java:73)
      at
com.aigtg.tgml.TestProductFactory.testStrategyCreate(TestProductFactory.java:89)
      at java.lang.reflect.Method.invoke(Native Method)
      at junit.framework.TestCase.runTest(TestCase.java:166)
      at junit.framework.TestCase.runBare(TestCase.java:140)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:131)
      at junit.framework.TestSuite.runTest(TestSuite.java:173)
      at junit.framework.TestSuite.run(TestSuite.java:168)
      at junit.swingui.TestRunner$17.run(TestRunner.java:644)

I'm wondering if it is plain to anybody what I'm doing wrong here.  Dom4j
clearly believes that whatever version of Xerces I'm trying to use is not a
SAX2 parser, but I believe that 2.1.0 is, in fact, a SAX2 parser (and thus
implements the XMLReader interface).

BTW, the other tests in the class all execute as before, I just get this
exception.

 -------------------------------------------------------------------------- 
 Important:  This electronic mail message and any attached files contain    
 information intended for the exclusive use of the individual or entity to  
 whom it is addressed and may contain information that is proprietary,      
 privileged, confidential and/or exempt from disclosure under applicable    
 law.  If you are not the intended recipient, you are hereby notified that  
 any viewing, dissemination, distribution or copying of this communication  
 may be subject to legal restriction or sanction.  Please notify us         
 immediately of any unintended recipients and delete the original message   
 without making any copies.                                                 
 -------------------------------------------------------------------------- 






-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com - A 128-bit supercerts will
allow you to extend the highest allowed 128 bit encryption to all your 
clients even if they use browsers that are limited to 40 bit encryption. 
Get a guide here:http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0030en
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to