# \[Solved\]Getting a NPE from a https-request

**URL:** <https://community.openhab.org/t/solved-getting-a-npe-from-a-https-request/13610>\
**Category:** Runtime\
**Tags:** https\
**Created:** [August 27, 2016, 4:01pm UTC](https://community.openhab.org/t/solved-getting-a-npe-from-a-https-request/13610 "2016-08-27T16:01:51Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![opus](https://community.openhab.org/user_avatar/community.openhab.org/opus/32/55801_2.png) [@opus](https://community.openhab.org/u/opus)\
**Post date:** [August 27, 2016, 4:01pm UTC](https://community.openhab.org/t/solved-getting-a-npe-from-a-https-request/13610/1 "2016-08-27T16:01:51Z")

</div>

Hi,  
I’m using a HTTPS-request in a rule like:

> var String URL= “[https://creativecommons.tankerkoenig.de/json/prices.php?ids=](https://creativecommons.tankerkoenig.de/json/prices.php?ids=)” + Tankstelle1\_ID + “,” +Tankstelle2\_ID + “,” + Tankstelle3\_ID + “&apikey=” + API\_Key  
> var String json = sendHttpGetRequest(URL)

which is raising the following error:

> 17:57:50.064 [ERROR] [lipse.smarthome.io.net.http.HttpUtil] - Fatal transport error: java.util.concurrent.ExecutionException: java.lang.NullPointerException

I did put in the start-ssl certificates in the jre/lib/security folder.

The output of the above https request, pasted into the browser (with the correct IDs) return the expected JSON-string.  
What could be the cause of that error?

---

<div class="post-metadata">

**Author:** ![watou](https://community.openhab.org/user_avatar/community.openhab.org/watou/32/70595_2.png) [@watou](https://community.openhab.org/u/watou)\
**Post date:** [August 28, 2016, 12:22am UTC](https://community.openhab.org/t/solved-getting-a-npe-from-a-https-request/13610/2 "2016-08-28T00:22:26Z")

</div>

> [@opus](#):
>
> var String URL= “[https://creativecommons.tankerkoenig.de/json/prices.php?ids=](https://creativecommons.tankerkoenig.de/json/prices.php?ids=)” + Tankstelle1\_ID + “,” +Tankstelle2\_ID + “,” + Tankstelle3\_ID + “&apikey=” + API\_Key

Could you log the URL you construct here to make sure it is what you expect it to be?

---

<div class="post-metadata">

**Author:** ![opus](https://community.openhab.org/user_avatar/community.openhab.org/opus/32/55801_2.png) [@opus](https://community.openhab.org/u/opus)\
**Post date:** [August 28, 2016, 6:28am UTC](https://community.openhab.org/t/solved-getting-a-npe-from-a-https-request/13610/3 "2016-08-28T06:28:03Z")

</div>

By saying " [quote=“opus, post:1, topic:13610”]  
The output of the above https request, pasted into the browser (with the correct IDs) return the expected JSON-string  
[/quote]  
I tried to state exact that.

[edit]  
I’m running a manual installation of the snapshot Build #456, using bindings Intertechno and HTTP (coming to think of it, HTTP isn’t needed if I only use the posted rule for http-requests)  
Hardware Raspbery 2

---

<div class="post-metadata">

**Author:** ![nokyyz](https://community.openhab.org/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@nokyyz](https://community.openhab.org/u/nokyyz)\
**Post date:** [August 28, 2016, 8:44pm UTC](https://community.openhab.org/t/solved-getting-a-npe-from-a-https-request/13610/4 "2016-08-28T20:44:39Z")

</div>

Hi,

I have a similar issue. I try to get the following URL in a rule:  
`sendHttpGetRequest("https://smsapi.free-mobile.fr/sendmsg?user=xx&pass=xx&msg=Alerte_inondation_Fuite_dans_le_frigo")`

My log:  
`2016-08-28 22:34:20.696 [ERROR] [lipse.smarthome.io.net.http.HttpUtil] - Fatal transport error: java.util.concurrent.ExecutionException: java.lang.NullPointerException`

My environment:

- OH2 : 2.0.0-SNAPSHOT - Build #456
- HTTP binding: org.openhab.binding.http-1.9.0-20160825.010928-150.jar

---

<div class="post-metadata">

**Author:** ![watou](https://community.openhab.org/user_avatar/community.openhab.org/watou/32/70595_2.png) [@watou](https://community.openhab.org/u/watou)\
**Post date:** [August 29, 2016, 5:33am UTC](https://community.openhab.org/t/solved-getting-a-npe-from-a-https-request/13610/5 "2016-08-29T05:33:38Z")

</div>

It’s possible that there is a relationship between [this PR](https://github.com/eclipse/smarthome/pull/1864) (merged 11 August) and the error you are seeing.

---

<div class="post-metadata">

**Author:** ![Kai](https://community.openhab.org/user_avatar/community.openhab.org/kai/32/116281_2.png) [@Kai](https://community.openhab.org/u/Kai)\
**Post date:** [August 29, 2016, 7:05am UTC](https://community.openhab.org/t/solved-getting-a-npe-from-a-https-request/13610/6 "2016-08-29T07:05:35Z")

</div>

Definitely yes. I created [NPE in HttpUtil when accessing a https url · Issue #2059 · eclipse-archived/smarthome · GitHub](https://github.com/eclipse/smarthome/issues/2059) for it.

---

<div class="post-metadata">

**Author:** ![Kai](https://community.openhab.org/user_avatar/community.openhab.org/kai/32/116281_2.png) [@Kai](https://community.openhab.org/u/Kai)\
**Post date:** [August 29, 2016, 9:57pm UTC](https://community.openhab.org/t/solved-getting-a-npe-from-a-https-request/13610/7 "2016-08-29T21:57:49Z")

</div>

The issue should be fixed in the latest distro #459 - please test and report back!

---

<div class="post-metadata">

**Author:** ![Kai](https://community.openhab.org/user_avatar/community.openhab.org/kai/32/116281_2.png) [@Kai](https://community.openhab.org/u/Kai)\
**Post date:** [August 30, 2016, 1:28pm UTC](https://community.openhab.org/t/solved-getting-a-npe-from-a-https-request/13610/8 "2016-08-30T13:28:11Z")

</div>

No news is hopefully good news 🙂

---

<div class="post-metadata">

**Author:** ![opus](https://community.openhab.org/user_avatar/community.openhab.org/opus/32/55801_2.png) [@opus](https://community.openhab.org/u/opus)\
**Post date:** [August 30, 2016, 1:47pm UTC](https://community.openhab.org/t/solved-getting-a-npe-from-a-https-request/13610/9 "2016-08-30T13:47:51Z")

</div>

I’m sorry. You reported that around midnight ( guess what I did at that time ). And now it is 16 houses laterI’m just ready to leave office. I will report back today

Too bad,I still have to go to work

---

<div class="post-metadata">

**Author:** ![Kai](https://community.openhab.org/user_avatar/community.openhab.org/kai/32/116281_2.png) [@Kai](https://community.openhab.org/u/Kai)\
**Post date:** [August 30, 2016, 2:02pm UTC](https://community.openhab.org/t/solved-getting-a-npe-from-a-https-request/13610/10 "2016-08-30T14:02:08Z")

</div>

> guess what I did at that time

Same as me? Fixing openHAB issues? Cool 🕶

No worries, take your time with testing as long as the result is positive!

---

<div class="post-metadata">

**Author:** ![opus](https://community.openhab.org/user_avatar/community.openhab.org/opus/32/55801_2.png) [@opus](https://community.openhab.org/u/opus)\
**Post date:** [August 30, 2016, 4:33pm UTC](https://community.openhab.org/t/solved-getting-a-npe-from-a-https-request/13610/11 "2016-08-30T16:33:06Z")

</div>

Excuse me, if I did sound to harsh in my last reply.

Installed last nigthly #462, running the rule with the “senHttpGetRequest” as above, getting the same error.  
Did I do something wrong?  
Could my update process be wrong (copied from docs/openhab2)?

What “log:set” should I use to take a deeper look?

[edit:] Error is showing with and without the " Circular reference detected, getService returning null" Error, which is coming during most startups.

[Edit2:]  
Removing the not needed Http-binding seemed to do the trick. I would say RESOLVED.  
But, why is the Http-binding causing this different behaviour?

---

<div class="post-metadata">

**Author:** ![Kai](https://community.openhab.org/user_avatar/community.openhab.org/kai/32/116281_2.png) [@Kai](https://community.openhab.org/u/Kai)\
**Post date:** [August 31, 2016, 7:20am UTC](https://community.openhab.org/t/solved-getting-a-npe-from-a-https-request/13610/12 "2016-08-31T07:20:46Z")

</div>

> [@opus](#):
>
> Excuse me, if I did sound to harsh in my last reply.

No worries, you did not!

> [@opus](#):
>
> Removing the not needed Http-binding seemed to do the trick. I would say RESOLVED.But, why is the Http-binding causing this different behaviour?

Is this on a FRESH installation? As soon as you install the http binding, the http rule action does not work anymore…?

---

<div class="post-metadata">

**Author:** ![opus](https://community.openhab.org/user_avatar/community.openhab.org/opus/32/55801_2.png) [@opus](https://community.openhab.org/u/opus)\
**Post date:** [August 31, 2016, 7:35am UTC](https://community.openhab.org/t/solved-getting-a-npe-from-a-https-request/13610/13 "2016-08-31T07:35:39Z")

</div>

I’m sorry, but I can’t say it for this sequence. Stupid me installed the Http binding (without any Http request for that binding) before loading the rule with the Https request.

[Edit]  
(Re)Loaded the Http-Binding into the working setup. After taht Https-Requests in the rule did show the error:

> 20:20:27.619 [ERROR] [lipse.smarthome.io.net.http.HttpUtil] - Fatal transport error: java.util.concurrent.TimeoutException

Removed the Binding and everything worked again.

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![nokyyz](https://community.openhab.org/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@nokyyz](https://community.openhab.org/u/nokyyz)\
**Post date:** [September 13, 2016, 9:18pm UTC](https://community.openhab.org/t/solved-getting-a-npe-from-a-https-request/13610/14 "2016-09-13T21:18:28Z")

</div>

Hi,  
My issue seems fixed in `2.0.0-SNAPSHOT - Build #474` (with HTTP binding `org.openhab.binding.http-1.9.0-20160909.010927-153.jar`).

Thanks !
