Redian新闻
>
java & XML 2 example problem
avatar
java & XML 2 example problem# Java - 爪哇娇娃
c*d
1
In "Java & XML 2" I tried to follow the example
in Chapter 3. I downloaded the parser packages from apache website but I
couldn't find the mentioned xerces.jar file instead all evidence points to
xml-apis.jar. The code compiles ok but when I tried to run it, here is the
error message:
~/source_code/java/javaxml2/ch03/src]60: java -classpath
"../../lib/xerces-2_6_2/:." javaxml2.SAXTreeViewer ../xml/contents.xml
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
at
org.x
avatar
r*u
2
try
~/source_code/java/javaxml2/ch03/src]60: java -classpath "../../lib/xerces-2_6_2/xml-apis.jar:." javaxml2.SAXTreeViewer ../xml/contents.xml
^^^^^^^^^^^

【在 c*******d 的大作中提到】
: In "Java & XML 2" I tried to follow the example
: in Chapter 3. I downloaded the parser packages from apache website but I
: couldn't find the mentioned xerces.jar file instead all evidence points to
: xml-apis.jar. The code compiles ok but when I tried to run it, here is the
: error message:
: ~/source_code/java/javaxml2/ch03/src]60: java -classpath
: "../../lib/xerces-2_6_2/:." javaxml2.SAXTreeViewer ../xml/contents.xml
: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
: at
: org.x

avatar
c*s
3
xerces-api只是API,没有完全实现,还需要有个xercesImpl
http://www.ibiblio.org/maven/xerces/jars/ 有你需要的Jar

org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:121

【在 c*******d 的大作中提到】
: In "Java & XML 2" I tried to follow the example
: in Chapter 3. I downloaded the parser packages from apache website but I
: couldn't find the mentioned xerces.jar file instead all evidence points to
: xml-apis.jar. The code compiles ok but when I tried to run it, here is the
: error message:
: ~/source_code/java/javaxml2/ch03/src]60: java -classpath
: "../../lib/xerces-2_6_2/:." javaxml2.SAXTreeViewer ../xml/contents.xml
: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
: at
: org.x

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。