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
#1
[Originally posted by jkw888]

Hi, I enjoyed your book very much. But do need some help to build the code. I
am keeping getting the build failed message. Here is the message:
--------------------------------------------------------------------------------
C:jimchp3>ant
Buildfile: build.xml

compile:
[mkdir] Created dir: C:jimchp3classes
[javac] Compiling 27 source files to C:jimchp3classes
[javac] C:jimchp3srccommetamechjabberxmlJabberInputHandler.java:60:
cannot resolve symbol
[javac] symbol : method setReaderFactory (com.metamech.jabber.xml.Streamin
gCharFactory)
[javac] location: class org.apache.xerces.parsers.SAXParser
[javac] parser.setReaderFactory(new StreamingCharFactory());
[javac] ^
[javac] 1 error

BUILD FAILED
file:C:/jim/chp3/build.xml:34: Compile failed; see the compiler error output for
details.

Total time: 1 second
--------------------------------------------------------------------------------
I am runing Windows 2000 Pro. My "ant" setting is "working" (I tested with
other "ant" based projects). I am using version 1.5 "ant". But got the same
build failed message when I tried with other version. Here are some related
enviromental variable settings:

ANT_HOME=c:ant
CLASSPATH=C:jdk1.3.1_04;c:junitjunit.jar;csmilieercesxerces.jar
JAVA_HOME=C:jdk1.3.1_04

Thanks vary much for the help
import-bot (20211) [Avatar] Offline
#2
Re: Need help to build the sample code
[Originally posted by iainshigeoka]

> Hi, I enjoyed your book very much. But do need some help to build the code. I

Thanks. Sorry about the code problems. See my announcement of the jj project
on the forum for info on what will become a much better source solution... smilie

> am keeping getting the build failed message. Here is the message:

> [javac] C:jimchp3srccommetamechjabberxmlJabberInputHandler.java:60:
> cannot resolve symbol
> [javac] symbol : method setReaderFactory
(com.metamech.jabber.xml.Streamin
...
> ANT_HOME=c:ant
> CLASSPATH=C:jdk1.3.1_04;c:junitjunit.jar;csmilieercesxerces.jar
> JAVA_HOME=C:jdk1.3.1_04

My guess is that you're using a different version of Xerces than the one I
built the soucre for. Try Xerces 2.0. You can grab all the jars that I used
by downloading the full source bundle from the book's website (the Xerces
library I used is included in it).

This is a hazard in using my hack for Xerces to handle streaming XML.
Unfortunately most XML parsers are designed for documents as one big chunk
like Xerces so it is very hard to force them to behave the way we want for
Jabber.

The solution is using xml pull parsers rather than xml push parsers like SAX.
In my new JJ project that's the tact I'm using. You can read more about xml
pull at www.xmlpull.org. The version of JJ in CVS at www.jabberstudio.org
(still mostly non-functional) has been ported to XPP and is screamingly fast
(although it won't really let you do much beyond login). Or you can wait a
bit longer and when I get JJ more functional I'll package it up as an easier
to use bundle and post it on the jj site.

Hope this helps. If not, let me know.

-iain

BTW - my apologies for the lag. I'm still trying to get a good reminder to
check the forum regularly. smilie