• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet can't uses XMLOutputter, why?

 
Mouza Ali
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • 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
  • 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..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic