Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-4313

SPI2DAV: Consider proxy environment variables for http client

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.17.3
    • None
    • jackrabbit-spi2dav
    • None

    Description

      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:

      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
      

      The stacktrace till the HTTP client is retrieved looks like this

      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)
      

      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).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kwin Konrad Windszus
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: