Re: Serializing restfb DefaultFacebookclient in a wicket facebook application
@Sebastian, I actually used the part you could also consider creating a new fbclient whenever you need one. I am using Guice but could not use request-scoped provider because the authToken string which is needed in constructing fbClient is gotten from pageparameters(for my case AppPage Parameters), so passing it to a provider was tricky. I am happy it works, I just used methods within AppPage class which construct and return restfb objects which means they r not part of page state hence no serialization needed. Thanks soo much. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Serializing-restfb-DefaultFacebookclient-in-a-wicket-facebook-application-tp3524700p3525647.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Serializing restfb DefaultFacebookclient in a wicket facebook application
I am building a facebook application in wicket using restfb api. After getting the authToken,I do the following in a wicket page: FacebookClient fbclient = new DefaultFacebookClient(authToken); However, I keep receiving the error: Error serializing object class com.mycompany.myApp.page.AppPage I know all model objects need to implement serializable, but DefaultFacebookClient is from restfb. How should I handle this? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Serializing-restfb-DefaultFacebookclient-in-a-wicket-facebook-application-tp3524700p3524700.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Serializing restfb DefaultFacebookclient in a wicket facebook application
I am building a facebook application in wicket using restfb api. After getting the authToken,I do the following in a wicket page: FacebookClient fbclient = new DefaultFacebookClient(authToken); However, I keep receiving the error: Error serializing object class com.mycompany.myApp.page.AppPage I know all model objects need to implement serializable, but DefaultFacebookClient is from restfb. How should I handle this? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Serializing-restfb-DefaultFacebookclient-in-a-wicket-facebook-application-tp3524707p3524707.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Serializing restfb DefaultFacebookclient in a wicket facebook application
I assume you create the fbclient within the AppPage class? If so, you'll need to store a serializable value/object in the page (or session) with which you can re-create the FacebookClient. Your authToken variable would be a good starting point, see if that is serializable. If so, store the authToken and re-create the FacebookClient for every request where you need it. Bas Op 15-5-2011 20:58, schreef labano10: I am building a facebook application in wicket using restfb api. After getting the authToken,I do the following in a wicket page: FacebookClient fbclient = new DefaultFacebookClient(authToken); However, I keep receiving the error: Error serializing object class com.mycompany.myApp.page.AppPage I know all model objects need to implement serializable, but DefaultFacebookClient is from restfb. How should I handle this? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Serializing-restfb-DefaultFacebookclient-in-a-wicket-facebook-application-tp3524707p3524707.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Serializing restfb DefaultFacebookclient in a wicket facebook application
@Sebastian, authToken is basically a string. So you are saying I store it in the wicket session, construct fbclient within session and call like session.getfbclient when I want to use it. Or didn't I get you right? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Serializing-restfb-DefaultFacebookclient-in-a-wicket-facebook-application-tp3524700p3524749.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Serializing restfb DefaultFacebookclient in a wicket facebook application
No, since a session will also be serialized at some point, you will have the same problem, only less frequent. What you can do is manage the client per request, either through a custom RequestCycle, or if you use google guice or something similar you can use a request-scoped provider. Either way: simply create the fbclient only once per request. I'm assuming that fbclient has some state which is needed in an interaction with facebook? If not, and construction is lightweight, you could also consider creating a new fbclient whenever you need one. Bas Op 15-5-2011 21:25, schreef labano10: @Sebastian, authToken is basically a string. So you are saying I store it in the wicket session, construct fbclient within session and call like session.getfbclient when I want to use it. Or didn't I get you right? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Serializing-restfb-DefaultFacebookclient-in-a-wicket-facebook-application-tp3524700p3524749.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org