• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Time is mother nature's way of keeping everything from happening at once. And this is a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic