• 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 ...
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Carey Brown
  • Frits Walraven

get a classCastException im getFibs() method on p.257 of Java Web Service Up and Running.

Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am still struggling with the example on p 256.
First I commented out the DerbyPlatform in persistence.xml ,the client prints Fib(1) = 1 , Fib(2) = 1 ...

However, on the service side of the Glassfish, I get a class cast exception on List list = (List) next.
It cannot type cast the object in fib_nums to list.
Here is the code from the book:

I changed the code a little bit:

I got a MarshallException. It seems that the results cannot be marshaled into XML before being sent to the client.

Please help.
What is that? Is that a mongol hoarde? Can we fend them off with this tiny ad?
ScroogeXHTML 8.7 - RTF to HTML5 and XHTML converter
    Bookmark Topic Watch Topic
  • New Topic