hello,
I came across the same problem recently, I guess.
I think, You have to use endorsed jar files = You have to make a folder called "endorsed" below <Your JDK home>\jre\lib and You have to put the dom jars there:
- dom3-xml-apis.jar
- and dom3-xercesImpl.jar, as well!
See below!
Kind regards,
Csaba Szucs
| "Peter B. West" <[EMAIL PROTECTED]>
01/03/2005 04:04 PM
|
To: [EMAIL PROTECTED] cc: (bcc: Csaba Szucs/ve/eu/au/cag) Subject: Problems running example DOM3 parser creation |
Following the example, on the Programming with DOM page, for creating a
DOM3 LS parser, I get a
ClassCastException: org.apache.xerces.dom.DOMImplementationSourceImpl
at org.w3c.dom.bootstrap.DOMImplementationRegistry.newInstance(
DOMImplementationRegistry.java:144)
i.e. at
DOMImplementationSource source =
(DOMImplementationSource) sourceClass.newInstance();
The code, taken from the example, is
DOMImplementationRegistry registry = null;
System.setProperty(DOMImplementationRegistry.PROPERTY,
"org.apache.xerces.dom.DOMImplementationSourceImpl");
try {
registry = DOMImplementationRegistry.newInstance();
} catch (Exception e) {
throw new RuntimeException(e);
}
Any idea what I'm doing wrong?
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Title: Endorsed Standards Override Mechanism
IntroductionAn endorsed standard is a JavaTM API defined through a standards process other than the Java Community ProcessSM (JCPSM). Because endorsed standards are defined outside the JCP, it is anticipated that such standards may be revised between releases of the Java 2 Platform. In order to take advantage of new revisions to endorsed standards, developers and software vendors may use the Endorsed Standards Override Mechanism to provide newer versions of an endorsed standard than those included in the Java 2 Platform as released by Sun Microsystems. Endorsed Standards Classes DeploymentClasses implementing newer versions of endorsed standards should be placed in JAR files. The system property java.endorsed.dirs specifies one or more directories that the Java runtime environment will search for such JAR files. If more than one directory path is specified by java.endorsed.dirs, they must be separated by File.pathSeparatorChar. If no value is set for java.endorsed.dirs, then Sun Microsystem's implementation of the Java 2 Platform looks for JAR files in a default standard location:Here <java-home> refers to the directory where the runtime software is installed (which is the top-level directory of the Java 2 Runtime Environment or the jre directory in the Java 2 SDK).<java-home>\lib\endorsed [Microsoft Windows] <java-home>/lib/endorsed [Solaris or Linux]
|
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
