views:

154

answers:

2

Hi.

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!

A: 

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.

ufk
A: 

Yes, it can work in Red5. Especially if you had it working in Tomcat, since we provide an embedded Tomcat server.

Mondain
it works only if i use the tomcat server and use jsp or servlet pages to fetch facebook information. I cannot fetch session information using red5 alone. correct me if i'm wrong.. (with examples :) )
ufk
With Tomcat being embedded within Red5 you are technically consuming the data with Red5 in addition to Tomcat. By that I mean you have access to any of the incoming data. This page describes the different ways to gain access to the different layers: http://wiki.red5.org/wiki/Documentation/Tutorials/Red5DeveloperTips/FiveWaysToApplicationAdapter #4 is usually of special interest to devs familiar with Tomcat or the Servlet API.
Mondain