You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2002/10/18 19:11:50 UTC

DO NOT REPLY [Bug 13770] New: - Xerces 2.2.0 - 1.4.4 incompatibility

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13770>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13770

Xerces 2.2.0 - 1.4.4 incompatibility

           Summary: Xerces 2.2.0 - 1.4.4 incompatibility
           Product: Xerces2-J
           Version: 2.2.0
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: DOM
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: azoldi@yahoo.com


My webapp, works fine with Tomcat 4.0.4, but it fails with Tomcat 4.1.12, with
this exception:
java.lang.NoClassDefFoundError: org/apache/xerces/framework/XMLParser

In the code DOMParser is used and is built the xerces.jar(1.4.4 I think). When I
replaced the Xerces jars (xercesImpl.jar and xmlParserAPIs.jar) that come with
Tomcat 4.1.12, found in common/endorsed dir with xerces.jar, it works fine.

After some investigation, I extracted the relevant code and constructed a simple
test case.

<code>
import java.io.InputStream;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.apache.xerces.parsers.DOMParser;


public class XercesBug {
    
    public static void main( String[] args ) {
        try {
            System.out.println( "Creating parser..." );

            DOMParser parser = new DOMParser();

            System.out.println( "Parser created." );
            System.out.println( "Calling parse..." );

            String file = "d:\\some.xml";
            parser.parse( new InputSource( new java.io.FileInputStream( file ) ) );

            System.out.println( "Done." );
        } catch( Exception e ) {
            e.printStackTrace( System.out );
        }
    }
}
</code>

I compiled the code above with jdk 1.3.1_03 and classpath contains the old
xerces.jar.
When run (I tried both jdk1.3.1_03 and jdk 1.4.0_01) with the Xerces 2.2.0 jars
(xercesImpl.jar, xmlParserAPIs.jar)in the classpath, it fails with the error I
mentioned above.

However, when compiled with jdk 1.4.0_01, it does not fail (I run again with
both jdk 1.3.1_03 and 1.4.0_01 and classpath contains xercesImpl.jar and
xmlParserAPIs.jar).

It seems to be related somehow with the Java 1.4, may be Xerces 2.2.0 was built
with jdk 1.4.

Cheers,
Arpi

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