Best approach? I might have to think more on that, but here's something that might work (a quick experiment on my end worked fine):
I'm guessing that you're getting that exception because you're trying to inject the Facebook bean into the class that has the @Async method. Then when you try to use it, there's not live request and so Spring can't create the instance of the Facebook bean (using the access token for the current user, which is only known at request time).
But what if you passed the already-created (at request time) instance to the @Async method that you're calling? For example:
Code:
myAsyncMethod(facebook.mediaOperations(), other, parameters);
Then in myAsyncMethod() you can do whatever you need with the MediaOperations that was passed in.
Craig Walls
Spring Social Project Lead