Netbeans Cheatsheet for Aida Development

This page gives help on using the Netbeans IDE for developing AIDA. This page is in flux. It combines old AIDA and NewLabour items.

Contents

 
Configuration Checklist for NewLabour The Netbeans "Filesystem"
The Netbeans "Classpath" Compiling Aida from within Netbeans
Debugging an Aida Server within Netbeans CVS operations within Netbeans
Developing and testing an Aida server, without affecting the production instance

Configuration Checklist for NewLabour

Given the following setup, you will be able to parse (idl and other source),compile, generate IDL defined implementations (relative to idl directory) and update implementations,execute and debug from within Netbeans

1. Download and install the CORBA Module from update center

2. In filesystems - include necessary jar and zip files for the classpath. Check the CLASSPATH environment variable. At the time of writting this includes: OB.jar, OBEvent.jar, OBNaming.jar, and OBUtil.jar from the CORBA distribution JOB4.1/lib (Add as a JAR/ZIP), classes111.zip and classes102.zip from Oracle jdbc distribution. (Add as a JAR/ZIP); jca from /afs/slac/package/epics/R3.13.2/extensions/javalib; and possibly others.

4.  If you do not have the full AIDA package filesystem a local direcory, then add AIDAROOT to filesystems.

5. Options/Building/Compiler Types/External Compilation

a. Debug=true

b. Deprecation=true

c. Enable JDK 1.4 Source=true

6. Options/Building/Compiler Types/Internal Compilation
a. Debug=true

b. Deprecation=true

c. Enable JDK 1.4 Source=true

7. Options/Building/Compiler Types/FastJavac Compilation
a. Debug=true

b. Deprecation=true

c. Enable JDK 1.4 Source=true

8. Options/Distributed application support/CORBA Support Settings
a. ORB Version=Orbacus for Java 4.x for Windows or

b. ORB Version= Orbacus for Java 4.x

9. Options/Distributed application support/CORBA Support Settings/Orbacus for Java 4.x (or Orbacus for Java 4.x for Windows with minor modifications for name of jidl executable and Orbacus idl file include directory, and pathname separator "/"). Check filenames for validity of  version numbers also.
a. External IDL compiler= [ if Windows set Process to <ORBACUS Install Dir>/@sys/OOC/bin-java/bin/jidl]  -I<ORBACUS Install Dir>/common/JOB-4.1.0/ob/idl -I/afs/slac/g/cd/soft/ref/package/aida {dir_param} {package_root} {package_param} {files}

Eg on Solaris

-I /afs/slac.stanford.edu/package/iona/orbacus/Prod/common/JOB-4.1.0/ob/idl -I /afs/slac/g/cd/soft/ref/package/aida {params} {params} {dir_param} {package_root} {package_param} {package} {files}

b. ImplBase Implementation Postfix=_impl

c. CPP Parameters=-I<ORBACUS Install Dir>/common/JOB-4.1.0/ob/idl

10. -DAIDA_NS (below) is only required when running the NameServer where afs is accessed in non standard ways, e.g. on windows. This is used to force the absolute filename used for serializing the NameServer?s IOR.

11. Options/Debugging and Executing/Debugger Types/Default Debugging

a. External Process= {classic}{debuggerOptions} -DAIDA_NS=<afs.stanford.edu_ mount_point>.ior -Djava.compiler=NONE -Xbootclasspath/p:[<ORBACUS Install Dir><Necessary jar files>] -classpath {q}{filesystems}{q} {main} -ORBInitRef EventService=corbaloc:iiop:<event_service_machine>:11000/DefaultEventChannel

E.g. On Solaris:

{classic}{debuggerOptions} -Djava.compiler=NONE -Xbootclasspath/p:/afs/slac.stanford.edu/package/iona/orbacus/Prod/common/OOC/lib/OB.jar:/afs/slac.stanford.edu/package/iona/orbacus/Prod/common/OOC/lib/OBEvent.jar:/afs/slac.stanford.edu/package/iona/orbacus/Prod/common/OOC/lib/OBUtil.jar {q}{bootclasspathSwitch}{bootclasspath}{q} -classpath {q}{filesystems}{q} {main}
12. Options/Debugging and Executing/Execution Types/External Execution
a. External Process= -DAIDA_NS=<afs.stanford.edu_ mount_point>.ior -Xbootclasspath/p:/afs/slac.stanford.edu/package/iona/orbacus/Prod/common/OOC/lib/OB.jar:/afs/slac.stanford.edu/package/iona/orbacus/Prod/common/OOC/lib/OBEvent.jar:/afs/slac.stanford.edu/package/iona/orbacus/Prod/common/OOC/lib/OBUtil.jar -cp {filesystems}{:}{classpath}{:}{library} {classname} {arguments} -ORBInitRef EventService=corbaloc:iiop:<event_service_machine>:11000/DefaultEventChannel

E.g. on Solaris:

-Xbootclasspath/p:/afs/slac.stanford.edu/package/iona/orbacus/Prod/common/OOC/lib/OB.jar:/afs/slac.stanford.edu/package/iona/orbacus/Prod/common/OOC/lib/OBEvent.jar:/afs/slac.stanford.edu/package/iona/orbacus/Prod/common/OOC/lib/OBUtil.jar -cp {filesystems}{:}{classpath}{:}{library} {classname} {arguments} -ORBInitRef EventService=corbaloc:iiop:<something.slac.stanford.edu>:11000/DefaultEventChannel
b. Boot Classpath=[<ORBACUS Install Dir><Necessary jar files>] - at least OB.jar

c. Classpath: make sure that two Oracle zips (classes102.zip and classes111.zip) are included in path

13. Options/Debugging and Executing/Execution Types/Debugger Execution
a. External Process= {classic}-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n -Djava.compiler=NONE [ if windows -DAIDA_NS=<afs.stanford.edu_ mount_point>.ior] -Xbootclasspath/p:[<ORBACUS Install Dir><Necessary jar files>] -cp {filesystems} {classname} {arguments} -ORBInitRef EventService=corbaloc:iiop: <event_service_machine>:11000/DefaultEventChannel

E.g. on Solaris:

{classic}-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n -Djava.compiler=NONE -Xbootclasspath/p:/afs/slac.stanford.edu/package/iona/orbacus/Prod/common/OOC/lib/OB.jar: /afs/slac.stanford.edu/package/iona/orbacus/Prod/common/OOC/lib/OBEvent.jar:/afs/slac.stanford.edu/package/iona/orbacus/Prod/common/OOB/OBUtil.jar -cp {filesystems} {classname} {arguments}-ORBInitRef EventService=corbaloc:iiop:something.slac.stanford.edu:11000/DefaultEventChannel

The Netbeans "Filesystem"

To look a directory structure of files in Netbeans you need to "mount a filesystem". Really you're mounting a sub-filesystem. Since Aida is made up of a system of java packages, named edu.stanford.slac.aida.*, you should mount the file system from the directory which contains the "edu" directory. So, say you've got a development directory called c:\dev\test, and in it you've done a cvs checkout edu. Then, File->Mount filesystem. It'll pop up a window, you should navigate to the c:\dev directory and highlight the test directory. Then click Ok.

Mount a filesystem that's been checkout out of CVS.

You can use CVS commands directly from within Netbeans on files in a directory(ies) that has been checkout out of CVS. Having done a cvs checkout edu in c\dev\test (so there is a edu directory in c:\dev\test), then select Versioning->Mount CVS. In the CVS mount Wizard Window, for the Working directory enter c:\dev\test. Hit Next. For the "relative Mount Point, select the "test" directory. Hit Next. The connection method is "local". The Repository (with my assignment of the I drive as afs\slac) is I:\package\aida\cvs. Hit Next. The executable is just cvs. Fit Finish. CVS commands can then be executed on files or directories through the right mouse button, and the Versioning menu.

The Netbeans "Classpath"

The classpath used by Netbeans for compiling executing and debugging is the set of mounted filesystems! [actually you can set a different classpath for execution, but the following works equally for debugging and executing from within Netbeans]. To run an Aida server under Netbeans, the same .jar, .zip and other directories needed by that server, as specified in their Start<servername>Server.bat file, must be mounted in Netbeans(no kidding). To mount a .jar/.zip file, just use the File->Mount Filesystem, and click on "Add .jar File".

Note, for compiling and execution and debugging, the mounted filesystems are searched from the top down, so the order in which filesystems are mounted is important. To change a filesystem's position in the list select Project->Settings->File System Settings. Then right-click on the filesystem you want to move, and select Move Up or Move Down. In particular, if you have mounted filesystems for both the production Aida directory (say mounted as I:\package\aida) and a development directory (say CVS  C:\dev\aida) then make sure your development directory is higher than the production one if you want to make tests in which the development code takes preference to production code.

Compiling Aida from within Netbeans

    Set up the "classpath", ie mount all the .jar/.zip and Aida directories you need, as directed above

    Then click on the directory or file you want to build and select Build or Build-all from the Build menu.

Run an Aida Server within Netbeans

    Be sure the "classpath", is set - see above

    In the Explorer (in the Editing workspace), highlight the class of the server you want to start, eg MagnetServer. While its highlighted, pull down the Build menu and select "Set Arguments" - enter any arguments (such as those in the StartMagnetServer.bat file), eg "-ORBconfig c:\test\dev\common\script\magnet.conf". Then going back to the highlighted class file (like MagnetServer), right click on it and select Execute. The Output Window should show you the server starting.

The same instructions as above apply for debugging a client (at the time of writing, these use the argument "-ORBconfig I:\common\script\ob.conf". Note, %AIDASCRIPT% can't be used in the Set Argument dialog box.

A small "Execution" window will also start showing the class you started. If you right click on a class, it will allow you to Terminate a running class.

Debugging an Aida Server within Netbeans

    Be sure the "classpath" is set, see above.

    In the Explorer (in the Editing workspace), highlight the class of the server you want to start, eg MagnetServer. While its highlighted, pull down the Build menu and select "Set Arguments" - enter any arguments (such as those in the StartMagnetServer.bat file), eg "-ORBconfig c:\test\dev\common\script\magnet.conf". Then going back to the highlighted class file (like MagnetServer), click "Start" under the Debugger menu.


CVS operations within Netbeans

Having mounted a filesystem that's been checkout out of CVS (See above):

To Add an item to CVS: Highlight the item you want to add to CVS. Right click->CVS->Add. It will prompt you for a comment. Note that you have to do a CVS commit before the item shows up in the repository. To do the commit, highlight the CVS module to be committed (ie edu, or common, or test etc), then right click->CVS->commit.

To cvs update a single item, or a whole CVS module, use the CVS menu (right click or use the Versioning menu).

To Commit all files in a directory: In the explorer, highlight and click on a directory above the directory containing the modified files. For instance, if you've modified a script in common/script, highlight "script" and right click. Select CVS->commit. It will bring up a dialog box, showing all the modified files.

To Release: Remember you "release" a CVS module (edu, common etc). So in the Explorer, highlight for instance "common", right-click and select CVS->Release. The module will be removed from your mounted CVS Filesystem (i.e. it does a cvs release -d). Note that it may take quite a few seconds to update the fileview Explorer to remove the module - and if that module is the only one you had checked out, you'll get a warning. Also, if you still have files from the module you released in the editor, the editor will complain that its source disappeared, so before you release, close the files in the editor.


Developing and testing an Aida server, without affecting the production instance

To do this, start the server directly from within Netbeans without setting the -ORBconfig argument as described above, and make the server place its IOR in the interface table under a different name than the production one, in the example below it used "DaServerTest". You can also run both the server and the client from within netbeans, and in fact use a local cvs filesystem in preference to the one in production. See the image below in which a throw-away da server was being developed in C:\dev\temp\da, using development versions of files in C:\dev\aida\edu, in preference to those in I:\package\aida.


[Aida Home Page][SLAC Controls Software Group][ SLAC Home Page]

Author: Greg White, 14-Sep-2001
Modified by: 18-Sep-2002, Added configuration checklist provided by George McIntyre.