bnd 'gradle :dist:build' fail because 'aQute.libg-3.2.0.jar' cannot be donwloaded.

15 views
Skip to first unread message

jan.winte...@gmail.com

unread,
Mar 31, 2017, 3:49:36 AM3/31/17
to bndtools-users
Hello,

I try to build bnd. But it fails because donwnload problem.

##############################################
# BND build
##############################################
# cd bnd
# sh ./gradlew :dist:build # FAILED 
---
09:30:44.301 [ERROR] [aQute.bnd.build.LoggingProgressPlugin] Failed java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused

##############################################
# WGET works find
##############################################
Resolving dl.bintray.com... 5.153.35.248
Connecting to dl.bintray.com|5.153.35.248|:443... connected.
HTTP request sent, awaiting response... 302
Resolving akamai.bintray.com... 104.86.53.234
Connecting to akamai.bintray.com|104.86.53.234|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 547469 (535K) [application/java-archive]
Saving to: 'aQute.libg-3.2.0.jar'

##############################################
# Simple Java have problems too
##############################################

{code:java}

package download;


import java.io.IOException;

import java.io.InputStream;

import java.net.URL;

import java.nio.file.Files;

import java.nio.file.Path;

import java.nio.file.Paths;

import java.nio.file.StandardCopyOption;


public class Main {


    public static void main(String[] args) throws IOException {

        Path target = Paths.get("/tmp/java-download/target");


        URL website = new URL("https://dl.bintray.com/bnd/dist/3.2.0/biz/aQute/bnd/aQute.libg/3.2.0/:aQute.libg-3.2.0.jar");


        if ("The redirect URL works fine".isEmpty())

            website = new URL(

                    "https://akamai.bintray.com/2e/2e4222351a72e50c6c0ab3f7c54c8fa8674cf9d0ee9f87af9801cc583824c992?__gda__=exp=1490946761~hmac=d25ab8cef2ef657f97dc148d7fb06be887f32c269bb4a40208abed7d3906ad3d&response-content-disposition=attachment%3Bfilename%3D%22aQute.libg-3.2.0.jar%22&response-content-type=application%2Fjava-archive&requestInfo=U2FsdGVkX1_tKFt0RxNERubJg13CP7UDaON4Ixqzavd63OPG2yqcUny6alrDOLBxvy6GQakkfoXF0VI5h_wZz9vReh5J6mz0UoZc4EHBMPZM4IO7x3C1TJfwsPmDMqcdSDloasg7P2gAKjDn05Y00w");

        try (InputStream in = website.openStream()) {

            Files.copy(in, target, StandardCopyOption.REPLACE_EXISTING);

        }

    }

}

{code}


Exception in thread "main" java.io.FileNotFoundException: https://dl.bintray.com/bnd/dist/3.2.0/biz/aQute/bnd/aQute.libg/3.2.0/:aQute.libg-3.2.0.jar

at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1624)

at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)

at java.net.URL.openStream(URL.java:1037)

at download.Main.main(Main.java:21)


Peter Kriens

unread,
Mar 31, 2017, 4:03:50 AM3/31/17
to bndtool...@googlegroups.com
For the simple Java code you need to follow redirects. Since there is a problem in Java with redirects (even if you tell it to follow redirects it refuses to redirect from https to http) we handle this inline. Notice that the bnd downloader tells you there is a ConnectionException, not a FileNotFoundException. This means that the code cannot contact the remote server, it is not a redirect problem. Notice that also in your Java code the URL you use has a ‘:’ before aQute: .2.0/:aQute.libg-3.2.0.jar

In my experience this is usually related to a firewall or proxy setup. Can it be the case that you have a proxy configured in your connection settings?

Kind regards,

Peter Kriens






-- 
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jan.winte...@gmail.com

unread,
Mar 31, 2017, 4:28:40 AM3/31/17
to bndtools-users
You are right Peter,

yesterday as I investigate some time regarding that issue 'https://github.com/bndtools/bnd/issues/1971 -connection-settings.... '. 
- I enabled the proxy-settings in settings.xml
- And forgot to revert :# 

It work`s if I disable proxy settings. 

Peter Kriens

unread,
Mar 31, 2017, 5:38:26 AM3/31/17
to bndtool...@googlegroups.com
Great! I like it when I do not have to fix it :-)

Kind regards,

Peter Kriens
Reply all
Reply to author
Forward
0 new messages