commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ismael Marín Carrión <i.ma...@fdi.ucm.es>
Subject [vfs] - Problem with httpclient
Date Wed, 02 Feb 2011 09:13:16 GMT
Dear all,

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.

I am writing you to get some advise of how solving the next problem.

GridSAM invokes httpclient classes from the HttpClientFactory class
(org.apache.commons.vfs.provider.http), in the method
createConnection().

public static HttpClient createConnection(HttpFileSystemConfigBuilder
builder, String scheme,
                                              String hostname, int port,
String username,
                                              String password,
FileSystemOptions fileSystemOptions)
            throws FileSystemException
    {
             ....
            client.executeMethod(new HeadMethod());
            ....
     }

I am not using any authentication mechanism, and so username and passwd
are null, but hostname, port and scheme has the proper values.

Thus, in executeMethod() method of the HttpClient class:

public int executeMethod(HostConfiguration hostconfig,
        final HttpMethod method, final HttpState state)
        throws IOException, HttpException  {
        ....
         HostConfiguration defaulthostconfig = getHostConfiguration();
        if (hostconfig == null) {
            hostconfig = defaulthostconfig;
        }
        URI uri = method.getURI();
       ....
}

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. 

The complete stack is:

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(HttpClientFactory.java:186)
at
org.apache.commons.vfs.provider.http.HttpClientFactory.createConnection(HttpClientFactory.java:53)
at
org.apache.commons.vfs.provider.http.HttpFileProvider.doCreateFileSystem(HttpFileProvider.java:97)
at
org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.getFileSystem(AbstractOriginatingFileProvider.java:103)
at
org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:82)
at
org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:66)
at
org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:706)
at
org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:623)
at
org.icenigrid.gridsam.core.plugin.transfer.protocol.AbstractTransferAgent.getFileObject(AbstractTransferAgent.java:239)
at
org.icenigrid.gridsam.core.plugin.transfer.protocol.TransferAgentFactory.resolveSourceFile(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.execute(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(HttpClientFactory.java:182)
... 13 more

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.

I am very pleased of any help or advise. Best regards.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message