Under Construction -- Contributions welcome!
This page describes how to use NetBeans to develop, run and debug Wonderland 0.5. It assumes that you've read through the Download, Build, Configure, and Run from the Source Code tutorial. (The instructions on this page may be specific to version 6.5 of NetBeans, older versions differ slightly in their menu arrangements).
We'll describe how to use NetBeans to
- checkout the Wonderland source code
- opening the Wonderland projects
- run and debug the Wonderland server
- run and debug a Wonderland client
- deploy and debug a Wonderland module (for information on how to develop a module see Writing a New Wonderland Module, Part 1)
Using NetBeans to checkout the wonderland source code#Before starting, ensure that you've installed Subversion according to these instructions
- In the NetBeans IDE, choose Versioning > Subversion > Checkout... from the main menu. The Checkout wizard opens.
- In the first panel of the wizard, enter the URL for the Wonderland source code repository: https://wonderland.dev.java.net/svn/wonderland. If appropriate enter your java.net user name and password. Then click "Next >".
- In the Folders to Checkout panel of the wizard, specify the folder that you want to check out in the Repository Folder(s) field. To do this, click on the "Browse" button to the right of the field. From the Browse Repository Folders dialogue box that appears, you have a choice of selecting the trunk or one of the tags/branches. For the purposes of this tutorial, select the trunk folder labelled "trunk", as shown in the figure below. Click OK. The selected folder is then added to the Repository Folder(s) field.
- Select the checkbox 'Skip "trunk" and checkout only its content' and in the Local Folder field, enter a location on your computer where you want the source to be checked out. (We recommend creating a folder/directory named 'src/wonderland' to be used for this purpose.) Deselect the "Scan for NetBeans Projects after Checkout" option as we'll be covering that in the next stage of this tutorial. Ensure that your wizard resembles the figure below, then click Finish to initiate the check out action. The IDE checks out the specified sources and the IDE's status bar indicates the progress of the files downloading from the repository to your local working directory. You can also view files as they are being checked out from the Output window.
Opening Wonderland projects in NetBeans#The Wonderland source code Workspace contains several NetBeans projects. The two most important ones for the purposes of this tutorial are the ones from which the developer may run the server and run a client.
- To open the top-level Wonderland project, choose File > Open Project.. from the main menu of NetBeans. Navigate to the directory into which you checked out the Wonderland source code (e.g. ~/src) and select the Wonderland project.
- To open the project that contains the core of the Wonderland project, again choose File > Open Project... from the main menu of NetBeans and navigate to the directory into which you checked out the Wonderland source code. This time, rather than selecting the Wonderland project, click on the triangle to the left of the project to expand its contents. Select the NetBeans project named "core" as shown below, then click on the "Open Project" button.
You should now have two projects opened in your NetBeans projects pane: "wonderland" and "wonderland-core".
Run and Debug the Wonderland server from NetBeans#To run the Wonderland server, select the wonderland project in the NetBeans projects pane and bring up the right-hand-button menu, as shown below. From that menu, select the 'Run Server" option.
Note that this starts the Wonderland web server, and in turn the Darkstar-based Wonderland server. There is currently no option to start the Wonderland server directly.
To debug the Wonderland server, run the web server as above. In the admin UI (as described in the Wonderland Web-Based Administration Guide), click on "Server Status", and then the "edit" link next to the Darkstar server. Set the property "sgs.server.debug" to "true" using the web UI, and save your changes. The next time you restart the Darkstar server, it will wait for you to attach a debugger on port 8890 before starting up. To attach the debugger, use the "Attach Debugger..." option from the NetBeans "Debug" menu. Your settings should look like the picture below:
Run and Debug a Wonderland client from NetBeans#To run a Wonderland client, select the wonderland-core project in the NetBeans projects pane and bring up the right-hand-button menu. From that menu, select the 'Run" option. Alternatively, select "Run Project (wonderland-core)" from the Run menu of NetBeans.
Using NetBeans to debug a Wonderland client is almost identical. Rather than selecting the "Run" option from the right-hand-button menu, instead select "Debug". Alternatively, select "Debug Project (wonderland-core)" from the Debug menu of NetBeans.
Deploy and Debug a Wonderland module from NetBeans#In this section we assume that you have worked through at least Part 1 of 'Developing a New Cell'. In that tutorial you used NetBeans to develop a new "simple shape" module for Wonderland, and used the web-based UI to deploy it and then restart the Wonderland server. However, there's an option in NetBeans to remove some of this manual work.
If you select your module in the projects pane of NetBeans and bring up the right-hand-button menu (as shown below), you'll see a menu option "Deploy Module to Server". If you select this option your module will be built and deployed to the Wonderland server and the Wonderland server will be restarted. (NB: the Wonderland server must be running.) So, the general process for debugging a module is to:
- make the change to the module code
- use the menu option to deploy the module (this will update the code and restart the Wonderland server)
- restart the client (using the "Run" menu option)
Add new attachment
List of attachments
|Kind||Attachment Name||Size||Version||Date Modified||Author||Change note|
|AttachDebugger.png||28.1 kB||1||20-May-2011 03:48||220.127.116.11|
|BrowseRepositoryFolders.png||35.3 kB||1||20-May-2011 03:49||18.104.22.168|
|DeployModuletoServer.png||20.9 kB||1||20-May-2011 03:49||22.214.171.124|
|NetBeansCheckout.png||57.5 kB||1||20-May-2011 03:50||126.96.36.199|
|NetBeansOpenProjectCore.png||38.1 kB||1||20-May-2011 03:50||188.8.131.52|