Mike,
Best guess here is the url you're accessing doesn't support propfinds. You can either use ethereal to monitor the traffic or get the reasonCode from the HttpException to check. It could be something else, but I've seen the same error when accessing plain http urls so that's my first hunch.


-James

Michel Bohn wrote:
James,

Thanks for you response!!  I did as you asked and upgraded to
jakarta-slide-webdavclient-bin-2.1b1.  I recompiled and reran my code and
the port error wasn't thrown.  It still dies in the construction of the
webdavresource while looking for properties.  I don't set any of my
properties until after I've constructed the wdr.

            HUrl = new HttpURL(url);
            HUrl.setUserinfo(usr, pass);

            System.out.println("Initiate Webdav Resource for:
"+HUrl.getURI());
            wdr = new WebdavResource(HUrl); <-- dies here**

            System.out.println("Webdav Resource initiated for:
"+wdr.getHttpURL().getURI());
            System.out.println("Adding properties");
            wdr.proppatchMethod("Host", "services.msn.com");
            wdr.proppatchMethod("Content-Length", "XXXX");
            wdr.proppatchMethod("Connection",  "Close");
            wdr.proppatchMethod("User-Agent", "Outlook Express/5.0 (MSIE
5.0; Windows 98; DigExt; MSNIA)");
            wdr.proppatchMethod("Content-Type", "text/xml");

init http://oe.hotmail.com/cgi-bin/hmdata [EMAIL PROTECTED] xxxxxxx
Creating URL
http://oe.hotmail.com/cgi-bin/hmdata
Port80
oe.hotmail.com
http://oe.hotmail.com/cgi-bin/hmdata
Init WebdavResource
Initiate Webdav Resource for: http://oe.hotmail.com/cgi-bin/hmdata
null
org.apache.commons.httpclient.HttpException
        at
org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3430
)
        at
org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3386
)
        at
org.apache.webdav.lib.WebdavResource.setNamedProp(WebdavResource.java:967)
        at
org.apache.webdav.lib.WebdavResource.setBasicProperties(WebdavResource.java:
912)
        at
org.apache.webdav.lib.WebdavResource.setProperties(WebdavResource.java:1867)
        at
org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1277)
        at
org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1296)
        at
org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1382)
        at
org.apache.webdav.lib.WebdavResource.<init>(WebdavResource.java:290)
        at Httpmail.init(Httpmail.java:53)
        at Httpmail.<init>(Httpmail.java:30)
Oops, got a problem null
        at propFindTest.main(propFindTest.java:8)
java.lang.Exception
        at Httpmail.<init>(Httpmail.java:32)
        at propFindTest.main(propFindTest.java:8)

----- Original Message ----- From: "James Mason" <[EMAIL PROTECTED]>
To: "Slide Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, August 14, 2004 1:10 AM
Subject: Re: PLEASE HELP WebdavResource init error, invalid port number



| Mike,
| Any chance you could upgrade to the latest version of the client? There
| was a bug related to the handling of the default port, so upgrading
| might fix it. At worst it will make your line number match mine :).
|
| -James
|
| Michel Bohn wrote:
| > James,
| >
| > Thanks for you suggestion on the sniffer. I set it up as you
recommended
| > and tested it with an httpclient and it works great. However, Ethereal
| > detects no dialog from my webdav program to the http server. I think it
is
| > dying during the construction of the webdavresource. It looks as if it
is
| > trying to validate the url and poops because there is no inline port in
the
| > url (i.e http://oe.hotmail.com:(some port)/cgi-bin/hmdata). Try setting
up
| > a simple webdavresource and running it. It will fail.
| >
| > private String url = "http://oe.hotmail.com/cgi-bin/hmdata";;
| > HUrl = new HttpURL(url);
| > HUrl.setUserinfo(usr, pass);
| > wdr = new WebdavResource(HUrl); <-- *dies here!!!!*
| >
| > Mike
| >
| > Code:
| > private String password = "xxxxxxxx";
| > private String url = "http://oe.hotmail.com/cgi-bin/hmdata";;
| > private String user = "[EMAIL PROTECTED]";
| > private WebdavResource wdr = null;
| > private HttpURL HUrl;
| > private HttpClient client;
| > private HttpMethod method;
| > public Httpmail() throws Exception {
| > try {
| > System.out.println("init " + url + " " + user + " "
+password);
| > init(url, user, password);
| > } catch (Exception e) {
| > throw new Exception(e.getMessage());
| > }
| > }
| > public void init(String url, String usr, String pass) throws
| > Exception {
| > HUrl = new HttpURL(url);
| > HUrl.setUserinfo(usr, pass);
| > //set request headers
| > System.out.println("Init WebdavResource");
| > try {
| > wdr = new WebdavResource(HUrl); <-- *dies here!!!!*
| > wdr.proppatchMethod("Host", "services.msn.com");
| > wdr.proppatchMethod("Content-Length", "XXXX");
| > wdr.proppatchMethod("Connection", "Close");
| > wdr.proppatchMethod("User-Agent", "Outlook Express/5.0
(MSIE5.0;
| > Windows 98; DigExt; MSNIA)");
| > wdr.proppatchMethod("Content-Type", "text/xml");
| > } catch (Exception e) {
| > System.out.println(e.getMessage());
| > e.printStackTrace();
| > throw new Exception(e.getMessage());
| > }
| > }
| >
| > Output:
| > init http://oe.hotmail.com/cgi-bin/hmdata [EMAIL PROTECTED] xxxxxx
| > Creating URL
| > http://oe.hotmail.com/cgi-bin/hmdata
| > Port80
| > oe.hotmail.com
| > http://oe.hotmail.com/cgi-bin/hmdata
| > Init WebdavResource
| > invalid port number
| > org.apache.commons.httpclient.URIException: invalid port number
| > at
org.apache.commons.httpclient.URI.parseAuthority(URI.java:2218)
| > at
| > org.apache.commons.httpclient.URI.parseUriReference(URI.java:1961)
| > at
org.apache.commons.httpclient.HttpURL.<init>(HttpURL.java:379)
| > at
org.apache.commons.httpclient.HttpURL.<init>(HttpURL.java:207)
| > at
| >
org.apache.webdav.lib.WebdavResource.isTheClient(WebdavResource.java:1104)
| > at
| > org.apache.webdav.lib.WebdavResource.setClient(WebdavResource.java:1130)
| > at
| > org.apache.webdav.lib.WebdavResource.setClient(WebdavResource.java:1118)
| > at
| >
org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3170
| > )
| > at
| >
org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3145
| > )
| > at
| >
org.apache.webdav.lib.WebdavResource.setNamedProp(WebdavResource.java:879)
| > at
| >
org.apache.webdav.lib.WebdavResource.setBasicProperties(WebdavResource.java:
| > 824)
| > at
| >
org.apache.webdav.lib.WebdavResource.setProperties(WebdavResource.java:1746)
| > at
| >
org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1156)
| > at
| >
org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1175)Oop
| > s, got a problem invalid port number
| > at
| >
org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1261)
| > at
| > org.apache.webdav.lib.WebdavResource.<init>(WebdavResource.java:274)
| > at Httpmail.init(Httpmail.java:52)
| > at Httpmail.<init>(Httpmail.java:30)
| > at propFindTest.main(propFindTest.java:8)
| > java.lang.Exception: invalid port number
| > at Httpmail.<init>(Httpmail.java:32)
| > at propFindTest.main(propFindTest.java:8)
| >
| > ----- Original Message ----- | > From: "Michel Bohn" <[EMAIL PROTECTED]>
| > To: <[EMAIL PROTECTED]>
| > Sent: Tuesday, August 10, 2004 6:33 PM
| > Subject: Re: PLEASE HELP WebdavResource init error, invalid port number
| >
| >
| > | Sure, I will set up a sniffer and respond.
| > |
| > | To give you some history, I set up my own XML HttpClient to see if I
could
| > | get dialog and sure enough the first url ->
| > |
| > | http://services.msn.com/svcs/hotmail/httpmail.asp redirects you to
| > | http://oe.hotmail.com/cgi-bin/hmdata where you authenticate and send
the
| > | following properties
| > |
| > | PROPFIND /svcs/hotmail/httpmail.asp HTTP/1.1
| > | Host: services.msn.com
| > | Content-Length: XXXX
| > | Connection: Close
| > | User-Agent: Outlook Express/5.0 (MSIE 5.0; Windows 98; DigExt; MSNIA)
| > | Content-Type: text/xml
| > |
| > | <?xml version="1.0"?>
| > | <D:propfind xmlns:D="DAV:"
xmlns:h="http://schemas.microsoft.com/hotmail/";
| > | xmlns:hm="urn:schemas:httpmail:">
| > | <D:prop>
| > | <h:adbar/>
| > | <hm:contacts/>
| > | <hm:inbox/>
| > | <hm:outbox/>
| > | <hm:sendmsg/>
| > | <hm:sentitems/>
| > | <hm:deleteditems/>
| > | <hm:drafts/>
| > | <hm:msgfolderroot/>
| > | <h:maxpoll/>
| > | <h:sig/>
| > | </D:prop>
| > | </D:propfind>
| > |
| > | James Mason wrote:
| > |
| > | >Can you setup a sniffer/proxy for your connection (say Apache Ant's
| > | >tcpmon or ethereal)? I think this may be a redirection problem, and
it
| > | >would be helpful to know what the http traffic looks like.
| > | >
| > | >-James
| > | >
| > | >Michel Bohn wrote:
| > | >
| > | >>When I try and connect to the following url I get the following
error.
| > | >>Could someone clarify why? What am I doing wrong.
| > | >>
| > | >>Error Output:
| > | >>Init WebdavResource
| > | >>invalid port number
| > | >>org.apache.commons.httpclient.URIException: invalid port number
| > | >> at
| > org.apache.commons.httpclient.URI.parseAuthority(URI.java:2218)
| > | >> at
| > | >>org.apache.commons.httpclient.URI.parseUriReference(URI.java:1961)
| > | >> at
org.apache.commons.httpclient.HttpURL.<init>(HttpURL.java:379)
| > | >> at
org.apache.commons.httpclient.HttpURL.<init>(HttpURL.java:207)
| > | >> at
| > |
| >
|


org.apache.webdav.lib.WebdavResource.isTheClient(WebdavResource.java:1104

) | > | > | >> at | > |

org.apache.webdav.lib.WebdavResource.setClient(WebdavResource.java:1130)

| > | >> at | > |

org.apache.webdav.lib.WebdavResource.setClient(WebdavResource.java:1118)

| > | >> at | > | | > |

org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3

1 | > | > 70) | > | >> | > | >> at | > | | > |

org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3

1 | > | > 45) | > | >> | > | >> at | > | | > |

org.apache.webdav.lib.WebdavResource.setNamedProp(WebdavResource.java:879

) | > | > | >> at | > | | > |

org.apache.webdav.lib.WebdavResource.setBasicProperties(WebdavResource.ja

v | > | > a:824) | > | >> | > | >> at | > | | > |

org.apache.webdav.lib.WebdavResource.setProperties(WebdavResource.java:17

4 | > | > 6) | > | >> | > | >> at | > | | > |

org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1156)

| > | > | >> at | > | | > |

org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1175)

| > | > | >> at | > | | > |

org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1261)

| > | > | >> at | > | >>org.apache.webdav.lib.WebdavResource.<init>(WebdavResource.java:274) | > | >> at Httpmail.init(Httpmail.java:52) | > | >> at Httpmail.<init>(Httpmail.java:30) | > | >> at propFindTest.main(propFindTest.java:8) | > | >>java.lang.Exception: invalid port number | > | >> at Httpmail.<init>(Httpmail.java:32) | > | >> at propFindTest.main(propFindTest.java:8) | > | >>Oops, got a problem invalid port number | > | >> | > | >> private String password = "xxxxxxxx"; | > | >> private String url = "http://oe.hotmail.com/cgi-bin/hmdata";; | > | >> private String user = "[EMAIL PROTECTED]"; | > | >> private WebdavResource wdr = null; | > | >> private HttpURL HUrl; | > | >> private HttpClient client; | > | >> private HttpMethod method; | > | >> public Httpmail() throws Exception { | > | >> try { | > | >> System.out.println("init " + url + " " + user + " " | > +password); | > | >> init(url, user, password); | > | >> } catch (Exception e) { | > | >> throw new Exception(e.getMessage()); | > | >> } | > | >> } | > | >> public void init(String url, String usr, String pass) throws | > | >>Exception { | > | >> HUrl = new HttpURL(url); | > | >> HUrl.setUserinfo(usr, pass); | > | >> //set request headers | > | >> System.out.println("Init WebdavResource"); | > | >> try { | > | >> wdr = new WebdavResource(HUrl); <-- *dies here!!!!* | > | >> wdr.proppatchMethod("Host", "services.msn.com"); | > | >> wdr.proppatchMethod("Content-Length", "XXXX"); | > | >> wdr.proppatchMethod("Connection", "Close"); | > | >> wdr.proppatchMethod("User-Agent", "Outlook Express/5.0 (MSIE | > | >>5.0; Windows 98; DigExt; MSNIA)"); | > | >> wdr.proppatchMethod("Content-Type", "text/xml"); | > | >> } catch (Exception e) { | > | >> System.out.println(e.getMessage()); | > | >> e.printStackTrace(); | > | >> throw new Exception(e.getMessage()); | > | >> } | > | >> } | > | >> | > | >>_________________________________________________________________ | > | >>Don&#65533;t just search. Find. Check out the new MSN Search! | > | >>http://search.msn.click-url.com/go/onm00200636ave/direct/01/ | > | >> | > | >> | > |

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

| > | >>To unsubscribe, e-mail: [EMAIL PROTECTED] | > | >>For additional commands, e-mail: [EMAIL PROTECTED] | > | >> | > | >> | > | >> | > | > | > | >--------------------------------------------------------------------- | > | >To unsubscribe, e-mail: [EMAIL PROTECTED] | > | >For additional commands, e-mail: [EMAIL PROTECTED] | > | > | > | >. | > | > | > | | > | _________________________________________________________________ | > | Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ | > | Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 | > | | > | | > | --------------------------------------------------------------------- | > | To unsubscribe, e-mail: [EMAIL PROTECTED] | > | For additional commands, e-mail: [EMAIL PROTECTED] | > | | > | | > | > --------------------------------------------------------------------- | > To unsubscribe, e-mail: [EMAIL PROTECTED] | > For additional commands, e-mail: [EMAIL PROTECTED] | > | > | > | | --------------------------------------------------------------------- | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] | |

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to