[jdom-interest] JDOM via Servlet

Ian Lea ian.lea at blackwell.co.uk
Tue Jul 24 02:17:59 PDT 2001

The file not found exception on http://devboard/etc. is
happening, I guess, because the servlet is trying to access
that URL and failing.  So perhaps either use a URL that
is accessible or mess around with proxies or whatever to
make it accessible, or switch off validation by changing
line 63 in WhlslServlet.java to

  SAXBuilder builder = new SAXBuilder();

Some people say that validation should be off in production

You don't seem to have incorporated the readFully etc.
mods. suggested by Joseph Bowbeer.  I suggest you do.


John Muhlestein wrote:
> I seem to continue to be running up against a brick wall trying to pass XML
> to a servlet and then building a JDOM Document (see SAXBuilder.buid()
> weirdness and second try).  I have decided to ignore my entire back-end
> application and just concentrate on sending XML and building the Document.
> Thanks to Joseph Bowbeer I have come up with some code I thought would do
> the trick (attempting to buffer the XML stream as mentioned in the FAQ) and
> so far no luck.
> Here are the details:
> Tomcat 3.2
> Xerces 1.4.1
> JDOM b7 (cvs 7/14/2001)
> When I attempt SAXBuilder.build() the servlet hangs and I ultimately receive
> back:
>  http://devboard/xml/servlet/whlsl
>     java.io.FileNotFoundException: http://devboard/xml/servlet/whlsl
>         at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
> .java:545)
>         at
> java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:230)
>         at com.ilink.whlsl.util.WhlslPostTest.send(WhlslPostTest.java:39)
>         at com.ilink.whlsl.util.WhlslPostTest.main(WhlslPostTest.java:77)
> If I skip the build and just echo back my request the servlet returns
> HttpURLConnection.HTTP_OK and the result is the XML that I POSTed to the
> servlet.
> I hava attached the XML, the class the POST's and the servlet (They are all
> short).
> If there are any other suggestions, please, let me know.
> thanks for the help,
> John
>  <<WhlslServlet.java>>  <<WhlslPostTest.java>>  <<whlsl.xml>>
>   --------------------------------------------------------------------------------
>                         Name: WhlslServlet.java
>    WhlslServlet.java    Type: unspecified type (application/octet-stream)
>                     Encoding: quoted-printable
>                          Name: WhlslPostTest.java
>    WhlslPostTest.java    Type: unspecified type (application/octet-stream)
>                      Encoding: quoted-printable
>    whlsl.xmlName: whlsl.xml
>             Type: unspecified type (application/octet-stream)

More information about the jdom-interest mailing list