Initializing FOPDF behind a proxy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Jmm
Reply | Threaded
Open this post in threaded view
|

Initializing FOPDF behind a proxy

Jmm
Hello,

At first sight, I seem to have an issue when "priming" fopdf on my unix machine on the corporate network (using a proxy).

I get the following exception:

jmm@BEBRPCDP1316:~/Projects/asciidoctor-fopdf$ ./fopdf ../DEPhandler/src/docbkx/DEPhandler.xml
Initializing application...
Downloading http://services.gradle.org/distributions/gradle-1.7-bin.zip

Exception in thread "main" java.lang.RuntimeException: java.net.UnknownHostException: services.gradle.org
        at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
        at org.gradle.wrapper.Install.createDist(Install.java:47)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: java.net.UnknownHostException: services.gradle.org
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:579)
        at java.net.Socket.connect(Socket.java:528)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:378)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:473)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:203)
        at sun.net.www.http.HttpClient.New(HttpClient.java:290)
        at sun.net.www.http.HttpClient.New(HttpClient.java:306)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:995)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:931)
        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:849)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1299)
        at org.gradle.wrapper.Download.downloadInternal(Download.java:59)
        at org.gradle.wrapper.Download.download(Download.java:45)
        at org.gradle.wrapper.Install$1.call(Install.java:60)
        at org.gradle.wrapper.Install$1.call(Install.java:47)
        at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
        ... 3 more
Failed to initialize application


The proxy is correctly configured (I use CNTLM to connect to the corporate proxy)
$ echo $http_proxy
http://localhost:3128/

Any idea where to look to fix it ? Note that I am completely ignorant of Gradle matters (but want to learn). There is maybe an other way to setup the proxy.

Jmm
Jmm
Reply | Threaded
Open this post in threaded view
|

Re: Initializing FOPDF behind a proxy

Jmm
additional note: I am able to resolve the name and download the zip from the browser.

Jmm
Jmm
Reply | Threaded
Open this post in threaded view
|

Re: Initializing FOPDF behind a proxy

Jmm
In reply to this post by Jmm
(my apologies for the silly question and wasted bandwidth. It was late )

I found the solution myself. For the record:

Gradle doesn't pick up proxy settings from the OS as one would expect. The proxy must configured in the ~/.gradle/gradle.properties file in the same manner as Maven's proxy is configured in the settings.xml.

Gradle proxy settings are described in details here : http://www.gradle.org/docs/current/userguide/build_environment.html (in section 20.2 in particular)

Jmm