robospice icon indicating copy to clipboard operation
robospice copied to clipboard

Unchached request crashes with null pointer exception on getRequestCacheKey()

Open SjoerdvGestel opened this issue 10 years ago • 3 comments

Hello!

When executing an request without setting a cache name & duration, it crashes in some occations.

This is the crashlog for the issue:

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object com.octo.android.robospice.request.CachedSpiceRequest.getRequestCacheKey()' on a null object reference at com.octo.android.robospice.request.DefaultRequestRunner.processRequest(DefaultRequestRunner.java:163) at com.octo.android.robospice.request.DefaultRequestRunner$1.run(DefaultRequestRunner.java:221) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1120) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:820)

SjoerdvGestel avatar Mar 05 '15 09:03 SjoerdvGestel

Yeah check out UncachedSpiceService if its still named that.

It contains a different cache manager.

Andrew

On 5 March 2015 09:37:01 GMT+00:00, SjoerdvGestel [email protected] wrote:

When executing an request without setting a cache name & duration, it crashes in some occations.

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object com.octo.android.robospice.request.CachedSpiceRequest.getRequestCacheKey()' on a null object reference at com.octo.android.robospice.request.DefaultRequestRunner.processRequest(DefaultRequestRunner.java:163) at com.octo.android.robospice.request.DefaultRequestRunner$1.run(DefaultRequestRunner.java:221) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1120) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:820)


Reply to this email directly or view it on GitHub: https://github.com/stephanenicolas/robospice/issues/410

Sent from my Android device with K-9 Mail. Please excuse my brevity.

softwaremaverick avatar Mar 05 '15 18:03 softwaremaverick

Hey! Thanks for your reply... The SpiceService im using in this case is extending the UncachedSpiceService wich has the following CacheManager:

return new CacheManager() { @Override public <T> T saveDataToCacheAndReturnData(T data, Object cacheKey) throws CacheSavingException, CacheCreationException {

            return data;
        }
    };

is that still correct or is there a newer version available that fixes the issue?

SjoerdvGestel avatar Mar 17 '15 11:03 SjoerdvGestel

That'll be the one! :-)

On 17 March 2015 11:21:07 GMT+00:00, SjoerdvGestel [email protected] wrote:

Hey! Thanks for your reply... The SpiceService im using in this case is extending the UncachedSpiceService wich has the following CacheManager:

return new CacheManager() { @Override public <T> T saveDataToCacheAndReturnData(T data, Object cacheKey) throws CacheSavingException, CacheCreationException {

           return data;
       }
   };

is that still correct or is there a newer version available that fixes the issue?


Reply to this email directly or view it on GitHub: https://github.com/stephanenicolas/robospice/issues/410#issuecomment-82288678

Sent from my Android device with K-9 Mail. Please excuse my brevity.

softwaremaverick avatar Mar 17 '15 19:03 softwaremaverick