You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Kamran Manzoor <ka...@gmail.com> on 2023/03/16 14:31:22 UTC

NullPointerException while resolving dependency

Hi Folks,

I am new to Apache Ivy and I am using it to manage dependency in one of my
ant projects. All I want is to retrieve a jar from a custom URL (Bitbucket)
which requires Basic Authentication. However, I am getting
NullPointerException when I am trying to retrieve the jar with version
*2.5.1*.

*java.lang.NullPointerException at
org.apache.ivy.util.url.HttpClientHandler.getURLInfo(HttpClientHandler.java:243)*

I don't get NPE with *2.4.0* version of ivy but it does not send
credentials in the header. Any pointers/help will be greatly appreciated. I
have attached the simple example files here along with log files of both
the versions to reproduce the issue. Ant version is *1.10.7* for me.

[image: image.png]

Re: NullPointerException while resolving dependency

Posted by Stefan Bodewig <bo...@apache.org>.
On 2023-03-17, Stefan Bodewig wrote:

> On 2023-03-17, Stefan Bodewig wrote:

>> and will open a JIRA ticket attaching oyur files when using Apache
>> HttpClient.

> https://issues.apache.org/jira/browse/IVY-1641

should be fixed by
https://github.com/apache/ant-ivy/commit/c63ce79f52133857d1146cd2335d51178714effd

Stefan

Re: NullPointerException while resolving dependency

Posted by Stefan Bodewig <bo...@apache.org>.
On 2023-03-17, Stefan Bodewig wrote:

> and will open a JIRA ticket attaching oyur files when using Apache
> HttpClient.

https://issues.apache.org/jira/browse/IVY-1641

Stefan

Re: NullPointerException while resolving dependency

Posted by Stefan Bodewig <bo...@apache.org>.
On 2023-03-16, Kamran Manzoor wrote:

> I am new to Apache Ivy and I am using it to manage dependency in one of my
> ant projects. All I want is to retrieve a jar from a custom URL (Bitbucket)
> which requires Basic Authentication. However, I am getting
> NullPointerException when I am trying to retrieve the jar with version
> *2.5.1*.

> *java.lang.NullPointerException at
> org.apache.ivy.util.url.HttpClientHandler.getURLInfo(HttpClientHandler.java:243)*

> I don't get NPE with *2.4.0* version of ivy but it does not send
> credentials in the header. Any pointers/help will be greatly appreciated. I
> have attached the simple example files here along with log files of both
> the versions to reproduce the issue. Ant version is *1.10.7* for me.

I can reproduce the problem you see (and will open a JIRA ticket
attaching oyur files) when using Apache HttpClient. Everything works as
expected when not using Apache HttpClient but the "normal"
java.net.URLConnection based code path. At least I dodn't get any
exception, I haven't checked whether the credentials are included. Maybe
you can use this as a workaround until we get the bug fixed and a
patched release out.

Stefan