Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 44215 invoked from network); 8 Feb 2011 00:55:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Feb 2011 00:55:55 -0000 Received: (qmail 92596 invoked by uid 500); 8 Feb 2011 00:55:54 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 92478 invoked by uid 500); 8 Feb 2011 00:55:53 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 92470 invoked by uid 99); 8 Feb 2011 00:55:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Feb 2011 00:55:53 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ralph.goers@dslextreme.com designates 209.85.213.43 as permitted sender) Received: from [209.85.213.43] (HELO mail-yw0-f43.google.com) (209.85.213.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Feb 2011 00:55:47 +0000 Received: by yws5 with SMTP id 5so2063887yws.30 for ; Mon, 07 Feb 2011 16:55:26 -0800 (PST) Received: by 10.90.247.29 with SMTP id u29mr20395302agh.150.1297126525739; Mon, 07 Feb 2011 16:55:25 -0800 (PST) Received: from [192.168.10.132] (cpe-75-82-178-177.socal.res.rr.com [75.82.178.177]) by mx.google.com with ESMTPS id x31sm6311509ana.29.2011.02.07.16.55.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 07 Feb 2011 16:55:24 -0800 (PST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1082) Subject: Re: [vfs] - Problem with httpclient From: Ralph Goers In-Reply-To: <1297095158.2474.9.camel@magno> Date: Mon, 7 Feb 2011 16:55:20 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <07EFE170-2054-4283-82F2-D12CD5FFCBEE@dslextreme.com> References: <1296637996.2270.9.camel@magno> <1296746433.2080.10.camel@magno> <1296750439.2080.23.camel@magno> <1297095158.2474.9.camel@magno> To: "Commons Users List" X-Mailer: Apple Mail (2.1082) The question I have is why this is flagged as "vfs" and isn't being = asked on the httpclient mailing list? Ralph On Feb 7, 2011, at 8:12 AM, Ismael Mar=EDn Carri=F3n wrote: > Hi all, >=20 > I would like to recall my question. Briefly, httpclient is not able to > connect to a HTTP server, which has opened a GASS session, using a URI > such as: http://localhost:8180/opt/mytext.txt , where /opt/mytext.txt = is > on /. However, using a web server or tomcat servlet container, > httpclient has not problems. >=20 > Tracking the code, in the generateRequestLine method of > HttpMethodBase.java, it does not receives the correct path. >=20 > protected static String generateRequestLine(HttpConnection connection, > String name, String requestPath, String query, String version) >=20 > Thus, for the GASS session , requestPath shows: > HEAD / HTTP/1.1 , instead of HEAD /opt/mytext.txt HTTP/1.1 >=20 > But, using a URI of tomcat, such as http://localhost:8080/index.jsp , = it > shows: > HEAD /index.jsp HTTP/1.1 >=20 > I hope it clarifies the problem. Any comment or suggestion is welcome. > Regards. >=20 >=20 > On Thu, 2011-02-03 at 17:27 +0100, Ismael Mar=EDn Carri=F3n wrote: >=20 >> Dear Martin, thanks for your response. >>=20 >> The GASS session does not uses the port 80 (and magno is a local >> domain). It opens a HTTP session such as >>=20 >> $ globus-gass-server -i -p 8180 >> http://localhost:8180 >>=20 >>=20 >> and so, you can transfer files using the globus-url-copy (in a grid >> environment) or simply, using wget to a URI such as >> http://localhost:8180/out/test.txt, where /out/test.txt is on /, the >> file is downloaded. >>=20 >> It seems rare since using a URI of a web server or tomcat servlet, = this >> application has not problems. So, I guess that httpclient is not = ready >> for this kind of HTTP services, no? >>=20 >> By other hand, the application previously set the HostConfiguration, >> client.setHostConfiguration(config);. I am not the developer of this >> code, and so I unknown some details. >>=20 >> Regards.=20 >>=20 >> On Thu, 2011-02-03 at 11:09 -0500, Martin Gainty wrote: >>> ssh username@magno (or whatever the IP is assigned to magno in hosts = file) >>>> netstat -ab | grep 80 >>>=20 >>> //if you do not have HTTPServer running on 80 you will get no = results >>> //if you do have HTTPServer running on Port 80 you should see output >>>=20 >>> //also if your HttpClient executeMethod is declared as=20 >>> public int executeMethod(HostConfiguration hostconfig, final = HttpMethod method, final HttpState state) >>> throws IOException, HttpException=20 >>>=20 >>> //you should call executeMethod with all of the params initialised = e.g. >>> try >>> { >>> int n=3Dclient.executeMethod(hostconfig,method,state) >>> } >>> catch(IOException ioe) >>> { >>> log.debug("Handle your IOException from client.executeMethod here"); >>> } >>> catch(HttpException http_exception) >>> { >>> log.debug("Handle your HttpException from client.executeMethod = here"); >>> } >>>=20 >>> Saludos Cordiales, >>> Martin Gainty=20 >>> ______________________________________________=20 >>> Verzicht und Vertraulichkeitanmerkung/Note de d=E9ni et de = confidentialit=E9 >>>=20 >>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene = Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede = unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. = Diese Nachricht dient lediglich dem Austausch von Informationen und = entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten = Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt = uebernehmen. >>> Ce message est confidentiel et peut =EAtre privil=E9gi=E9. Si vous = n'=EAtes pas le destinataire pr=E9vu, nous te demandons avec bont=E9 que = pour satisfaire informez l'exp=E9diteur. N'importe quelle diffusion non = autoris=E9e ou la copie de ceci est interdite. Ce message sert =E0 = l'information seulement et n'aura pas n'importe quel effet l=E9galement = obligatoire. =C9tant donn=E9 que les email peuvent facilement =EAtre = sujets =E0 la manipulation, nous ne pouvons accepter aucune = responsabilit=E9 pour le contenu fourni. >>>=20 >>>=20 >>>=20 >>>=20 >>>> Date: Thu, 3 Feb 2011 16:20:33 +0100 >>>> From: i.marin@fdi.ucm.es >>>> Subject: Re: [vfs] - Problem with httpclient >>>> To: user@commons.apache.org >>>>=20 >>>> I would like to emphasize that the URI is given by a insecure = Globus >>>> GASS session (the files are transfered using wget, so the session = is >>>> ok). This code does not fail with other kind of URIs. >>>>=20 >>>> Thus, are this kind of URIs valid for httpclient? >>>>=20 >>>> Regards. >>>>=20 >>>> On Wed, 2011-02-02 at 10:13 +0100, Ismael Mar=EDn Carri=F3n wrote: >>>>> Dear all, >>>>>=20 >>>>> I am working in the development of a driver for a Grid system. In = our >>>>> tests, we are using GridSAM, which use the httpclient and = commons-vfs. >>>>>=20 >>>>> I am writing you to get some advise of how solving the next = problem. >>>>>=20 >>>>> GridSAM invokes httpclient classes from the HttpClientFactory = class >>>>> (org.apache.commons.vfs.provider.http), in the method >>>>> createConnection(). >>>>>=20 >>>>> public static HttpClient = createConnection(HttpFileSystemConfigBuilder >>>>> builder, String scheme, >>>>> String hostname, int = port, >>>>> String username, >>>>> String password, >>>>> FileSystemOptions fileSystemOptions) >>>>> throws FileSystemException >>>>> { >>>>> .... >>>>> client.executeMethod(new HeadMethod()); >>>>> .... >>>>> } >>>>>=20 >>>>> I am not using any authentication mechanism, and so username and = passwd >>>>> are null, but hostname, port and scheme has the proper values. >>>>>=20 >>>>> Thus, in executeMethod() method of the HttpClient class: >>>>>=20 >>>>> public int executeMethod(HostConfiguration hostconfig, >>>>> final HttpMethod method, final HttpState state) >>>>> throws IOException, HttpException { >>>>> .... >>>>> HostConfiguration defaulthostconfig =3D = getHostConfiguration(); >>>>> if (hostconfig =3D=3D null) { >>>>> hostconfig =3D defaulthostconfig; >>>>> } >>>>> URI uri =3D method.getURI(); >>>>> .... >>>>> } >>>>>=20 >>>>> I received a null value for uri, while the hostconfig object has = values >>>>> for host attribute, but not for localAddress attribute or any = other. >>>>> Later it causes a NoHttpResponseException.=20 >>>>>=20 >>>>> The complete stack is: >>>>>=20 >>>>> 2011-02-01 17:11:49,050 ERROR [TransferAgentFactory] source URI is = not >>>>> resolvable >>>>> org.apache.commons.vfs.FileSystemException: Could not connect to = HTTP >>>>> server on "magno". >>>>> at >>>>> = org.apache.commons.vfs.provider.http.HttpClientFactory.createConnection(Ht= tpClientFactory.java:186) >>>>> at >>>>> = org.apache.commons.vfs.provider.http.HttpClientFactory.createConnection(Ht= tpClientFactory.java:53) >>>>> at >>>>> = org.apache.commons.vfs.provider.http.HttpFileProvider.doCreateFileSystem(H= ttpFileProvider.java:97) >>>>> at >>>>> = org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.getFileSys= tem(AbstractOriginatingFileProvider.java:103) >>>>> at >>>>> = org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(A= bstractOriginatingFileProvider.java:82) >>>>> at >>>>> = org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(A= bstractOriginatingFileProvider.java:66) >>>>> at >>>>> = org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFi= leSystemManager.java:706) >>>>> at >>>>> = org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFi= leSystemManager.java:623) >>>>> at >>>>> = org.icenigrid.gridsam.core.plugin.transfer.protocol.AbstractTransferAgent.= getFileObject(AbstractTransferAgent.java:239) >>>>> at >>>>> = org.icenigrid.gridsam.core.plugin.transfer.protocol.TransferAgentFactory.r= esolveSourceFile(TransferAgentFactory.java:168) >>>>> at >>>>> = org.icenigrid.gridsam.core.plugin.transfer.protocol.TransferAgentFactory.<= init>(TransferAgentFactory.java:120) >>>>> at >>>>> = org.icenigrid.gridsam.core.plugin.transfer.provider.AFTFileTransferJob.exe= cute(AFTFileTransferJob.java:131) >>>>> at org.quartz.core.JobRunShell.run(JobRunShell.java:202) >>>>> at org.quartz.simpl.SimpleThreadPool >>>>> $WorkerThread.run(SimpleThreadPool.java:525) >>>>> Caused by: org.apache.commons.httpclient.NoHttpResponseException: = The >>>>> server magno failed to respond >>>>> at = org.apache.commons.httpclient.HttpMethodBase.readStatusLine(Unknown >>>>> Source) >>>>> at = org.apache.commons.httpclient.HttpMethodBase.readResponse(Unknown >>>>> Source) >>>>> at org.apache.commons.httpclient.HttpMethodBase.execute(Unknown = Source) >>>>> at >>>>> = org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unknown = Source) >>>>> at >>>>> = org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown >>>>> Source) >>>>> at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown >>>>> Source) >>>>> at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown >>>>> Source) >>>>> at >>>>> = org.apache.commons.vfs.provider.http.HttpClientFactory.createConnection(Ht= tpClientFactory.java:182) >>>>> ... 13 more >>>>>=20 >>>>> Maybe, the line numbers are not exactly correct since I have been = some >>>>> minor changes. The version of httpclient is 3.0.1 and vfs is 2.1. >>>>>=20 >>>>> I am very pleased of any help or advise. Best regards. >>>>=20 >>>>=20 >>>>=20 >>>> = --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org >>>> For additional commands, e-mail: user-help@commons.apache.org >>>>=20 >>> =20 >>=20 >>=20 >>=20 >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org >> For additional commands, e-mail: user-help@commons.apache.org >>=20 >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org