You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by De...@emc.com on 2004/02/11 09:18:36 UTC

Using Xerces2-J through JAXP without xml-apis.jar?

Hello,

Our application uses both SAX and DOM to parse XML streams. My current setup
is that I rely on the standard XML-apis that come with JDK 1.4.x and only
have the xercesImpl.jar in my normal classpath. This seems to work fine for
parsing the SAX way, but fails when parsing DOM. When instantiating the
Xerces JAXP DocumentBuilderFactory, it seems to refer to some DOM Level2
Ranges extension. Is there any version of Xerces2-J that has a clear split
between the DOM Level2 core and the extensions? I ask this since adding the
xml-apis.jar to the JDK 1.4 endorsed API folder is beyond my control.
Relying on Crimson is not an option since this one has a bug in DOCTYPE
declarations with relative URLs.


java.lang.NoClassDefFoundError: org/w3c/dom/ranges/DocumentRange
	at java.lang.ClassLoader.defineClass0(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
	at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
	at java.lang.ClassLoader.defineClass0(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
	at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
	at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source)
	at
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown
Source)


Ringo


limitation of xerces on xml schema?

Posted by Lingzhi Zhang <lz...@cse.ogi.edu>.
Hi,

I am wondering whether Xerces supports the "any attributes with non-schema
namespace" defined with the components. If it dosen't, is there any java
parser which can do it?

Thanks.

Lingzhi



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


Re: Using Xerces2-J through JAXP without xml-apis.jar?

Posted by Simon Kitching <si...@ecnetwork.co.nz>.
On Wed, 2004-02-11 at 21:18, DeSmet_Ringo@emc.com wrote:
> Hello,
> 
> Our application uses both SAX and DOM to parse XML streams. My current setup
> is that I rely on the standard XML-apis that come with JDK 1.4.x and only
> have the xercesImpl.jar in my normal classpath. This seems to work fine for
> parsing the SAX way, but fails when parsing DOM. When instantiating the
> Xerces JAXP DocumentBuilderFactory, it seems to refer to some DOM Level2
> Ranges extension. Is there any version of Xerces2-J that has a clear split
> between the DOM Level2 core and the extensions? I ask this since adding the
> xml-apis.jar to the JDK 1.4 endorsed API folder is beyond my control.
> Relying on Crimson is not an option since this one has a bug in DOCTYPE
> declarations with relative URLs.

I have always thought that putting stuff in the global JDK 1.4 endorsed
directory is a very ugly thing to do, as it affects the behaviour of
every application using that JDK.

It is much nicer to used the "endorsed override" mechanism. This is
per-app, and also doesn't need ROOT access (or "admin" for you windows
types).

This option to the JVM:
  java -Djava.endorsed.dirs=${overrides} .....
will cause any libs in the specified overrides directory to override
stuff in the JDK.

Just put xerces/xalan/xml-apis etc in a dir and use the above option to
point to that dir.

Hope this solves your problem..

Regards,

Simon


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