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: 4624775
Votes 1
Synopsis rt.jar should not contain xalan/xerces
Category jaxp:other
Reported Against merlin-beta3
Release Fixed
State 11-Closed, Not a Defect, bug
Priority: 4-Low
Related Bugs 4615582
Submit Date 17-JAN-2002
Description




FULL PRODUCT VERSION :
java version "1.4.0-beta3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b84)
Java HotSpot(TM) Client VM (build 1.4.0-beta3-b84, mixed mode)


FULL OPERATING SYSTEM VERSION :

 customer  Windows 2000 [Version 5.00.2195]

ADDITIONAL OPERATING SYSTEMS :

SP2 installed.


A DESCRIPTION OF THE PROBLEM :
Xalan and Xerces appear to be embedded in rt.jar.

Other bugs (eg 4593175 and 4615582 are about problems
already caused by this), but this bug report is about the
generic "wrong-headedness" (in my view) of this approach.

Surely Xalan and Xerces (possibly in cut down form to
include only the implementations, not the W3C interfaces
which are already within rt.jar) would be more
appropriately placed individually within the extensions
directory. They would then be easily replaceable as bug-
fixes and enhancements are made available.


REGRESSION.  Last worked in version 1.3.1

This bug can be reproduced always.

CUSTOMER WORKAROUND :
According to another bug, placing a different xalan.jar
(and presumably xerces.jar) in the lib directory should
work, and I'm sure changing the bootclasspath would work -
however, I don't believe either of these are as pleasant as
having a jar file already present in the lib/ext directory
and allowing that to be replaced.
(Review ID: 138187) 
======================================================================


  xxxxx@xxxxx   2002- customer -07

This EOU is out of our scope. Can someone from Jdk 1.4.0 comment on this?

Please change the category & subcategory of it.
Work Around
N/A
Evaluation
See the Endorsed Standards Mechanism in the JDK 1.4 documentation.

That document lists the Endorsed Standards API packages that can be replaced in JDK 1.4.  Since it does not make sense to allow APIs to be updated w/o updating the implementation for those API packages, implementations may also be updated.  Those implementations can be in any package, however, so the JVM does not check for package names.
  xxxxx@xxxxx   2002-02-08
Comments
  
  Include a link with my name & email   

Submitted On 23-JAN-2002
jskeet
Is this what the Endorsed Standards mechanism is for?
(http://java.sun.com/j2se/1.4/docs/guide/standards/index.htm
l)

It's unclear whether it's there to allow people to upgrade 
the interfaces themselves (as listed) or the 
implementations of those interfaces.


Submitted On 06-FEB-2002
aw
Even if xalan/xerces were put in the extensions directory, 
that doesn't help. I would need to tweak my customers JRE 
installation, and doing that might break other Java 
applications they run.

I think Sun should use different package names for the 
org.apache stuff to isolate it from the version of the APIs 
that an application is using - all Sun implementation 
detail classes should be in com.sun.* or sun.* packages. 
The org.apache packages aren't a documented public API or 
endorsed standard in JDK1.4, so if I want to use something 
like org.apache.xpath.XPath in my app, I have to ship my 
own xalan.jar - I can't rely on the implementation in the 
JDK since it is an internal implementation detail.

If I ship my own xalan.jar, and force the JDK to use it 
(via -Xbootclasspath/p: or whatever), then I am replacing 
JDKs internal implementation with one it has not been 
tested with.


Here is a simple testcase that works under JDK1.3 with 
xalan/xerces, but fails to run under JDK1.4 with this 
exception:

Exception in thread "main" java.lang.NoSuchMethodError: 
org.apache.xpath.objects.XObject.mutableNodeset()
Lorg/apache/xpath/NodeSet;
        at XTest.main(XTest.java:24)

I assume this is because rt.jar contains older xalan/xerces 
implementations.

import java.io.FileInputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.xml.utils.PrefixResolverDefault;
import org.apache.xpath.NodeSet;
import org.apache.xpath.XPath;
import org.apache.xpath.XPathContext;
import org.apache.xpath.objects.XObject;
import org.w3c.dom.Document;

public class XTest {
	public static void main(String args[]) throws 
Exception {
		if (args.length != 2) {
			System.err.println("Usage: XTest 
<xml-file> <xpath-expr>");
			System.exit(1);
		}

		DocumentBuilder db = 
DocumentBuilderFactory.newInstance().newDocumentBuilder();
		Document document = db.parse(new 
FileInputStream(args[0]));

		PrefixResolverDefault resolver = new 
PrefixResolverDefault(document);
		XPath xp = new XPath(args[1], null, 
resolver, XPath.SELECT, null);
		XObject xo = xp.execute(new XPathContext(), 
document, resolver);
		NodeSet ns = xo.mutableNodeset();

		System.out.println(ns.getLength());
	}
}


Submitted On 15-FEB-2002
poelsgeert
The Xbootclasspath option worked for me but it remains 
weird why they didn't use the extensions for this.
Including external libraries still in full development and 
undergoing major rewrites is very odd to say the least.
IMHO, I wouldn't mind even Sun libs to be remain separated 
and upgradable through this mechanism.


Submitted On 02-JUL-2002
plexusnexus
This is clearly a bug and a flub under the aspect of
configuration management.


Submitted On 14-JUL-2003
Eddy-CA
This is stupid and the endorsed thing is just a stupid way to 
get around this mispackaging.

This should be considered as a bug and the fix should come in 
the next release.



PLEASE NOTE: JDK6 is formerly known as Project Mustang