You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Konrad Windszus (JIRA)" <ji...@apache.org> on 2018/06/05 15:07:00 UTC

[jira] [Resolved] (JCR-4313) SPI2DAV: Consider proxy environment variables for http client

     [ https://issues.apache.org/jira/browse/JCR-4313?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konrad Windszus resolved JCR-4313.
----------------------------------
    Resolution: Duplicate

> SPI2DAV: Consider proxy environment variables for http client
> -------------------------------------------------------------
>
>                 Key: JCR-4313
>                 URL: https://issues.apache.org/jira/browse/JCR-4313
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-spi2dav
>    Affects Versions: 2.17.3
>            Reporter: Konrad Windszus
>            Priority: Major
>
> It is currently impossible to use a proxy with spi2dav. E.g. when using vlt-rcp (which internally relies on spi2dav) I get the following error because the proxy set via the Java default environment variables is not considered:
> {code}
> 12:52:56 [DEBUG] Opening connection {}-><somehost>:4502
> 12:52:56 [DEBUG] http-outgoing-0: Shutdown connection
> 12:52:56 [DEBUG] Connection discarded
> 12:52:56 [DEBUG] Connection released: [id: 0][route: {}-><somehost>:4502][total kept alive: 0; route allocated: 0 of 20; total allocated: 0 of 20]
> 12:52:56 [DEBUG] Cancelling request execution
> 12:52:56 [ERROR] Error while retrieving src repository <somehost>:4502/crx/server/-/jcr:root/<some repo path>: javax.jcr.RepositoryException: java.net.UnknownHostException: <somehost>: System error
> {code}
> The stacktrace till the HTTP client is retrieved looks like this
> {code}
> at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:939)
> 	  at org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.getClient(RepositoryServiceImpl.java:530)
> 	  at org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.executeRequest(RepositoryServiceImpl.java:2802)
> 	  at org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.getRepositoryDescriptors(RepositoryServiceImpl.java:692)
> 	  at org.apache.jackrabbit.jcr2spi.RepositoryImpl.<init>(RepositoryImpl.java:82)
> 	  at org.apache.jackrabbit.jcr2spi.RepositoryImpl.create(RepositoryImpl.java:95)
> 	  at org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory.getRepository(Jcr2spiRepositoryFactory.java:163)
> 	  at org.apache.jackrabbit.client.RepositoryFactoryImpl.getRepository(RepositoryFactoryImpl.java:75)
> 	  at org.apache.jackrabbit.vault.davex.DAVExRepositoryFactory.createRepository(DAVExRepositoryFactory.java:110)
> 	  at org.apache.jackrabbit.vault.util.RepositoryProvider.createRepository(RepositoryProvider.java:65)
> 	  at org.apache.jackrabbit.vault.util.RepositoryProvider.getRepository(RepositoryProvider.java:52)
> 	  at org.apache.jackrabbit.vault.util.RepositoryCopier.copy(RepositoryCopier.java:197)
> 	  at org.apache.jackrabbit.vault.cli.CmdRcp.doExecute(CmdRcp.java:70)
> 	  at org.apache.jackrabbit.vault.cli.AbstractVaultCommand.doExecute(AbstractVaultCommand.java:46)
> 	  at org.apache.jackrabbit.vault.cli.AbstractVaultCommand.doExecute(AbstractVaultCommand.java:33)
> 	  at org.apache.jackrabbit.vault.util.console.commands.AbstractCommand.execute(AbstractCommand.java:37)
> 	  at org.apache.jackrabbit.vault.util.console.ExecutionContext.doExecute(ExecutionContext.java:171)
> 	  at org.apache.jackrabbit.vault.util.console.ExecutionContext.execute(ExecutionContext.java:132)
> 	  at org.apache.jackrabbit.vault.util.console.AbstractApplication.execute(AbstractApplication.java:302)
> 	  at org.apache.jackrabbit.vault.cli.VaultFsApp.execute(VaultFsApp.java:614)
> {code}
> The basic problem is that the {{Jcr2spiRepositoryFactory}} does not allow to explicitly configure a proxy via programmatic configuration nor does it internally consider the regular environment variables (compare with https://stackoverflow.com/questions/5165126/without-changing-code-how-to-force-httpclient-to-use-proxy-by-environment-varia).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)