Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JAR Files Required to Run dom\Counter.java
What JAR files are required to run dom\Counter.java provided in the Apache Xerces package?
✍: FYIcenter
You can follow this toturial to find out what JAR files are required
to run dom\Counter.java provided in the Apache Xerces package.
1. Create an XML file in the \fyicenter\xerces-2_11_0\ folder:
\fyicenter\xerces-2_11_0\samples>type User.xml <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!-- Copyright (c) 2017 FYIcenter.com --> <User> <ID>101</ID> <BirthDate>1970-01-01+00:01</BirthDate> <Name>Frank Y. Ivy</Name> <Sex> Male</Sex> </User>
2. Compile the dom\Counter.java and run it. Execution fails with missing dom.wrappers.Xerces class:
\fyicenter\xerces-2_11_0\samples>\fyicenter\jdk-1.8.0\bin\javac dom\Counter.java \fyicenter\xerces-2_11_0\samples>\fyicenter\jdk-1.8.0\bin\java -cp . dom.Counter User.xml error: Unable to instantiate parser (dom.wrappers.Xerces)
3. Run it again with xercesSamples.jar. Execution fails with missing org.apache.xerces.parsers.DOMParser class:
\fyicenter\xerces-2_11_0\samples>\fyicenter\jdk-1.8.0\bin\java -cp .;..\xercesSamples.jar dom.Counter User.xml Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xerces/parsers/DOMParser at dom.wrappers.Xerces.<init>(Unknown Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.Class.newInstance(Class.java:442) at dom.Counter.main(Counter.java:372) Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.DOMParser
4. Run it again with xercesImpl.jar added. Execution fails with missing org.w3c.dom.ElementTraversal class:
\fyicenter\xerces-2_11_0\samples>\fyicenter\jdk-1.8.0\bin\java -cp .;..\xercesSamples.jar;..\xercesImpl.jar dom.Counter User.xml Exception in thread "main" java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.apache.xerces.parsers.AbstractDOMParser.startDocument(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source) at org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at dom.wrappers.Xerces.parse(Unknown Source) at dom.Counter.main(Counter.java:447) Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
4. Run it again with xml-apis.jar added. Execution goes well now.
\fyicenter\xerces-2_11_0\samples>\fyicenter\jdk-1.8.0\bin\java -cp .;..\xercesSamples.jar;..\xercesImpl.jar;..\xml-apis.jar dom.Counter User.xml User.xml: 162;9;0 ms (5 elems, 0 attrs, 0 spaces, 58 chars)
3 JAR files are needed to run dom.Counter: xercesSamples.jar, xercesImpl.jar, and xml-apis.jar.
⇒ dom\Writer.java - Apache Xerves DOM Sample
⇐ dom\Counter.java - Apache Xerves DOM Sample
2017-12-04, 19596🔥, 0💬
Popular Posts:
JDK 11 java.desktop.jmod is the JMOD file for JDK 11 Desktop module. JDK 11 Desktop module compiled ...
What Is poi-contrib-3.5.jar? poi-contrib-3.5.jar is one of the JAR files for Apache POI 3.5, which p...
jlGui is a music player for the Java platform. It is based on Java Sound 1.0 (i.e. JDK 1.3+). It sup...
Commons DBCP provides Database Connection Pooling. JAR File Size and Download Location: File name: c...
commons-fileupload-1.3.3 -sources.jaris the source JAR file for Apache Commons FileUpload 1.3., whic...