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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

SAX builder causes the problem, why?

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

I have been working on sending XML file from simple client to servlet for a week now,and I couldn't overcome the problem. The problem is that when I send the XML file that was generated in the client side, the servlet recieves it as numbers, therefore, I have to rebuild the XML file, so I had to use the SAXbuilder, and write some data to the client again. Though, the client throws excpetion in the InputStream line. Below are the codes:

client side:


----------------------------

servlet side:


-----------------

xml file



----------------

Excpeiton throwed

java.io.IOException: server return Server returned HTTP response code: 500 for URL: http://localhost:8080/TryXML/S at sun.net.www.protocol.http.HttpURLConnection.getInputStream at C.onSendData(C.java:75)
at C.main(C.java:22)


Please I need help
[ November 14, 2008: Message edited by: Paul Sturrock ]
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Your question is a little confusing - you don't appear to be using a Servlet, you seem to have two clients? Is there a Servlet configured at http://localhost:8080/TryXML/S ?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Response code 500 is SC_INTERNAL_SERVER_ERROR

From the client side you cant tell what that error was.

Therefore, I cant see what SAXbuilder had to do with the problem. You should be looking at the server logs.

Bill
 
Mouza Ali
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hello,

Sorry for posting the wrong code for the servlet side.
Any way I solved the problem and I removed the SAX builder and read the input as String line and rewrote them into another xml file.

But, there is another problem.. When I integradet the client class with an Applet, the Applet fails to load. and this is due to the Jdom pakcage. It says: NoClassFound for org.jdom.... or no definition found for java.lang.jdom something like that. I separated the Applet class from the class that will generate the xml and make connection, but same error.

How I can solve this porblem?
 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not post the same question more than once.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic