Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6338444
Votes 3
Synopsis CCE from org.apache.xerces.parsers.SAXParser.<init> in b56
Category jaxp:other
Reported Against b56
Release Fixed mustang(b61)
State 10-Fix Delivered, bug
Priority: 2-High
Related Bugs
Submit Date 18-OCT-2005
Description
Mustang b56 introduced the file META-INF/services/org. customer .xerces.xni.parser.XMLParserConfiguration in jre/lib/resources.jar with contents:

---%<---
com.sun.org. customer .xerces.internal.parsers.XIncludeAwareParserConfiguration
---%<---

This is illegal because the named class does *not* implement the named interface. Rather, if anything it implements something under com.sun.**. The change causes applications using a downloaded copy of Xerces to fail:

---%<---
import org. customer .xerces.parsers.SAXParser;
public class Main {
    public static void main(String[] args) {
        //System.setProperty("org. customer .xerces.xni.parser.XMLParserConfiguration", "org. customer .xerces.parsers.XML11Configuration");
        new SAXParser();
        System.out.println("OK");
    }
}
---%<---

produces (on my Fedora Core 4 Linux)

---%<---
$ java -showversion -cp .:xerces-2.6.2.jar Main
java version "1.6.0-ea"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-ea-b55)
Java HotSpot(TM) Client VM (build 1.6.0-ea-b55, mixed mode, sharing)

OK
---%<---
$ java -showversion -cp .:xerces-2.6.2.jar Main
java version "1.6.0-ea"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-ea-b56)
Java HotSpot(TM) Client VM (build 1.6.0-ea-b56, mixed mode, sharing)

Exception in thread "main" java.lang.ClassCastException: com.sun.org. customer .xerces.internal.parsers.XIncludeAwareParserConfiguration cannot be cast to org. customer .xerces.xni.parser.XMLParserConfiguration
	at org. customer .xerces.parsers.SAXParser.<init>(Unknown Source)
	at org. customer .xerces.parsers.SAXParser.<init>(Unknown Source)
	at Main.main(Main.java:5)
---%<---
Posted Date : 2005-10-18 19:21:58.0
Work Around
If you uncomment the call to System.setProperty in the test case, it is OK. That is because we are asking ObjectFactory's search mechanism to use an explicit impl of this interface (in fact, the same as the fallback impl).
Evaluation
This bug was fixed. Files under META-INF/services have been removed.
Posted Date : 2005-12-08 16:27:47.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang