The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
[Originally posted by kdeng]

Jdk 1.4.1 contains its own SAX parser, therefore, when you compile the source
of chp3, you may encounter the error of setReaderFactory() method is not

A workaround for this is to modify the build.xml to override its classpath for
compilation. In details, insert the classpath to the javac task.

<!-- First compile the source -->
<javac srcdir="src">
optimize="${c.optimize.on}" >
<pathelement path="classes"/>
<pathelement path="../lib/xerces.jar"/>


>> I have managed to create the JAR files, but I am having problems running them
>> and it is driving me crazy. When I use the build.xml file, it builds and
>> tests fine, but when I run the code, it tells me that the XMLEntityReader
>> class cannot be found. I have tried everything I can think of to get it to
>> work with no luck. I have the Xerces.jar file from the website in the antlib
>> directory, and I am using the batch files to run the code listed on Running
>> Jar Files thread. Do I have to see a CLASSPATH environment variable or
>> something else to get it to work? Any help would be greatly appreciated!

> Are you using jdk 1.4.* or have other SAX libraries on your classpath? There
> can be some class mixups because jdk 1.4 includes a SAX parser and you will be
> surprised how many other tools will put things like Xerces onto the classpath
> which can mix up Xerces versions.
import-bot (20211) [Avatar] Offline
Re: A workaround for xerces.jar problem in Chp3
[Originally posted by iain.shigeoka]

Thanks Kan.

import-bot (20211) [Avatar] Offline
Re: A workaround for xerces.jar problem in Chp3
[Originally posted by msreddy]

Thanks. This was a great help to me. In fact, I had to add this classpath
to the build.xml file in other chapters too - ch3 to ch8.