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 "Michael Glavassevich (JIRA)" <xe...@xml.apache.org> on 2006/08/02 19:34:14 UTC
[jira] Resolved: (XERCESJ-1175) The Xerces implemented
SchemaFactory is not used by default when using Xerces 2.8.0 with Java 5.0
[ http://issues.apache.org/jira/browse/XERCESJ-1175?page=all ]
Michael Glavassevich resolved XERCESJ-1175.
-------------------------------------------
Resolution: Invalid
This is a bug in Java 5.0. It's trying to read META-INF/services files (the expected format for these is described here [1]) as if they were properties files. There was a similar issue with XPathFactory (see here [2]). The Apache version of the JAXP APIs doesn't have this problem and if you include it (the xml-apis.jar which accompanies Xerces) in the JDK's jre\lib\endorsed [3] directory the factory lookup mechanism will work correctly.
[1] http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Service%20Provider
[2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6202043
[3] http://java.sun.com/j2se/1.4.2/docs/guide/standards/
> The Xerces implemented SchemaFactory is not used by default when using Xerces 2.8.0 with Java 5.0
> -------------------------------------------------------------------------------------------------
>
> Key: XERCESJ-1175
> URL: http://issues.apache.org/jira/browse/XERCESJ-1175
> Project: Xerces2-J
> Issue Type: Bug
> Components: JAXP (javax.xml.validation)
> Affects Versions: 2.8.0
> Environment: Java 5.0
> Xerces 2.8.0
> Eclipse 3.2
> Reporter: Søren Gjesse
> Priority: Minor
>
> When version 2.8.0 of xercesImpl.jar is added to the Java 5.0 classpath the Xerces implementation of SchemaFactory is not used by default.
> The reason for this is that the content of the file META-INF/services/javax.xml.validation.SchemaFactory in xercesImpl.jar is
> org.apache.xerces.jaxp.validation.XMLSchemaFactory
> It should be
> http\://www.w3.org/2001/XMLSchema=org.apache.xerces.jaxp.validation.XMLSchemaFactory
> (note the escape character of the : after http) as Java 5.0 expects a SchemaFactory for each schema language in this case http\://www.w3.org/2001/XMLSchema
> When running the following with Java 5.0 and version 2.8.0 of xercesImpl.jar on the classpath
> import javax.xml.XMLConstants;
> ...
> SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
> System.out.println(factory.getClass().getName());
> the output is
> com.sun.org.apache.xerces.internal.jaxp.validation.xs.SchemaFactoryImpl
> Which is the Java 5.0 (Xerces 2.6.2 derivate) build-in SchemaFactory and not the Xerces 2.8.0 SchemaFactory.
> There are several workarrounds one is to run java with the option
> -Djavax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema=org.apache.xerces.jaxp.validation.XMLSchemaFactory
> Others are to use $java.home/lib/jaxp.properties or set the system property using System.setProperty(...). See http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/validation/SchemaFactory.html#newInstance(java.lang.String) for a description of how the SchemaFactory implementation is found.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org