• 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

Servlet can't uses XMLOutputter, why?

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi to this great forum,

I have a problem with my servlet class. The client-servlet scenario is like the following:

I have a client class that create an XML file and send it to the servlet side using XMLOutputtter. When the servlet recieves this XML file, it will save it into another XML file using regulare File without using SAXBuilder. So far so good. However, I need to send this file again to the client side using also XMLoutputtter; however, when I use the XMLOutputter in servlet side, an exception is thrown telling that:



However, when I try sending the file using ObjectOutputStream it works, but the content is sent into incorrect format like squares, hearts, circles.. etc . That's why I need to use the XML outputtter.

Below you will find the code for the client class:



and this is the servlet without the XMLOutputtter:



I didn't include my servlet class that uses the XMLOutputtter, coz it will be the same as using it on the clinet side, I just don't know why it keeps throwing exceptions. And what makes things worst is that I can't debug the servlet side

Please I need someone to help me with this prob
 
Mouza Ali
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hahaha.. I always post topics here and end up by solving them by myself. Don't know, it seems that this forum just keep inspiring me lol

The problem was that the servlet can't see the jdom.jar file and then I included it into the lib folder uder WEB-INF, and that's why the client can't receive inputs and consequentially throws exceptions..
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic