You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Chris Knight <ck...@mail.arc.nasa.gov> on 2001/07/23 21:03:42 UTC

minor (command-line) client issue...URL with a port

If I type "open http://host.domain.tld:80/dav" I get the below error message
(hence my e-mail.)  It looks like org.apache.util.HttpURL/GenericURI don't
parse the URL if given just the string, would it be worthwhile to re-write
it to parse out the scheme, port, etc from a string URL?

--- error below ---

Fatal Error: port out range:-1
Command input: open http://corum.arc.nasa.gov:80/dav
java.lang.IllegalArgumentException: port out range:-1
        at java.net.Socket.<init>(Socket.java:253)
        at java.net.Socket.<init>(Socket.java:100)
        at
org.apache.commons.httpclient.HttpClient.openConnection(HttpClient.java:765)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:412)
        at
org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:2543
)
        at
org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:2512
)
        at
org.apache.webdav.lib.WebdavResource.setNamedProp(WebdavResource.java:681)
        at
org.apache.webdav.lib.WebdavResource.setBasicProperties(WebdavResource.java:
668)
        at
org.apache.webdav.lib.WebdavResource.setProperties(WebdavResource.java:1572)
        at
org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1019)
        at
org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1038)
        at
org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1117)
        at
org.apache.webdav.lib.WebdavResource.<init>(WebdavResource.java:260)
        at org.apache.webdav.cmd.Slide.processCommands(Slide.java:326)
        at org.apache.webdav.cmd.Slide$1.run(Slide.java:201)
        at java.lang.Thread.run(Thread.java:484)
Please, email to slide-user@jakarta.apache.org


Re: minor (command-line) client issue...URL with a port

Posted by Remy Maucherat <re...@betaversion.org>.
Quoting Chris Knight <ck...@mail.arc.nasa.gov>:

> If I type "open http://host.domain.tld:80/dav" I get the below error
> message
> (hence my e-mail.)  It looks like org.apache.util.HttpURL/GenericURI
> don't
> parse the URL if given just the string, would it be worthwhile to
> re-write
> it to parse out the scheme, port, etc from a string URL?

Yes, I can confirm the bug.
This works: open http://127.0.0.1:8080/webdav
This doesn't: open http://127.0.0.1:80/webdav (and you get the exception you 
mentioned)

Remy