Search code examples
red5facebook-java-api

facebook-java-api on red5, can they work together?


I have a Adobe Flash Builder GUI application that connects to Red5 to communicate. can i use the red5 to call facebook API calls? can anyone provide an example? all the examples that i can find are with tomcat.

thanks!


Solution

  • Unfortunately they can't.

    facebook-java-api cannot work with red5 because it requires the session data that does not pass into red5 and uses variables that i received only by a java Servlet.

    there is also a facebook java api called TinyFbClient (www.socialjava.com). this client is small, very easy to understand with very nice examples. here i didn't have to use sessions, but i do need to get the uid of the user i want to query on. the client side can forward that information when needed.

    TinyFbClient depends on jersey (http://download.java.net/maven/2/com/sun/jersey/) but unfortunately jersy does not compile on red5 properly. if you'll try to use the binary version you'll just get the error

     java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl
    

    and that is because the compiled binary cannot operate properly.

    I resolved the issue by installing tomcat and allowing the user to connect to tomcat first, with tomcat i fetch the session and the relevant facebook data, stores it in a database and then with red5 i manipulate the data as needed.

    hopefully this information will be found useful.

    update

    i had the previous error message because i did not copy the relevant jars (jersey and jsr311) to the red5 directory. unfortunately it did not solve the problem. i tried different versions of jersey (1.0.x,1.1.x,1.2). the code did compile but any calls to a facebook api would just stop the application.

    i decided to do the facebook information fetching part in tomcat and then to deliver it to red5.