Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proxy can not be null #2550

Closed
unautre opened this issue Aug 2, 2018 · 3 comments
Closed

proxy can not be null #2550

unautre opened this issue Aug 2, 2018 · 3 comments

Comments

@unautre
Copy link
Contributor

unautre commented Aug 2, 2018

Hello,

Since I updated the version of the bnd gradle plugin we used, I end up with the integration tests (the testOSGi task) failing almost everytime, with those messages:

Download http://repository.amdatu.org/dependencies/org.apache.felix.gogo.command/org.apache.felix.gogo.command-1.0.2.jar
Download http://repository.amdatu.org/dependencies/org.apache.felix.http.jetty/org.apache.felix.http.jetty-3.2.0.jar
Download http://repository.amdatu.org/dependencies/org.apache.felix.http.servlet-api/org.apache.felix.http.servlet-api-1.1.2.jar
Download http://repository.amdatu.org/dependencies/org.apache.felix.eventadmin/org.apache.felix.eventadmin-1.3.2.jar
Download https://repository.amdatu.org/dependencies/org.apache.felix.http.servlet-api/org.apache.felix.http.servlet-api-1.1.2.jar
Download https://repository.amdatu.org/dependencies/org.apache.felix.eventadmin/org.apache.felix.eventadmin-1.3.2.jar
Download https://repository.amdatu.org/dependencies/org.apache.felix.gogo.command/org.apache.felix.gogo.command-1.0.2.jar
Download https://repository.amdatu.org/dependencies/org.apache.felix.http.jetty/org.apache.felix.http.jetty-3.2.0.jar
Tests not run because project has errors
error : null
error : Download java.lang.IllegalArgumentException: proxy can not be null
at java.net.URL.openConnection(URL.java:1014)
at aQute.bnd.http.HttpClient.getProxiedAndConfiguredConnection(HttpClient.java:415)
at aQute.bnd.http.HttpClient.send0(HttpClient.java:285)
at aQute.bnd.http.HttpClient.doCached0(HttpClient.java:272)
at aQute.bnd.http.HttpClient.doCached(HttpClient.java:166)
at aQute.bnd.http.HttpClient.send(HttpClient.java:142)
at aQute.bnd.http.HttpRequest$1.call(HttpRequest.java:206)
at aQute.lib.promise.PromiseExecutor$1.run(PromiseExecutor.java:23)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
null
error : Bundle file "java.lang.IllegalArgumentException: proxy can not be null
at java.net.URL.openConnection(URL.java:1014)
at aQute.bnd.http.HttpClient.getProxiedAndConfiguredConnection(HttpClient.java:415)
at aQute.bnd.http.HttpClient.send0(HttpClient.java:285)
at aQute.bnd.http.HttpClient.doCached0(HttpClient.java:272)
at aQute.bnd.http.HttpClient.doCached(HttpClient.java:166)
at aQute.bnd.http.HttpClient.send(HttpClient.java:142)
at aQute.bnd.http.HttpRequest$1.call(HttpRequest.java:206)
at aQute.lib.promise.PromiseExecutor$1.run(PromiseExecutor.java:23)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
: null" does not exist, given error is java.lang.IllegalArgumentException: proxy can not be null
at java.net.URL.openConnection(URL.java:1014)
at aQute.bnd.http.HttpClient.getProxiedAndConfiguredConnection(HttpClient.java:415)
at aQute.bnd.http.HttpClient.send0(HttpClient.java:285)
at aQute.bnd.http.HttpClient.doCached0(HttpClient.java:272)
at aQute.bnd.http.HttpClient.doCached(HttpClient.java:166)
at aQute.bnd.http.HttpClient.send(HttpClient.java:142)
at aQute.bnd.http.HttpRequest$1.call(HttpRequest.java:206)
at aQute.lib.promise.PromiseExecutor$1.run(PromiseExecutor.java:23)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

We have a corporate proxy that is configured in the ~/.bnd/connection-settings.xml, and removing those fixes the problem (but asks us to provide all dependencies through our repository).
Has anyone ever had this ?

The version of the gradle plugin is as follow: biz.aQute.bnd:biz.aQute.bnd.gradle:3.5.0
Gradle version is 3.2.1
Java version used is the Oracle 1.8.0_112 JDK.

P.S.: I will try to reproduce this problem on a minimal repository ASAP.

@pkriens
Copy link
Member

pkriens commented Aug 2, 2018 via email

@unautre
Copy link
Contributor Author

unautre commented Aug 23, 2018

Hello,
I cannot try Bnd 4.0.0 as I am stuck with an old Gradle version (3.2.1).

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                          http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <proxies>
        <proxy>
            <active>true</active>
            <protocol>http</protocol>
            <host>proxy</host>
            <port>8080</port>
            <nonProxyHosts>thelocalrepository</nonProxyHosts>
        </proxy>
    </proxies>
    <servers>
        <server>
            <id>https://fab22:8443</id>
            <username>secretusername</username>
            <password>verysecretpassword</password>
        </server>
    </servers>
</settings>

After much debugging, I found the culprit to be a race condition in ConnectionSettings.java and I just issued a pull request.

@bjhargrave
Copy link
Member

I cannot try Bnd 4.0.0

Thanks for the PR, but the fix will be in Bnd 4.1. So if you cannot upgrade Bnd, I am not sure how your will be able to benefit from the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants