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 Carl Woolf <cw...@allaire.com> on 2000/07/27 20:18:52 UTC

newbie question -- samples don't work?!

Hi,

Summary: Unable to get even the first sample to work!! Help!

Just downloaded Xerces-J-1.1.2 (I know, there is a 1.1.3 that I didn't
notice yesterday, I may try that one next). Used jar to unzip, prepended
CLASSPATH with the xerces and xerces-samples jars, and tried the first,
SAXCount sample. I've pasted in stuff from my shell, please excuse the
whitespace distortion. You can see that my CLASSPATH and jdk seem to be
right. Note that at the end when I invoke java on the 'unfound' class
SAXParser, it does find it well enough to complain that there is no 'main'.

I didn't find anything germane to this problem in the archives of this
mailing list, or by searching on the Apache site.

Any help would be greatly appreciated, including pointers to existing
information that I may have missed...

-- Carl
================================================================
 
$ echo $CLASSPATH
c:\xerces\xerces-1_1_2\xerces.jar;c:\xerces\xerces-1_1_2\xercesSamples.jar;c
:/xerces/xerces-1_1_2;c:
\xerces\xerces-1_1_2\xerces.jar;c:\xerces\xerces-1_1_2\xercesSamples.jar;.;c
:\jcup;y:\tron\src;c:\we
blogic\classes;c:\tryJava;c:\tryJava\servlet.jar;c:\tryJava\activation.jar;c
:\tryJava\mail.jar;c:\tr
yJava\Jindent.jar;c:\tryJava\ejb\sample1;c:\ejipt_src;c:\
$<01:35:57 Thu Jul 27> </xerces/xerces-1_1_2>$\
$ java sax.SAXCount data/personal.xml
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:191)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:124)
        at
org.xml.sax.helpers.ParserFactory.makeParser(ParserFactory.java:129)
        at sax.SAXCount.print(SAXCount.java:127)
        at sax.SAXCount.main(SAXCount.java, Compiled Code)
$<01:36:04 Thu Jul 27> </xerces/xerces-1_1_2>$\
$ which java
C:\jdk1.2.2\bin/java.exe
$ java foobar
Exception in thread "main" java.lang.NoClassDefFoundError: foobar
$ java  org.apache.xerces.parsers.SAXParser
Exception in thread "main" java.lang.NoSuchMethodError: main

----------------------------------------------------------------
Carl Woolf                     http://www.ccs.neu.edu/home/woolf
Allaire Corporation                       http://www.allaire.com
----------------------------------------------------------------