Miguel Carvalho wrote:

> Hi! I've followed your suggestion Dirk. Debug mode didn't help me very
> much.
>
> I separated the webdav put tests from all the remaining process so I can
> trace package crossovers better. I've tried this
> With several combinations of need packages, and diferent webservers:
>
> WebServers: ServletServer, Jrun, TomCat;
> Servlet classes: jsdk.jar (2.0), Servlet.jar (2.2 and 2.3).
>
> Xml: Xerces 1_3_1 versus jaxp.jar + crimson.jar (slide).
>
> And I allways get the same results. I don't know if in Jrun case som
> libraries may make interferience.
>
> Please se the atacched files. The Test2.java first. It's the simple
> example, that works fine TestServlet.java it's the same code in a
> servlet. When putting small files (<100KB) it succeded but don't writes
> anithyng. Putting larger files it gives the output in the log files.
>
> TIA,

Your TestServlet works for me...     :-)
I compiled your example using servlet.jar(2.2) and the latest cvs version of 
httpclient.
Looking at your example, I think you are using Tomcat 4 as your webdav server ?

I did the following:
- changed following lines in your example
        System.out.println("temp_file path:   " + temp_file.getAbsolutePath());
        System.out.println("temp_file length: " + temp_file.length());
        method.sendData(temp_file);
        client.setDebug(1000);
        client.executeMethod(method);
- used "http://localhost:8080/webdav"; as http_url
- compiled TestServlet and put it in: 
jakarta-tomcat-4.0-b7\webapps\examples\WEB-INF\classes
- put the following libraries in jakarta-tomcat-4.0-b7\webapps\examples\WEB-INF\lib
    crimson.jar,jaxp.jar,commons-httpclient.jar,webdavlib.jar
    (both httpclient and webdavlib from slide cvs)
- run the servlet using: http://localhost:8080/examples/servlet/TestServlet

The servlet works and gives "sucess!", on the log I get:
=============================================
Starting service Tomcat-Standalone
Apache Tomcat/4.0-b7
Starting service Tomcat-Apache
Apache Tomcat/4.0-b7
temp_file path:   D:\Temp\dontwork.exe
temp_file length: 625181
Reopen connection : Host:localhost Port:8080

PUT /webdav/dontwork.exe HTTP/1.1
Transfer-Encoding: chunked
Host: localhost:8080
User-Agent: Jakarta HTTP Client/1.0


HTTP/1.1 100 Continue


HTTP/1.1 201 Created
Content-Type: text/html; charset=UTF-8
Date: Fri, 21 Sep 2001 17:40:32 GMT
Transfer-Encoding: chunked
Server: Apache Tomcat/4.0-b7 (HTTP/1.1 Connector)
============================================

As you can see the client doesn't have to reopen the connection in my case.
What is your precise webdav server configuration ?


Dirk



Reply via email to