kinyerakenneth / lastfm-java

Automatically exported from code.google.com/p/lastfm-java
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Keep getting CallException: Caching/Reloading failed #46

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Use Proccessing.org (Java based) and the example of codasign: 
http://learning.codasign.com/index.php?title=Last.fm_Java_Client_in_Processing. 

What is the expected output? What do you see instead?
I would expect a working demo, which shows an album cover everytime I press the 
spacebar. But I keep getting the error:

Exception in thread "Animation Thread" de.umass.lastfm.CallException: 
Caching/Reloading failed
    at de.umass.lastfm.Caller.call(Caller.java:246)
    at de.umass.lastfm.Caller.call(Caller.java:189)
    at de.umass.lastfm.Caller.call(Caller.java:185)
    at de.umass.lastfm.Artist.getTopAlbums(Artist.java:173)
    at sketch_121220a.setup(sketch_121220a.java:51)
    at processing.core.PApplet.handleDraw(PApplet.java:2103)
    at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:190)
    at processing.core.PApplet.run(PApplet.java:2006)
    at java.lang.Thread.run(Thread.java:680)

What version of the product are you using? On what operating system?
lastfm-java plugin 0.1.2, Processing 2.0b6, Mac OSX (Mountain Lion) 

Please provide any additional information below.
I first thought the error would be in de code of the demo, but the 
CallException comes from the lastfm-java plugin. But I can't figure out what is 
wrong. 

I use my own api_key.

Original issue reported on code.google.com by braatb...@gmail.com on 21 Dec 2012 at 11:13

GoogleCodeExporter commented 9 years ago
I'm having this issue to, seems like there is something wrong with either 
placing or reading something from the cache. Changing the cache from a file 
system cache to a memory based cache doesn't seem to matter.

Original comment by jethroborsje on 25 Apr 2013 at 9:00

GoogleCodeExporter commented 9 years ago
on Android i fixed this problem with

Caller.getInstance().setCache(null);
Caller.getInstance().setUserAgent("tst");

Original comment by Z4H...@gmail.com on 25 Apr 2013 at 9:06

GoogleCodeExporter commented 9 years ago
I'm using Android as well and tried the solution of comment #2. Setting the 
cache to null was enough to get rid of the CallException. The 
setUserAgent("tst") call didn't seem to be needed.

Original comment by jethroborsje on 25 Apr 2013 at 9:25

GoogleCodeExporter commented 9 years ago
Thanks for that.

Will give it a go.

Original comment by danwms1...@gmail.com on 26 Apr 2013 at 4:09

GoogleCodeExporter commented 9 years ago
You are getting this exception because you are using this code that is not made 
for android.

Today I will make a patch if possible

Original comment by stermi on 7 May 2013 at 11:03

GoogleCodeExporter commented 9 years ago
Would be great, because this is a great library for android.

Original comment by jethroborsje on 7 May 2013 at 11:08

GoogleCodeExporter commented 9 years ago
I agree, this would be great if it could be optimised for Android.

Original comment by danwms1...@gmail.com on 7 May 2013 at 11:11

GoogleCodeExporter commented 9 years ago
On Android use Caller.setCache(new FileSystemCache(new 
File(Environment.getExternalStorageDirectory() + "/.lastfm")));

Or any other directory you want to use for the cache

Original comment by bolge...@gmail.com on 27 Mar 2014 at 2:59

GoogleCodeExporter commented 9 years ago
The problem is that the default filecache wants to place the files in the 
homefolder. To use the android internal storage for the cache use this in an 
activity:
Caller.getInstance().setCache(new FileSystemCache(new 
File(getCacheDir().getAbsolutePath())));

Original comment by svensktd...@gmail.com on 28 Jul 2014 at 3:57