|
DevelopingBBB
How to setup a development environment for BigBlueButton 0.71
Note: If you are using BigBlueButton 0.80-beta, see setting up a development environment for 0.8.
Note: If you are using BigBlueButton 0.80-beta, see setting up a development environment for 0.8. Getting HelpWe're developers as well, and we know the importance of both well-written documentation and accessible developer support. If you have any problems when following the documentation below, please post your questions to bigbluebutton-dev mailing list, or visit the #bigbluebutton channel on Freenode, using IRC. Setting up a BigBlueButton Development EnvironmentTo setup a BigBlueButton development environment you need to download the BigBlueButtonVM. The VM has tools already set up which will get you up and running quickly. The VM has an added benefit in that you can develop on it from your Windows or Mac environment, where you can get access to Flash Builder. This document explains how to develop with the VM in mind. Tip: For connecting to your BigBlueButton VM via a terminal we recommend PuTTY. Acessing your VMFrom your Windows environment, you'll want to access the BigBlueButton source code that resides on your VM. To do this, login to the VM as firstuser and issue the following command bbb-conf --setup-samba This script will share the /home/firstuser/dev on your VM so you can access it from within Windows. Some editors (such as Eclipse) can only access drives (not network shares). To map this network share to a windows drive (e.g. V:), open Windows Explorer, hit the Alt key, and choose the menu command Tools -> Map Network Drive. For the path, enter \\<ip>\firstuser, the ip being the local address of your VM. See the BBBConf page for troubleshooting tips. Check Out the Source CodeType the following command to checkout BigBlueButton from our github repository. bbb-conf --checkout cd ~/dev/source/bigbluebutton git init git checkout v0.71a git checkout -b my_v0.71a The second last command switches your development environment to the code tagged for release at BigBlueButton 0.71a. The last command creates a new local branch for you to do development. See http://stackoverflow.com/questions/791959/how-to-use-git-to-download-a-particular-tag This will checkout into /home/firstuser/dev/source/bigbluebutton. Note - June 3, 2011: You want to checkout the source tagged for 0.71a as master is under active development for 0.8 and is currently not stable. If you want to learn more about Git, read the book Pro Git especially chapters 1, 2, 3, 5. GitHub Help has a lot of information too. Developing Components of BigBlueButtonWorking on the Client sideTo setup a development environment for bbb-client, enter the following command bbb-conf --setup-dev client This will setup some directories and modify nginx config to use your development client. Everything is now setup to compile bbb-client. To compile the client: cd ~/dev/source/bigbluebutton/bigbluebutton-client ant Behind the scenes, nginx is now loading the client from ~/dev/source/bigbluebutton/bigbluebutton-client/bin. If the IP address for your BigBlueButtom VM is 192.168.0.211, you should be able to browse to http://192.168.0.211/, login to the web interface, and see your new client load. Every time you make a change to the client source, you need to rebuild it using the 'ant' command in order for the changes to show in your browser. If you haven't changed the localization files then you only need to run ant modules This will skip building the localization .swf files, and save you a lot of time.
Using Flex/Flash BuilderTo develop the client using Flash Builder, follow these steps:
This approach is limited in the sense that you can't use the Run button within Flash Builder to launch the client. You also can't use the Flex debugger. To be able to launch the client from Flash Builder, do the following:
<application uri="rtmp://<HOST-IP>/bigbluebutton" host="http://<HOST-IP>/bigbluebutton/api/enter" /> to <application uri="rtmp://<HOST-IP>/bigbluebutton" host="conf/join-mock.xml" />
Your First Modification of BigBlueButtonAt this point we are going to adorn our rubber boots and jump right in. We are going to make a small modification to the UI so that you can start perusing the code.
<mx:Label text="My Modified BigBlueButton Client" id="copyrightLabel2"/>
Congradulations, you have now made your first change to BigBlueButton. Working with BigBlueButton Web - The API part of BBBThe BigBlueButton web interface is written in grails, so the development environment different from building the Client (bbb-client). As before, the first step is to use bbb-conf to setup the environment. Configure the environment bbb-conf --setup-dev web This script does the following steps: Note: If you get an error upload slides when running bbb-web as firstuser, run the command sudo chmod -R a+rwx /var/bigbluebutton. Stop Tomcat so you can compile your bbb-web sudo service tomcat6 stop Compile and run bbb-web cd ~/dev/source/bigbluebutton/bigbluebutton-web ant The default task for ant here is to make sure your libraries are up-to-date (using ivy), then execute the command grails run-app. This will output the console to the command line, making it easier for you to see any exceptions thrown by grails. To stop the grails server, just hit CTRL-C. Working with BigBlueButton-AppsThe BigBlueButton web apps run within the red5 server. Unlike development with bbb-client and bbb-web, where we could leave the packaged versions installed, there is only one red5 server on the VM. In order to do development with it we need to remove the existing bbb-apps first. (Don't worry, you can easily restore them as shown at the end of this section). Configure the environment bbb-conf --setup-dev apps This will
Uninstalling the existing bbb-apps package will stop the red5 server, remove the directory /usr/share/red5/webapps/bigbluebutton, and restart red5. At this point Red5 would have restarted. However, before we deploy the local version of bbb-apps, we need to stop the Red5 server. Open a new terminal window (you will need to start and stop Red5 as you develop) and stop Red5. sudo service red5 stop In version 0.71a, you will need to also add the local jar repository to your path: echo 'export FLAT_REPO=~/dev/repo' >> ~/.profile source ~/.profile We'll come back to this separate terminal window in a moment. Now, let's build and deploy the local copy of bbb-apps. cd ~/dev/source/bigbluebutton/bigbluebutton-apps/ gradle war deploy At this point, the ant script has copied the local build of bbb-apps to /usr/share/red5/webapps/bigbluebutton. Now switch back to the second terminal window and enter the following command: cd /usr/share/red5 sudo -u red5 ./red5.sh You'll now see all the output from red5 directly at the console. Like running the grails server at the command line, running red5 from the command line gives you easy visibility of any errors or exceptions that may occure. Using an IDE - Eclipse instructionsPre-requisitesAt this point it is assumed you have gone through setting up the client, bbb-web and bbb-apps environments and will be working with the BigBlueButton Virtual Machine. In this section, we will be Windows with Eclipse and Flash Builder. The following tools are installed in the Virtual Machine:
BigBlueButton Commons LibrariesThe bbb-commons contain classes that are common to bbb-web and bbb-apps.
cd ~/dev/source/bigbluebutton/bbb-common-message gradle eclipse gradle jar gradle uploadArchives BigBlueButton Web
cd ~/dev/source/bigbluebutton/bigbluebutton-web gradle copyToLib ant NOTE: If you encounter an error with the webapp redirecting to an invalid client, open the file ./grails-app/conf/bigbluebutton.properties and edit the line bigbluebutton.web.serverURL to point to the url of your machine. BigBlueButton Apps
cd ~/dev/source/bigbluebutton/bigbluebutton-apps gradle eclipse gradle resolveDeps gradle war sudo gradle deploy Video App
cd ~/dev/source/bigbluebutton/bbb-video ant resolve ant dist ant deploy Voice App
cd ~/dev/source/bigbluebutton/bbb-voice gradle resolveDeps gradle war gradle deploy Desktop Sharing App
cd ~/dev/source/bigbluebutton/deskshare gradle copyToLib cd app gradle war gradle deploy cd applet gradle jar ant create-signing-key ant sign-jar cp ~/dev/source/bigbluebutton/deskshare/applet/build/libs/bbb-deskshare-applet-0.64.jar ~/dev/source/bigbluebutton/bigbluebutton-client/resources/prod TipsRun bbb-conf --check Run sudo bbb-conf --check to see if there are any potential problems. Running Red5It is better to have multiple ssh windows while developing. On one window, you can start and stop Red5.
sudo service red5 stop cd /usr/share/red5 sudo -u red5 ./red5.sh In another window, you can make your code changes and deploy to Red5, e.g. cd ~/dev/source/git/bigbluebutton/bigbluebutton-apps
gradle war gradle deploy Removing BBB packagesList the BBB packages by typing dpkg -l | grep bbb which results: ii bbb-apps 0.71ubuntu2 BigBlueButton applications for Red5 ii bbb-apps-deskshare 0.71ubuntu2 BigBlueButton deskshare module for Red5 ii bbb-apps-sip 0.71ubuntu2 BigBlueButton SIP module for Red5 ii bbb-apps-video 0.71ubuntu2 BigBlueButton video module for Red5 ii bbb-client 0.71ubuntu15 BigBlueButton Flash client ii bbb-common 0.71ubuntu6 BigBlueButton common files ii bbb-config 0.71ubuntu6 BigBlueButton group package ii bbb-freeswitch-config 0.71ubuntu2 BigBlueButton group package ii bbb-openoffice-headless 0.71ubuntu2 BigBlueButton wrapper for OpenOffice ii bbb-voice-conference 0.71ubuntu3 BigBlueButton voice conference files ii bbb-web 0.71ubuntu4 BigBlueButton web interface ii bigbluebutton 0.71ubuntu4 Open Source Web Conferencing System (bbb)
Example, if you want to remove bbb-appssudo apt-get remove bbb-apps Creating a new BigBlueButton ModuleFollow this short tutorial. Record and Playback BranchThe following section is still under heavy development, and is only intended for developers with good programming experience. Setting upTBD TroubleshootingExecuting "ant" doesn't workCheck if environment is setup properly. Type env You should see FLEX_HOME=/home/firstuser/dev/tools/flex See if you are using the proper SDK. ls -lt ~/dev/tools/ You should see lrwxrwxrwx 1 firstuser firstuser 16 2011-10-18 19:12 flex -> flex-4.5.0.20967 See if the commands are executable ls -lt ~/dev/tools/flex-4.5.0.20967/bin/ You should see rwxrwx for all files -rwxrwx--- 1 firstuser firstuser 1487 2011-03-25 05:46 asdoc -rwxrwx--- 1 firstuser firstuser 1074 2011-03-25 05:46 fontswf -rwxrwx--- 1 firstuser firstuser 728 2011-03-25 05:46 aasdoc -rwxrwx--- 1 firstuser firstuser 728 2011-03-25 05:46 acompc -rwxrwx--- 1 firstuser firstuser 728 2011-03-25 05:46 amxmlc -rwxrwx--- 1 firstuser firstuser 586 2011-03-25 05:46 amxmlc.bat -rwxrwx--- 1 firstuser firstuser 106496 2011-03-25 05:46 asdoc.exe -rwxrwx--- 1 firstuser firstuser 1437 2011-03-25 05:46 compc -rwxrwx--- 1 firstuser firstuser 106496 2011-03-25 05:46 compc.exe -rwxrwx--- 1 firstuser firstuser 1441 2011-03-25 05:46 copylocale -rwxrwx--- 1 firstuser firstuser 106496 2011-03-25 05:46 copylocale.exe -rwxrwx--- 1 firstuser firstuser 1422 2011-03-25 05:46 digest -rwxrwx--- 1 firstuser firstuser 106496 2011-03-25 05:46 digest.exe -rwxrwx--- 1 firstuser firstuser 1422 2011-03-25 05:46 fcsh -rwxrwx--- 1 firstuser firstuser 106496 2011-03-25 05:46 fcsh.exe -rwxrwx--- 1 firstuser firstuser 1405 2011-03-25 05:46 fdb -rwxrwx--- 1 firstuser firstuser 106496 2011-03-25 05:46 fdb.exe -rwxrwx--- 1 firstuser firstuser 93 2011-03-25 05:46 fontswf.bat -rwxrwx--- 1 firstuser firstuser 1457 2011-03-25 05:46 jvm.config -rwxrwx--- 1 firstuser firstuser 1434 2011-03-25 05:46 mxmlc -rwxrwx--- 1 firstuser firstuser 106496 2011-03-25 05:46 mxmlc.exe -rwxrwx--- 1 firstuser firstuser 1441 2011-03-25 05:46 optimizer -rwxrwx--- 1 firstuser firstuser 106496 2011-03-25 05:46 optimizer.exe -rwxrwx--- 1 firstuser firstuser 1250 2011-03-25 05:46 swcdepends -rwxrwx--- 1 firstuser firstuser 106496 2011-03-25 05:46 swcdepends.exe -rwxrwx--- 1 firstuser firstuser 1259 2011-03-25 05:46 swfdump -rwxrwx--- 1 firstuser firstuser 106496 2011-03-25 05:46 swfdump.exe -rwxrwx--- 1 firstuser firstuser 586 2011-03-25 05:46 aasdoc.bat -rwxrwx--- 1 firstuser firstuser 586 2011-03-25 05:46 acompc.bat Returning to the Packaged ClientIf you ever wish to revert back to the bbb-client installed from packages, edit /etc/nginx/sites-available/bigbluebutton and make the entry for /client match the following. location /client {
root /var/www/bigbluebutton;
index index.html index.htm;
}Then restart nginx. sudo service nginx restart Returning to the Packaged BBB-WebIf you want to revert back to the web interface installed by the package bbb-web, stop grails and restart the tomcat6 server. sudo service tomcat6 start Note: After starting the tomcat server, try to join a conference. If you receive the message "The page you are looking for is temporarily unavailable. Please try again later.", then the grails server could still be running and not tomcat. Enter the following command sudo bbb-conf -c Look under the Potential Problems heading to see if a problem has been detected. If grails is still running then to resolve this we need to kill it.
ps -aef | grep grails sudo kill -9 <Grails PID> sudo service tomcat6 start Returning to the Packaged BBB-AppsIf you want to revert back to the packaged versions of BigBlueButton apps, do the following rm -rf /usr/share/red5/webapps/bigbluebutton sudo apt-get install bbb-apps sudo service red5 start Debugging FreeSWITCHTo start FreeSWITCH so you can see any errors produced by it run: sudo /opt/freeswitch/bin/fs_cli If voice isn't working in the BBB interface or your listeners are not showing up the most likely reason is that FreeSWITCH and Red5 are not communicating properly. Check the configuration files and make sure that FreeSWITCH and Red5 are pointing at each other. Edit /opt/freeswitch/conf/autoload_configs/event_socket.conf.xml. vi /opt/freeswitch/conf/autoload_configs/event_socket.conf.xml Check the listen-ip parameter <param name="listen-ip" value="192.168.0.211"/> Edit /usr/share/red5/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties Set esl.host to your IP esl.host=192.168.0.211 Lastly, make sure that the sip.server.host property in /usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties is set to your FreeSWITCH server. vi /usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties Edit the host address to match you own. sip.server.host=192.168.0.211 Note: Make sure your two Red5 IPs are ponting to FreeSWITCH and that your FreeSWITCH IP ip pointing to your Red5 sever. Otherwise, Red5 won't know what SIP server to use and both FreeSWITCH and Red5 won't be able to communicate events with eachother (stopping the voice users from showing up in the Listeners Window). Launching from Flex/Flash BuilderIf you get the compile error: unable to open 'W:\dev\source\bigbluebutton\bigbluebutton-client\tests\unit' bigbluebutton-client Unknown Flex Problem Just create the missing directories. This is a problem caused by an improperly generated .actionScriptProperties file in bbb-client/ If you get the compile error: The style 'backgroundImage' is only supported by type 'flexlib.mdi.containers.MDIWindow' with the theme(s) 'halo'. DesktopPublishWindow.mxml /bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components line 33 Flex Problem Right click on your project, go to Flex Compiler. Change SDK to 3.5, and Flash Player version to 10.0.0. If the client hangs at startup: and the last line in the log is: 8/31/2010 21:16:28.795 [DEBUG] Join FAILED = <join> <returncode>FAILED</returncode> <message>Could not find conference null.</message> </join> Make sure your config.xml file has the host property "conf/join-mock.xml". If your client throws an error at startup saying it cannot find the join-mock.xml, make sure you copy it over from bbb-client/resources/dev into bbb-client/src/conf. Helpful HintsIf you run into issues, please send email to the bigbluebutton-dev mailing list. Gradlegradle copyToLib has been changed to gradle resolveDeps, if one doesn't work, try the other as not all instances have been converted. The ClientIf you notice you are running a version other than the newest here is how to bring your copy of the code upto date. The Git Repository is tagged to not give out the latest development version. This way the code you are using is never broken. To get the master version: git pull origin master BigBlueButton WebYou will need to run the grails version of bigbluebutton-web which will allow you to see debugging information. Make sure tomcat6 is stopped and swich to the bigbluebutton-web directory. sudo service tomcat6 stop cd ~/dev/source/bigbluebutton/bigbluebutton-web
Now run the war file grails run-war Setting up a development on a package installationAt the moment, the script bbb-conf is written to work for setting up a development environment only within the VM, not within a target BigBlueButton server that has been installed via packages. Why? The short answer is there are a lot of steps to properly setting up a development environment. You'll also see in the VM that the tools already installed in the /home/firstuser/dev/tools folder, as well as environment variables already setup in /home/firstuser/.profile file in anticipation of development. Furthermore, there are a lot of commands needed to be run to setup the development environment correctly, and most everything is done for you by bbb-conf (you can take a look at the source for bbb-conf in /usr/local/bin/bbb-conf to see the commands that get run). We recommend you use the BigBlueButton VM for development. However, if you want to setup a development environment on a target BigBlueButton installed via packages, see non-VM Development Setup.
| |