|
Could someone please help me through a simple
problem with running the Xerces samples. This appears to be a problem in
CLASSPATH but I can't for the life of me see what the problem is. I'm sure
I'll feel foolish when the solution is pointed out. I need to get this
fixed because I need to use these classes.
I am running the DOMCounter sample on Win2000 and
this is the error I get:
C:\xerces-1_0_3>java dom.DOMCount
data\personal.xml
Symantec Java! JustInTime Compiler Version 4.00.006(x) for JDK 1.2 (Symantec GC) Copyright (C) 1996-99 Symantec
Corporation
Exception in thread "main"
java.lang.NoClassDefFoundError: dom/DOMCount
1. The steps I took in following the instructions were to create a batch file. Actually I created two to separate the CLASSPATH settings from the running, because rerunning just keeps adding to the CLASSPATH. This batch file called setpath.bat: set
classpath=c:\xerces-1_0_3\xerces.jar;%CLASSPATH%
set classpath=c:\xerces-1_0_3\xercesSamples.jar;%CLASSPATH% Please note that the documentation failed to
include the .jar extension on the end of the xercesSamples so I added it.
I did try it both ways though to no avail.
2. the run batch was domc.bat:
cd c:\xerces-1_0_3
java dom.DOMCount data\personal.xml 3. My base directory looked like the
following:
C:\xerces-1_0_3>dir
Volume in drive C has no label. Volume Serial Number is FCBD-C2A8 Directory of C:\xerces-1_0_3
03/24/2000
12:44a
<DIR>
.
03/24/2000 12:44a <DIR> .. 03/24/2000 12:40a <DIR> data 03/24/2000 12:40a <DIR> docs 03/24/2000 12:42a 57 domc.bat 03/24/2000 12:44a 2,775 email.txt 03/08/2000 03:25p 2,749 LICENSE 03/08/2000 03:18p 492 Readme.html 03/24/2000 12:42a 119 setpath.bat 03/08/2000 03:18p 1,190,776 xerces.jar 03/08/2000 03:18p 179,729 xercesSamples.jar 7 File(s) 1,376,697 bytes 4 Dir(s) 2,716,066,304 bytes free 4. my CLASSPATH looks like this: C:\xerces-1_0_3>set
classpath
CLASSPATH=c:\xerces-1_0_3\xercesSamples.jar; c:\xerces-1_0_3\xerces.jar;.;c:\VisualCafe\Java2\src.jar; C:\orant\LITE\CLASSES\OLITE35.JAR 5. the content of xercesSamples.jar include the
following:
C:\xerces-1_0_3>jar tf
xercesSamples.jar
Symantec Java! JustInTime Compiler Version 4.00.006(x) for JDK 1.2 (Symantec GC) Copyright (C) 1996-99 Symantec
Corporation
META-INF/MANIFEST.MF
Xerces_Ver_1_0_3.info dom/ dom/DOMAddLines.class dom/DOMCount.class dom/DOMFilter.class 6. I can't see any reason that the class
loader can't find dom/DOMCount as it is right there in the jar file. Can
someone please point out my foolish error?
Thanks,
Steve Bollinger |
