You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jclouds.apache.org by Jeremiah Robertson <jr...@gmail.com> on 2014/03/28 22:26:21 UTC

null connecting error

I have a setup for using jclouds on Android, specifically for using
serviceloader and some other java features that don't instantly translate
over to Android. Anyways, I'm still getting the HTTPResponseException: null
connecting to POST
https://identity.api.rackspacecloud.com/v2.0/tokensHTTP/1.1 when
trying to pull down the list of servers in my rackspace
cloud. I'm guessing it has something to do with the URI/HTTP properties in
Android vs. Java but I have no idea where the change would take place or
exactly what causes this error to come up. I'm also getting a simultaneous
NullPointerException after the code finishes, so there is probably a null
value being sent to Guava that shouldn't be. Any help would be amazing.

Thank you,

-- 
Jeremiah Robertson
Georgia Tech
Aerospace Engineering

Re: null connecting error

Posted by Everett Toews <ev...@RACKSPACE.COM>.
jclouds uses GSON [1] as it’s default JSON parser. Could you give that a try?

Everett

[1] https://code.google.com/p/google-gson/


On Apr 7, 2014, at 1:59 PM, Jeremiah Robertson <jr...@gmail.com>> wrote:

Here is the return from the wire log:

POST https://identity.api.rackspacecloud.com/v2.0/tokens HTTP/1.1
-  >> POST https://identity.api.rackspacecloud.com/v2.0/tokens HTTP/1.1
-  >> Accept: application/json
-  >> Accept: application/json
-  >> Content-Type: application/json
-  >> Content-Type: application/json
-  >> Content-Length: 109
-  >> Content-Length: 109
-  << HTTP/1.1 200 OK
-  << VIA: 1.0 Repose (Repose/2.3.5)
-  << Transfer-Encoding: chunked
-  << Date: Mon, 07 Apr 2014 19:51:18 GMT
-  << Front-End-Https: on
-  << Connection: keep-alive
-  << vary: Accept, Accept-Encoding, X-Auth-Token
-  << Server: nginx/0.8.55
-  << Content-Type: application/json
-  << HTTP/1.1 200 OK
-  << VIA: 1.0 Repose (Repose/2.3.5)
-  << Transfer-Encoding: chunked
-  << Date: Mon, 07 Apr 2014 19:51:18 GMT
-  << Front-End-Https: on
-  << Connection: keep-alive
-  << vary: Accept, Accept-Encoding, X-Auth-Token
-  << Server: nginx/0.8.55
-  << Content-Type: application/json
<< "{"access":{"token":{"id":"dd5b5f7194634a60936fa03effa9f22c","expires":"2014-04-08T19:35:29.178Z","tenant":{"id":"884436","name":"884436"},"RAX-AUTH:authenticatedBy":["APIKEY"]},"serviceCatalog":[{"name":"cloudFilesCDN","endpoints":[{"region":"IAD","tenantId":"MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0","publicURL":"https:\/\/cdn5.clouddrive.com<http://cdn5.clouddrive.com/>\/v1\/MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0"},{"region":"SYD","tenantId":"MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0","publicURL":"https:\/\/cdn4.clouddrive.com<http://cdn4.clouddrive.com/>\/v1\/MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0"},{"region":"DFW","tenantId":"MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0","publicURL":"https:\/\/cdn1.clouddrive.com<http://cdn1.clouddrive.com/>\/v1\/MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0"},{"region":"HKG","tenantId":"MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0","publicURL":"https:\/\/cdn6.clouddrive.com<http://cdn6.clouddrive.com/>\/v1\/MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0"},{"region":"ORD","tenantId":"MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0","publicURL":"https:\/\/cdn2.clouddrive.com<http://cdn2.clouddrive.com/>\/v1\/MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0"}],"type":"rax:object-cdn"},{"name":"cloudFiles","endpoints":[{"region":"IAD","tenantId":"MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0","publicURL":"https:\/\/storage101.iad3.clouddrive.com<http://storage101.iad3.clouddrive.com/>\/v1\/MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0","internalURL":"https:\/\/snet-storage101.iad3.clouddrive.com<http://snet-storage101.iad3.clouddrive.com/>\/v1\/MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0"}
  Authenticated

I cut off a bunch of the JSON that was returned. I'm confused though because this is the right return so I'm not sure why it's not being parsed correctly in Android. Specifically at Line 1 Column 13 is where it errors which is where the NAME title appears. I did switch out the JAXB Parser for another parser so if JAXB is used to parse through the JSON and convert it then that would be something to look into, but I don't know the process of parsing the JSON that well.


On Sat, Apr 5, 2014 at 6:16 AM, Andrew Phillips <an...@apache.org>> wrote:
I just need to find the returned information so I can verify what it is.

That should be in the wire log? Could you attach the log file of the call, or repeat the call with cURL or so (i.e. without using jclouds)?

ap



--
Jeremiah Robertson
Georgia Tech Junior
Aerospace Engineering
Grand Challenges Program
jrspfd@gmail.com<ma...@gmail.com>
417.207.1563


Re: null connecting error

Posted by Jeremiah Robertson <jr...@gmail.com>.
Here is the return from the wire log:

POST https://identity.api.rackspacecloud.com/v2.0/tokens HTTP/1.1
-  >> POST https://identity.api.rackspacecloud.com/v2.0/tokens HTTP/1.1
-  >> Accept: application/json
-  >> Accept: application/json
-  >> Content-Type: application/json
-  >> Content-Type: application/json
-  >> Content-Length: 109
-  >> Content-Length: 109
-  << HTTP/1.1 200 OK
-  << VIA: 1.0 Repose (Repose/2.3.5)
-  << Transfer-Encoding: chunked
-  << Date: Mon, 07 Apr 2014 19:51:18 GMT
-  << Front-End-Https: on
-  << Connection: keep-alive
-  << vary: Accept, Accept-Encoding, X-Auth-Token
-  << Server: nginx/0.8.55
-  << Content-Type: application/json
-  << HTTP/1.1 200 OK
-  << VIA: 1.0 Repose (Repose/2.3.5)
-  << Transfer-Encoding: chunked
-  << Date: Mon, 07 Apr 2014 19:51:18 GMT
-  << Front-End-Https: on
-  << Connection: keep-alive
-  << vary: Accept, Accept-Encoding, X-Auth-Token
-  << Server: nginx/0.8.55
-  << Content-Type: application/json
<<
"{"access":{"token":{"id":"dd5b5f7194634a60936fa03effa9f22c","expires":"2014-04-08T19:35:29.178Z","tenant":{"id":"884436","name":"884436"},"RAX-AUTH:authenticatedBy":["APIKEY"]},"serviceCatalog":[{"name":"cloudFilesCDN","endpoints":[{"region":"IAD","tenantId":"MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0","publicURL":"https:\/\/
cdn5.clouddrive.com
\/v1\/MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0"},{"region":"SYD","tenantId":"MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0","publicURL":"https:\/\/
cdn4.clouddrive.com
\/v1\/MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0"},{"region":"DFW","tenantId":"MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0","publicURL":"https:\/\/
cdn1.clouddrive.com
\/v1\/MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0"},{"region":"HKG","tenantId":"MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0","publicURL":"https:\/\/
cdn6.clouddrive.com
\/v1\/MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0"},{"region":"ORD","tenantId":"MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0","publicURL":"https:\/\/
cdn2.clouddrive.com
\/v1\/MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0"}],"type":"rax:object-cdn"},{"name":"cloudFiles","endpoints":[{"region":"IAD","tenantId":"MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0","publicURL":"https:\/\/
storage101.iad3.clouddrive.com
\/v1\/MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0","internalURL":"https:\/\/
snet-storage101.iad3.clouddrive.com
\/v1\/MossoCloudFS_7eaf02d4-10a3-49bd-86f9-f37e3ac71aa0"}
  Authenticated

I cut off a bunch of the JSON that was returned. I'm confused though
because this is the right return so I'm not sure why it's not being parsed
correctly in Android. Specifically at Line 1 Column 13 is where it errors
which is where the NAME title appears. I did switch out the JAXB Parser for
another parser so if JAXB is used to parse through the JSON and convert it
then that would be something to look into, but I don't know the process of
parsing the JSON that well.


On Sat, Apr 5, 2014 at 6:16 AM, Andrew Phillips <an...@apache.org> wrote:

> I just need to find the returned information so I can verify what it is.
>>
>
> That should be in the wire log? Could you attach the log file of the call,
> or repeat the call with cURL or so (i.e. without using jclouds)?
>
> ap
>



-- 
Jeremiah Robertson
Georgia Tech Junior
Aerospace Engineering
Grand Challenges Program
jrspfd@gmail.com
417.207.1563

Re: null connecting error

Posted by Andrew Phillips <an...@apache.org>.
> I just need to find the returned information so I can verify what it is.

That should be in the wire log? Could you attach the log file of the  
call, or repeat the call with cURL or so (i.e. without using jclouds)?

ap

Re: null connecting error

Posted by Jeremiah Robertson <jr...@gmail.com>.
Yeah I'm calling getconfigurezones from the nodeapimetadata class and when it returns the JSON it gives the error. I also have the headers being sent and they look right. I just need to find the returned information so I can verify what it is.

Jeremiah Robertson
Georgia Tech
Aerospace Engineering
jrspfd@gmail.com

On Apr 4, 2014, at 6:33 PM, Andrew Phillips <an...@apache.org> wrote:

>> JSON/GSON returned from the POST request), and again if anyone had any
>> ideas on how to fix this. I wouldn't think the OkHTTP engine would affect
>> the POST request at all but I'm not quite sure. Thank you!
> 
> It shouldn't really, indeed. Which call are you making? And can you enable wire and header logging [1] to see what's going back and forth..?
> 
> Thanks!
> 
> ap
> 
> [1] http://jclouds.apache.org/reference/logging/

Re: null connecting error

Posted by Andrew Phillips <an...@apache.org>.
> JSON/GSON returned from the POST request), and again if anyone had any
> ideas on how to fix this. I wouldn't think the OkHTTP engine would affect
> the POST request at all but I'm not quite sure. Thank you!

It shouldn't really, indeed. Which call are you making? And can you  
enable wire and header logging [1] to see what's going back and forth..?

Thanks!

ap

[1] http://jclouds.apache.org/reference/logging/

Re: null connecting error

Posted by Jeremiah Robertson <jr...@gmail.com>.
I'm now getting a JSON parsing error where an object is returned within the
array but it tried to parse it as an array and throws an error ("Expected
BEGIN_ARRAY but was BEGIN_OBJECT"). I was wondering where/how I could find
the actual JSON/GSON being returned (which class contains the actual
JSON/GSON returned from the POST request), and again if anyone had any
ideas on how to fix this. I wouldn't think the OkHTTP engine would affect
the POST request at all but I'm not quite sure. Thank you!


On Thu, Apr 3, 2014 at 10:28 PM, Andrew Phillips <an...@apache.org> wrote:

> other classes. Additionally, android utilizes org.apache.harmony for the
>> sslsocket calls. I wasn't sure if you guys had any time to maybe provide
>> some help, but if you do, I would greatly appreciate it. Thank you.
>>
>
> Thanks for the extra info, Jeremiah! I hope someone with more Android
> expertise will be able to help...
>
> ap
>



-- 
Jeremiah Robertson
Georgia Tech Junior
Aerospace Engineering
Grand Challenges Program
jrspfd@gmail.com
417.207.1563

Re: null connecting error

Posted by Andrew Phillips <an...@apache.org>.
> Ignasi, you are a miracle worker. :)

Go Ignasi! ;-)

ap

Re: null connecting error

Posted by Jeremiah Robertson <jr...@gmail.com>.
Ignasi, you are a miracle worker. :) Thank you so much for your help. The
OkHttp code worked like a charm. I will let you know if I run into any more
trouble. Have a great day!


On Fri, Apr 4, 2014 at 3:26 AM, Ignasi Barrera <na...@apache.org> wrote:

> Hi Jeremiah,
>
> Could you try configuring the jclouds OkHttp driver [1] and see if it
> fixes your connection issues? In the README you'll find how to configure it
> when creating the context.
>
> Depending on the provider you are using, it might not work, as it has some
> rules for the HTTP verbs (such as not allowing DELETE operations with a
> body IIRC, and so on), but it's worth trying it, as OkHttp is designed for
> Android.
>
> Let us know if it helps!
>
> Ignasi
>
> [1] https://github.com/jclouds/jclouds/tree/master/drivers/okhttp
> El 04/04/2014 04:29, "Andrew Phillips" <an...@apache.org> escribió:
>
>>  other classes. Additionally, android utilizes org.apache.harmony for the
>>> sslsocket calls. I wasn't sure if you guys had any time to maybe provide
>>> some help, but if you do, I would greatly appreciate it. Thank you.
>>>
>>
>> Thanks for the extra info, Jeremiah! I hope someone with more Android
>> expertise will be able to help...
>>
>> ap
>>
>


-- 
Jeremiah Robertson
Georgia Tech Junior
Aerospace Engineering
Grand Challenges Program
jrspfd@gmail.com
417.207.1563

Re: null connecting error

Posted by Ignasi Barrera <na...@apache.org>.
Hi Jeremiah,

Could you try configuring the jclouds OkHttp driver [1] and see if it fixes
your connection issues? In the README you'll find how to configure it when
creating the context.

Depending on the provider you are using, it might not work, as it has some
rules for the HTTP verbs (such as not allowing DELETE operations with a
body IIRC, and so on), but it's worth trying it, as OkHttp is designed for
Android.

Let us know if it helps!

Ignasi

[1] https://github.com/jclouds/jclouds/tree/master/drivers/okhttp
El 04/04/2014 04:29, "Andrew Phillips" <an...@apache.org> escribió:

> other classes. Additionally, android utilizes org.apache.harmony for the
>> sslsocket calls. I wasn't sure if you guys had any time to maybe provide
>> some help, but if you do, I would greatly appreciate it. Thank you.
>>
>
> Thanks for the extra info, Jeremiah! I hope someone with more Android
> expertise will be able to help...
>
> ap
>

Re: null connecting error

Posted by Andrew Phillips <an...@apache.org>.
> other classes. Additionally, android utilizes org.apache.harmony for the
> sslsocket calls. I wasn't sure if you guys had any time to maybe provide
> some help, but if you do, I would greatly appreciate it. Thank you.

Thanks for the extra info, Jeremiah! I hope someone with more Android  
expertise will be able to help...

ap

Re: null connecting error

Posted by Jeremiah Robertson <jr...@gmail.com>.
ok I think I know what is going on now. So in Android the error comes from
the bytes being greater than 0 in FixedLengthOutputStream.close() method.
There are 70 bytes that weren't sent in the outputstream, probably because
of the sslsocket. This method is called by the httpengine in
httpurlconnectionimpl. Android's libcore folder is the equivalent of the
sun package in jdk which includes HTTPEngine, HTTPURLConnectionImpl, and
other classes. Additionally, android utilizes org.apache.harmony for the
sslsocket calls. I wasn't sure if you guys had any time to maybe provide
some help, but if you do, I would greatly appreciate it. Thank you.


On Mon, Mar 31, 2014 at 8:51 AM, Jeremiah Robertson <jr...@gmail.com>wrote:

> I attached the stack trace output.
>
>
> On Sun, Mar 30, 2014 at 5:18 PM, Ignasi Barrera <ig...@gmail.com>wrote:
>
>> Thanks Jeremiah,
>>
>> The current code is hiding the real exception. The NPE that appears in
>> the logs is in the "servers.toString()" because the "servers" variable is
>> null, as the *real* exception happened in the try/catch block.
>>
>> The logs in the catch block, though, only print the exception message,
>> and it would be great to have the stacktrace to see the real error. Could
>> you add an "e.printStackTrace()" in the catch block so we can see the real
>> stacktrace?
>>
>>
>> Thanks!
>>
>>
>> On 29 March 2014 15:09, Jeremiah Robertson <jr...@gmail.com> wrote:
>>
>>> I've attached the code along with the log file. On lines 166 and 167 of
>>> the log.txt you can see the HTTPResponseException and null connection. The
>>> exceptions occur on line 59 in ListServersWithFiltering.java. The app
>>> starts with MainActivity, the user plugs in their information, passes it to
>>> TheGUI.java, which passes the credentials to ListServersWithFiltering to
>>> grab the server list. I'm grabbing the list in the background using
>>> AsyncTask to make sure that the use of threads and networks isn't causing
>>> the error since I'm using the main thread to fix the serviceloader issue in
>>> Android (that's why the META_INF folder is in there). I followed the error
>>> to line 200 of the NovaComputeServiceAdapter.class, which makes
>>> HTTPrequests and I think finally leads to line 499 of
>>> RestAnnotationprocessor.class where it builds the URI. This calls the apply
>>> method of URI, which uses the get method in
>>> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.class. This
>>> goes into the LocalCache.class in Guava to get the key, class, and loader
>>> where a null value is probably being passed somewhere (LocalCache line
>>> 2193) . Please let me know if you need any more info. To run it, you can
>>> import the project into Eclipse and run MainActivity. You will probably
>>> also need to add the jar files in /libraries to the buildpath, as well as
>>> copy the META_INF folder from src to bin/classes right before debugging.
>>> I'm guessing the exceptions are what is causing the NullPointerException
>>> later in the log. Thank you!
>>>
>>>
>>> On Fri, Mar 28, 2014 at 5:59 PM, Jeremy Daggett <
>>> jeremy.daggett@gmail.com> wrote:
>>>
>>>> Hi Jeremiah,
>>>>
>>>> Could you please provide us with some code and log files for this
>>>> exception?
>>>>
>>>> Take a look at the "Code" and "Logs" sections on the "Report a Bug"
>>>> page here: http://jclouds.apache.org/reference/report-a-bug/
>>>>
>>>> We should be able to better assist you once we have that info, thanks!
>>>> :)
>>>>
>>>> /jd
>>>>
>>>>
>>>> On Fri, Mar 28, 2014 at 2:26 PM, Jeremiah Robertson <jr...@gmail.com>wrote:
>>>>
>>>>> I have a setup for using jclouds on Android, specifically for using
>>>>> serviceloader and some other java features that don't instantly translate
>>>>> over to Android. Anyways, I'm still getting the HTTPResponseException: null
>>>>> connecting to POST https://identity.api.rackspacecloud.com/v2.0/tokensHTTP/1.1 when trying to pull down the list of servers in my rackspace
>>>>> cloud. I'm guessing it has something to do with the URI/HTTP properties in
>>>>> Android vs. Java but I have no idea where the change would take place or
>>>>> exactly what causes this error to come up. I'm also getting a simultaneous
>>>>> NullPointerException after the code finishes, so there is probably a null
>>>>> value being sent to Guava that shouldn't be. Any help would be amazing.
>>>>>
>>>>> Thank you,
>>>>>
>>>>> --
>>>>> Jeremiah Robertson
>>>>> Georgia Tech
>>>>> Aerospace Engineering
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Jeremiah Robertson
>>> Georgia Tech Junior
>>> Aerospace Engineering
>>> Grand Challenges Program
>>> jrspfd@gmail.com
>>> 417.207.1563
>>>
>>
>>
>
>
> --
> Jeremiah Robertson
> Georgia Tech Junior
> Aerospace Engineering
> Grand Challenges Program
> jrspfd@gmail.com
> 417.207.1563
>



-- 
Jeremiah Robertson
Georgia Tech Junior
Aerospace Engineering
Grand Challenges Program
jrspfd@gmail.com
417.207.1563

Re: null connecting error

Posted by Jeremiah Robertson <jr...@gmail.com>.
I attached the stack trace output.


On Sun, Mar 30, 2014 at 5:18 PM, Ignasi Barrera <ig...@gmail.com>wrote:

> Thanks Jeremiah,
>
> The current code is hiding the real exception. The NPE that appears in the
> logs is in the "servers.toString()" because the "servers" variable is null,
> as the *real* exception happened in the try/catch block.
>
> The logs in the catch block, though, only print the exception message, and
> it would be great to have the stacktrace to see the real error. Could you
> add an "e.printStackTrace()" in the catch block so we can see the real
> stacktrace?
>
>
> Thanks!
>
>
> On 29 March 2014 15:09, Jeremiah Robertson <jr...@gmail.com> wrote:
>
>> I've attached the code along with the log file. On lines 166 and 167 of
>> the log.txt you can see the HTTPResponseException and null connection. The
>> exceptions occur on line 59 in ListServersWithFiltering.java. The app
>> starts with MainActivity, the user plugs in their information, passes it to
>> TheGUI.java, which passes the credentials to ListServersWithFiltering to
>> grab the server list. I'm grabbing the list in the background using
>> AsyncTask to make sure that the use of threads and networks isn't causing
>> the error since I'm using the main thread to fix the serviceloader issue in
>> Android (that's why the META_INF folder is in there). I followed the error
>> to line 200 of the NovaComputeServiceAdapter.class, which makes
>> HTTPrequests and I think finally leads to line 499 of
>> RestAnnotationprocessor.class where it builds the URI. This calls the apply
>> method of URI, which uses the get method in
>> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.class. This
>> goes into the LocalCache.class in Guava to get the key, class, and loader
>> where a null value is probably being passed somewhere (LocalCache line
>> 2193) . Please let me know if you need any more info. To run it, you can
>> import the project into Eclipse and run MainActivity. You will probably
>> also need to add the jar files in /libraries to the buildpath, as well as
>> copy the META_INF folder from src to bin/classes right before debugging.
>> I'm guessing the exceptions are what is causing the NullPointerException
>> later in the log. Thank you!
>>
>>
>> On Fri, Mar 28, 2014 at 5:59 PM, Jeremy Daggett <jeremy.daggett@gmail.com
>> > wrote:
>>
>>> Hi Jeremiah,
>>>
>>> Could you please provide us with some code and log files for this
>>> exception?
>>>
>>> Take a look at the "Code" and "Logs" sections on the "Report a Bug" page
>>> here: http://jclouds.apache.org/reference/report-a-bug/
>>>
>>> We should be able to better assist you once we have that info, thanks! :)
>>>
>>> /jd
>>>
>>>
>>> On Fri, Mar 28, 2014 at 2:26 PM, Jeremiah Robertson <jr...@gmail.com>wrote:
>>>
>>>> I have a setup for using jclouds on Android, specifically for using
>>>> serviceloader and some other java features that don't instantly translate
>>>> over to Android. Anyways, I'm still getting the HTTPResponseException: null
>>>> connecting to POST https://identity.api.rackspacecloud.com/v2.0/tokensHTTP/1.1 when trying to pull down the list of servers in my rackspace
>>>> cloud. I'm guessing it has something to do with the URI/HTTP properties in
>>>> Android vs. Java but I have no idea where the change would take place or
>>>> exactly what causes this error to come up. I'm also getting a simultaneous
>>>> NullPointerException after the code finishes, so there is probably a null
>>>> value being sent to Guava that shouldn't be. Any help would be amazing.
>>>>
>>>> Thank you,
>>>>
>>>> --
>>>> Jeremiah Robertson
>>>> Georgia Tech
>>>> Aerospace Engineering
>>>>
>>>
>>>
>>
>>
>> --
>> Jeremiah Robertson
>> Georgia Tech Junior
>> Aerospace Engineering
>> Grand Challenges Program
>> jrspfd@gmail.com
>> 417.207.1563
>>
>
>


-- 
Jeremiah Robertson
Georgia Tech Junior
Aerospace Engineering
Grand Challenges Program
jrspfd@gmail.com
417.207.1563

Re: null connecting error

Posted by Ignasi Barrera <ig...@gmail.com>.
Thanks Jeremiah,

The current code is hiding the real exception. The NPE that appears in the
logs is in the "servers.toString()" because the "servers" variable is null,
as the *real* exception happened in the try/catch block.

The logs in the catch block, though, only print the exception message, and
it would be great to have the stacktrace to see the real error. Could you
add an "e.printStackTrace()" in the catch block so we can see the real
stacktrace?


Thanks!


On 29 March 2014 15:09, Jeremiah Robertson <jr...@gmail.com> wrote:

> I've attached the code along with the log file. On lines 166 and 167 of
> the log.txt you can see the HTTPResponseException and null connection. The
> exceptions occur on line 59 in ListServersWithFiltering.java. The app
> starts with MainActivity, the user plugs in their information, passes it to
> TheGUI.java, which passes the credentials to ListServersWithFiltering to
> grab the server list. I'm grabbing the list in the background using
> AsyncTask to make sure that the use of threads and networks isn't causing
> the error since I'm using the main thread to fix the serviceloader issue in
> Android (that's why the META_INF folder is in there). I followed the error
> to line 200 of the NovaComputeServiceAdapter.class, which makes
> HTTPrequests and I think finally leads to line 499 of
> RestAnnotationprocessor.class where it builds the URI. This calls the apply
> method of URI, which uses the get method in
> MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.class. This
> goes into the LocalCache.class in Guava to get the key, class, and loader
> where a null value is probably being passed somewhere (LocalCache line
> 2193) . Please let me know if you need any more info. To run it, you can
> import the project into Eclipse and run MainActivity. You will probably
> also need to add the jar files in /libraries to the buildpath, as well as
> copy the META_INF folder from src to bin/classes right before debugging.
> I'm guessing the exceptions are what is causing the NullPointerException
> later in the log. Thank you!
>
>
> On Fri, Mar 28, 2014 at 5:59 PM, Jeremy Daggett <je...@gmail.com>wrote:
>
>> Hi Jeremiah,
>>
>> Could you please provide us with some code and log files for this
>> exception?
>>
>> Take a look at the "Code" and "Logs" sections on the "Report a Bug" page
>> here: http://jclouds.apache.org/reference/report-a-bug/
>>
>> We should be able to better assist you once we have that info, thanks! :)
>>
>> /jd
>>
>>
>> On Fri, Mar 28, 2014 at 2:26 PM, Jeremiah Robertson <jr...@gmail.com>wrote:
>>
>>> I have a setup for using jclouds on Android, specifically for using
>>> serviceloader and some other java features that don't instantly translate
>>> over to Android. Anyways, I'm still getting the HTTPResponseException: null
>>> connecting to POST https://identity.api.rackspacecloud.com/v2.0/tokensHTTP/1.1 when trying to pull down the list of servers in my rackspace
>>> cloud. I'm guessing it has something to do with the URI/HTTP properties in
>>> Android vs. Java but I have no idea where the change would take place or
>>> exactly what causes this error to come up. I'm also getting a simultaneous
>>> NullPointerException after the code finishes, so there is probably a null
>>> value being sent to Guava that shouldn't be. Any help would be amazing.
>>>
>>> Thank you,
>>>
>>> --
>>> Jeremiah Robertson
>>> Georgia Tech
>>> Aerospace Engineering
>>>
>>
>>
>
>
> --
> Jeremiah Robertson
> Georgia Tech Junior
> Aerospace Engineering
> Grand Challenges Program
> jrspfd@gmail.com
> 417.207.1563
>

Re: null connecting error

Posted by Jeremy Daggett <je...@gmail.com>.
Hi Jeremiah,

Could you please provide us with some code and log files for this
exception?

Take a look at the "Code" and "Logs" sections on the "Report a Bug" page
here: http://jclouds.apache.org/reference/report-a-bug/

We should be able to better assist you once we have that info, thanks! :)

/jd


On Fri, Mar 28, 2014 at 2:26 PM, Jeremiah Robertson <jr...@gmail.com>wrote:

> I have a setup for using jclouds on Android, specifically for using
> serviceloader and some other java features that don't instantly translate
> over to Android. Anyways, I'm still getting the HTTPResponseException: null
> connecting to POST https://identity.api.rackspacecloud.com/v2.0/tokensHTTP/1.1 when trying to pull down the list of servers in my rackspace
> cloud. I'm guessing it has something to do with the URI/HTTP properties in
> Android vs. Java but I have no idea where the change would take place or
> exactly what causes this error to come up. I'm also getting a simultaneous
> NullPointerException after the code finishes, so there is probably a null
> value being sent to Guava that shouldn't be. Any help would be amazing.
>
> Thank you,
>
> --
> Jeremiah Robertson
> Georgia Tech
> Aerospace Engineering
>