The Source for Java Technology Collaboration


Home | Changes | Index | Search | Go

DevelopingWithNetBeansPoint5

NOTE: THIS IS WORK IN PROGRESS

This page describes how to use NetBeans to develop, run and debug Wonderland 0.5. It assumes that you've read through the Developers Getting Started (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 aWonderland 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.
  1. In the NetBeans IDE, choose Versioning > Subversion > Checkout... from the main menu. The Checkout wizard opens.
  2. 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 >".
  3. 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.

    BrowseRepositoryFolders.png

  4. 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.

    NetBeansCheckout.png

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.

  1. 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.
  2. 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.

NetBeansOpenProjectCore.png

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.

RunServerMenuOption.png

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:

AttachDebugger.png

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 'Writing a New Wonderland Module'. In that tutorial you used NetBeans to develop a new 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:

  1. make the change to the module code
  2. use the menu option to deploy the module (this will update the code and restart the Wonderland server)
  3. restart the client (using the "Run" menu option)

DeployModuletoServer.png

Topic DevelopingWithNetBeansPoint5 . { Edit | Ref-By | Printable | Diffs r4 < r3 < r2 < r1 | More }
 XML java.net RSS

Revision r4 - 17 Dec 2008 - 20:20:50 - Main.bernard_horan
Parents: WebHome > ProjectWonderland > WonderlandRoadmap > WonderlandReleasepoint5