I attached the stack trace output.

On Sun, Mar 30, 2014 at 5:18 PM, Ignasi Barrera <[email protected]>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 <[email protected]> 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 <[email protected]
>> > 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 <[email protected]>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
>> [email protected]
>> 417.207.1563
>>
>
>


-- 
Jeremiah Robertson
Georgia Tech Junior
Aerospace Engineering
Grand Challenges Program
[email protected]
417.207.1563
03-31 08:48:34.530: W/System.err(12237): 
org.jclouds.http.HttpResponseException: null connecting to POST 
https://identity.api.rackspacecloud.com/v2.0/tokens HTTP/1.1
03-31 08:48:34.540: W/System.err(12237):        at 
org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:163)
03-31 08:48:34.545: W/System.err(12237):        at 
org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.invoke(InvokeSyncToAsyncHttpMethod.java:129)
03-31 08:48:34.550: W/System.err(12237):        at 
org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.apply(InvokeSyncToAsyncHttpMethod.java:95)
03-31 08:48:34.550: W/System.err(12237):        at 
org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.apply(InvokeSyncToAsyncHttpMethod.java:1)
03-31 08:48:34.550: W/System.err(12237):        at 
org.jclouds.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156)
03-31 08:48:34.555: W/System.err(12237):        at 
org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123)
03-31 08:48:34.555: W/System.err(12237):        at 
$Proxy45.authenticateWithTenantNameAndCredentials(Native Method)
03-31 08:48:34.555: W/System.err(12237):        at 
org.jclouds.rackspace.cloudidentity.v2_0.functions.AuthenticateApiKeyCredentials.authenticateWithTenantName(AuthenticateApiKeyCredentials.java:49)
03-31 08:48:34.555: W/System.err(12237):        at 
org.jclouds.rackspace.cloudidentity.v2_0.functions.AuthenticateApiKeyCredentials.authenticateWithTenantName(AuthenticateApiKeyCredentials.java:37)
03-31 08:48:34.555: W/System.err(12237):        at 
org.jclouds.openstack.keystone.v2_0.functions.internal.BaseAuthenticator.apply(BaseAuthenticator.java:81)
03-31 08:48:34.560: W/System.err(12237):        at 
org.jclouds.openstack.keystone.v2_0.functions.internal.BaseAuthenticator.apply(BaseAuthenticator.java:36)
03-31 08:48:34.560: W/System.err(12237):        at 
com.google.common.cache.CacheLoader$FunctionToCacheLoader.load(CacheLoader.java:148)
03-31 08:48:34.560: W/System.err(12237):        at 
com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522)
03-31 08:48:34.560: W/System.err(12237):        at 
com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315)
03-31 08:48:34.560: W/System.err(12237):        at 
com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278)
03-31 08:48:34.565: W/System.err(12237):        at 
com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193)
03-31 08:48:34.565: W/System.err(12237):        at 
com.google.common.cache.LocalCache.get(LocalCache.java:3932)
03-31 08:48:34.565: W/System.err(12237):        at 
com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3936)
03-31 08:48:34.565: W/System.err(12237):        at 
com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4806)
03-31 08:48:34.565: W/System.err(12237):        at 
com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4812)
03-31 08:48:34.570: W/System.err(12237):        at 
org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule$2.get(KeystoneAuthenticationModule.java:234)
03-31 08:48:34.570: W/System.err(12237):        at 
org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule$2.get(KeystoneAuthenticationModule.java:231)
03-31 08:48:34.570: W/System.err(12237):        at 
org.jclouds.openstack.keystone.v2_0.suppliers.LocationIdToURIFromAccessForTypeAndVersion.get(LocationIdToURIFromAccessForTypeAndVersion.java:95)
03-31 08:48:34.570: W/System.err(12237):        at 
org.jclouds.openstack.keystone.v2_0.suppliers.LocationIdToURIFromAccessForTypeAndVersion.get(LocationIdToURIFromAccessForTypeAndVersion.java:54)
03-31 08:48:34.575: W/System.err(12237):        at 
org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:75)
03-31 08:48:34.575: W/System.err(12237):        at 
org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:1)
03-31 08:48:34.575: W/System.err(12237):        at 
com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522)
03-31 08:48:34.575: W/System.err(12237):        at 
com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315)
03-31 08:48:34.575: W/System.err(12237):        at 
com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278)
03-31 08:48:34.580: W/System.err(12237):        at 
com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193)
03-31 08:48:34.580: W/System.err(12237):        at 
com.google.common.cache.LocalCache.get(LocalCache.java:3932)
03-31 08:48:34.580: W/System.err(12237):        at 
com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3936)
03-31 08:48:34.580: W/System.err(12237):        at 
com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4806)
03-31 08:48:34.580: W/System.err(12237):        at 
org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:121)
03-31 08:48:34.585: W/System.err(12237):        at 
org.jclouds.location.functions.ZoneToEndpoint.apply(ZoneToEndpoint.java:52)
03-31 08:48:34.585: W/System.err(12237):        at 
org.jclouds.location.functions.ZoneToEndpoint.apply(ZoneToEndpoint.java:1)
03-31 08:48:34.585: W/System.err(12237):        at 
org.jclouds.rest.internal.RestAnnotationProcessor.getEndpointInParametersOrNull(RestAnnotationProcessor.java:499)
03-31 08:48:34.585: W/System.err(12237):        at 
org.jclouds.rest.internal.RestAnnotationProcessor.getEndpointFor(RestAnnotationProcessor.java:522)
03-31 08:48:34.585: W/System.err(12237):        at 
org.jclouds.rest.internal.RestAnnotationProcessor.apply(RestAnnotationProcessor.java:192)
03-31 08:48:34.590: W/System.err(12237):        at 
org.jclouds.rest.internal.RestAnnotationProcessor.apply(RestAnnotationProcessor.java:1)
03-31 08:48:34.590: W/System.err(12237):        at 
org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.toCommand(InvokeSyncToAsyncHttpMethod.java:238)
03-31 08:48:34.590: W/System.err(12237):        at 
org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.invoke(InvokeSyncToAsyncHttpMethod.java:123)
03-31 08:48:34.590: W/System.err(12237):        at 
org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.apply(InvokeSyncToAsyncHttpMethod.java:95)
03-31 08:48:34.590: W/System.err(12237):        at 
org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.apply(InvokeSyncToAsyncHttpMethod.java:1)
03-31 08:48:34.595: W/System.err(12237):        at 
org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
03-31 08:48:34.595: W/System.err(12237):        at 
com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:79)
03-31 08:48:34.595: W/System.err(12237):        at $Proxy51.listInDetail(Native 
Method)
03-31 08:48:34.595: W/System.err(12237):        at 
org.jclouds.openstack.nova.v2_0.compute.NovaComputeServiceAdapter.listNodes(NovaComputeServiceAdapter.java:200)
03-31 08:48:34.595: W/System.err(12237):        at 
org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies.listDetailsOnNodesMatching(AdaptingComputeServiceStrategies.java:123)
03-31 08:48:34.600: W/System.err(12237):        at 
org.jclouds.compute.internal.BaseComputeService.listNodesDetailsMatching(BaseComputeService.java:364)
03-31 08:48:34.600: W/System.err(12237):        at 
java.lang.reflect.Method.invokeNative(Native Method)
03-31 08:48:34.600: W/System.err(12237):        at 
java.lang.reflect.Method.invoke(Method.java:511)
03-31 08:48:34.600: W/System.err(12237):        at 
com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:37)
03-31 08:48:34.600: W/System.err(12237):        at 
$Proxy50.listNodesDetailsMatching(Native Method)
03-31 08:48:34.600: W/System.err(12237):        at 
com.example.androidguitool.ListServersWithFiltering.doInBackground(ListServersWithFiltering.java:59)
03-31 08:48:34.600: W/System.err(12237):        at 
com.example.androidguitool.ListServersWithFiltering.<init>(ListServersWithFiltering.java:44)
03-31 08:48:34.605: W/System.err(12237):        at 
com.example.androidguitool.TheGUI.onCreate(TheGUI.java:49)
03-31 08:48:34.605: W/System.err(12237):        at 
android.app.Activity.performCreate(Activity.java:5206)
03-31 08:48:34.605: W/System.err(12237):        at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
03-31 08:48:34.605: W/System.err(12237):        at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
03-31 08:48:34.605: W/System.err(12237):        at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
03-31 08:48:34.605: W/System.err(12237):        at 
android.app.ActivityThread.access$600(ActivityThread.java:140)
03-31 08:48:34.605: W/System.err(12237):        at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
03-31 08:48:34.605: W/System.err(12237):        at 
android.os.Handler.dispatchMessage(Handler.java:99)
03-31 08:48:34.605: W/System.err(12237):        at 
android.os.Looper.loop(Looper.java:137)
03-31 08:48:34.610: W/System.err(12237):        at 
android.app.ActivityThread.main(ActivityThread.java:4898)
03-31 08:48:34.610: W/System.err(12237):        at 
java.lang.reflect.Method.invokeNative(Native Method)
03-31 08:48:34.610: W/System.err(12237):        at 
java.lang.reflect.Method.invoke(Method.java:511)
03-31 08:48:34.610: W/System.err(12237):        at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
03-31 08:48:34.610: W/System.err(12237):        at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
03-31 08:48:34.610: W/System.err(12237):        at 
dalvik.system.NativeStart.main(Native Method)
03-31 08:48:34.610: W/System.err(12237): Caused by: 
android.os.NetworkOnMainThreadException
03-31 08:48:34.620: W/System.err(12237):        at 
android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1118)
03-31 08:48:34.620: W/System.err(12237):        at 
java.net.InetAddress.lookupHostByName(InetAddress.java:385)
03-31 08:48:34.620: W/System.err(12237):        at 
java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
03-31 08:48:34.620: W/System.err(12237):        at 
java.net.InetAddress.getAllByName(InetAddress.java:214)
03-31 08:48:34.625: W/System.err(12237):        at 
libcore.net.http.HttpConnection.<init>(HttpConnection.java:70)
03-31 08:48:34.625: W/System.err(12237):        at 
libcore.net.http.HttpConnection.<init>(HttpConnection.java:50)
03-31 08:48:34.625: W/System.err(12237):        at 
libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:340)
03-31 08:48:34.625: W/System.err(12237):        at 
libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87)
03-31 08:48:34.625: W/System.err(12237):        at 
libcore.net.http.HttpConnection.connect(HttpConnection.java:98)
03-31 08:48:34.625: W/System.err(12237):        at 
libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:315)
03-31 08:48:34.625: W/System.err(12237):        at 
libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:461)
03-31 08:48:34.625: W/System.err(12237):        at 
libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.connect(HttpsURLConnectionImpl.java:433)
03-31 08:48:34.625: W/System.err(12237):        at 
libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:289)
03-31 08:48:34.630: W/System.err(12237):        at 
libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:239)
03-31 08:48:34.630: W/System.err(12237):        at 
libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80)
03-31 08:48:34.630: W/System.err(12237):        at 
libcore.net.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:188)
03-31 08:48:34.630: W/System.err(12237):        at 
libcore.net.http.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:281)
03-31 08:48:34.630: W/System.err(12237):        at 
org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.writePayloadToConnection(JavaUrlHttpCommandExecutorService.java:305)
03-31 08:48:34.630: W/System.err(12237):        at 
org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.convert(JavaUrlHttpCommandExecutorService.java:192)
03-31 08:48:34.630: W/System.err(12237):        at 
org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.convert(JavaUrlHttpCommandExecutorService.java:1)
03-31 08:48:34.630: W/System.err(12237):        at 
org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:140)
03-31 08:48:34.630: W/System.err(12237):        ... 70 more

Reply via email to