• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Java & XML 3rd edition/ online example won't run

 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

first time poster; did a search for this and couldn't find the answer.
I'm working out of the java & xml book, the chapter on sax. I typed the examples he gives as I was reading (I'm working in eclipse) and I don't think it's running correctly.

Also, the online example that he gives won't run on my machine. It compiles with this message:



then when I try to run the program I get:









It's a little bit confusing the way he has it set up; he gives code examples for all the stuff in the class that implements the ContentHandler interface, but he excludes all the import statements and anything that isn't directly related to the methods he's covering in the book. The problem is, that when he tells you to run the code for the first time; the program calls a method (init() method)that he hasn't explained, and it's significant, because it has nodes in it and calls the method gets to the ContentHandler stuff.

thanks
 
Edmund Castermund
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
btw,

I ran a little "hello world" test program in that directory, so I don't think it's a classpath thing.
thanks,
bp
 
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello 'Badperson',
Welcome to the Ranch. I havent read this book but I think you have a recent as in 5.0 or 6.0 compiler but youre not making use of the features provided by it, particularly relating to generics, thats what the unsafe warning is about. About your runtime exception that seems entirely unrelated to that and perhaps has to do with your java runtime version conflicting in some way with your java compiler. are the 2 versions same?
[ May 09, 2007: Message edited by: Amitabha Batranab ]
 
town drunk
( and author)
Posts: 4118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"badperson",

We have a naming convention on the 'ranch, which we ask all members to use. Basically, you need to use a real(ish) first and last name. So, no John Smith, and nothing that our international moderators would recognize as fake.

Thanks,
M
 
Edmund Castermund
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
profile is updated.

thanks for the replies. Still not really able to get the example to run, but like a total goof, the one I did was actually okay; it's done with swing, and I wasn't expanding the tree under the title of the document....

still not sure why the example isn't running though.
jw
 
Lookout! Runaway whale! Hide behind this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!