[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] Invalid redirect location

Hi Stefan and Thomas,

Stefan Liebig wrote:
Can you follow the instructions in https://bugs.eclipse.org/bugs/show_bug.cgi?id=262831#c24 and check whether this (still) works? With this ECF should use the HttpUrlConnection. Maybe this works.

This should work as a work around...given that HttpUrlConnection doesn't do the same thing (but it's possible it will...so please report results either way).



Tschüß, Stefan

Thomas Hallgren wrote:
I found a problem in the Apache HttpClient that affects P2 in a bad way. I'm not sure how to deal with it though. Perhaps the ECF team can give some advice.

The problem occurs when trying to read the update site found at http://eclipse-cs.sourceforge.net/update/site.xml. This is an old style update site. Eventually, the UpdateSite.parseFeature attempts to download a feature jar. The server returns a redirect URL and that URL, when normalized, contains a space.

Shouldn't the (normalized) redirect URL not contain a space? I'm not sure what the spec says about client handling of redirect URLs, but I'll take a look. But in any case (whether httpclient is spec-correct or not), we'll see what we can do to fix/workaround.


The HttpMethodDirector.processRedirectResponse then makes an attempt to create an URI directly from that response without converting the space to a %20. The result is the exception below.

Is there any way to get around this problem?

I can think of two ways for us to workaround/handle:

1) Modify/patch httpclient (it might be useful to see if this has already been done to httpclient, but given that the 3.x stream isn't being work on any more I sort of doubt it).
2) handle httpclient redirect responses 'manually' within the httpclient provider and do the normalization (%20 insertion) as a work-around.


Scott



Regards, Thomas Hallgren


org.apache.commons.httpclient.InvalidRedirectLocationException: Invalid redirect location: http://sunet.dl.sourceforge.net/project/eclipse-cs/Update Site/v.5.0.0final/net.sf.eclipsecs.migration_5.0.0.200906281855-final-feature.jar


at org.apache.commons.httpclient.HttpMethodDirector.processRedirectResponse(HttpMethodDirector.java:619)

at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:179)

at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)

at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)

at org.eclipse.ecf.provider.filetransfer.httpclient.HttpClientRetrieveFileTransfer.performConnect(HttpClientRetrieveFileTransfer.java:992)

at org.eclipse.ecf.provider.filetransfer.httpclient.HttpClientRetrieveFileTransfer.openStreams(HttpClientRetrieveFileTransfer.java:584)

at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:808)

at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:506)

at org.eclipse.ecf.provider.filetransfer.retrieve.MultiProtocolRetrieveAdapter.sendRetrieveRequest(MultiProtocolRetrieveAdapter.java:98)

at org.eclipse.equinox.internal.p2.repository.FileReader.sendRetrieveRequest(FileReader.java:317)

at org.eclipse.equinox.internal.p2.repository.FileReader.readInto(FileReader.java:263)

at org.eclipse.equinox.internal.p2.repository.RepositoryTransport.download(RepositoryTransport.java:70)

at org.eclipse.equinox.internal.p2.repository.RepositoryTransport.download(RepositoryTransport.java:121)

at org.eclipse.equinox.internal.p2.updatesite.UpdateSite.parseFeature(UpdateSite.java:249)

at org.eclipse.equinox.internal.p2.updatesite.UpdateSite.loadFeaturesFromSite(UpdateSite.java:535)

at org.eclipse.equinox.internal.p2.updatesite.UpdateSite.loadFeatures(UpdateSite.java:441)

at org.eclipse.equinox.internal.p2.updatesite.RemoteFeaturesAction.perform(RemoteFeaturesAction.java:40)

at org.eclipse.equinox.internal.p2.updatesite.RemoteUpdateSiteAction.perform(RemoteUpdateSiteAction.java:48)

at org.eclipse.equinox.p2.publisher.Publisher.publish(Publisher.java:172)
at org.eclipse.equinox.internal.p2.updatesite.metadata.UpdateSiteMetadataRepositoryFactory.generateMetadata(UpdateSiteMetadataRepositoryFactory.java:125)


at org.eclipse.equinox.internal.p2.updatesite.metadata.UpdateSiteMetadataRepositoryFactory.initializeRepository(UpdateSiteMetadataRepositoryFactory.java:110)

at org.eclipse.equinox.internal.p2.updatesite.metadata.UpdateSiteMetadataRepositoryFactory.load(UpdateSiteMetadataRepositoryFactory.java:74)

at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.factoryLoad(MetadataRepositoryManager.java:54)

at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:669)

at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:617)

at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:92)

at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:88)



_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev

_______________________________________________ p2-dev mailing list p2-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/p2-dev