Skip to main content

Writing a module

8 replies [Last post]
morrisford
Offline
Joined: 2008-03-17

I have started the process of learning to write modules and I'm not making much progress yet. I have the module source tree and have 6.0.1 of Netbeans. I wanted to start by making small changes to an existing module so I tried to load a project and compile it before making any changes but every module in the tree has errors in some of the imports and I have been unable to get them all resolved. I put the path with j3d-core.jar and j3d-utils.jar into the classpath and that resiolved a couple but the rest ruined several days. Right up front I want to say that I am not an expert with netbeans, I use it but not for anything this complex. My question is about what jars should be included to make the modules compile?

Second thing: Is it possible to use debug mode in Netbeans (or whatever) with a module? with the client side? with the server side? Is it possible to run a module without the wonderland environment? How is debugging done on modules by the people that are writing the system?

Thanks in advance

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
huam
Offline
Joined: 2006-12-16

I also have some compiler problems with Netbeans, but I think this is from some source that's not used. When I run a clean build everything seems oke.
Only joal and some darkstar source errors.
Most at the time I run on the command prompt with 'ant run-sgs' and 'ant run' to build and run wonderland.
Debugging with wonderland in Netbeans goes well so don't worry about some errors.

morrisford
Offline
Joined: 2008-03-17

I'm not sure if your response answers my question. I am trying to use netbeans to work on modules and I get unresolved imports in all of the modules in the module source tree that I cannot resolve. I am also trying to debug a module instead of the main client and server parts of wonderland.

paulby
Offline
Joined: 2003-06-13

Hi Morrisford,

Which module are you experimenting with and what OS ? Most of the things missing from the Netbeans setup will be found in lg3d-wonderland/ext/

The problem is that some of the jars (for example jinput) are in platform specific directories so we need multiple entries in the netbeans config file.

Rgds

Paul

morrisford
Offline
Joined: 2008-03-17

I am running on Ubuntu and I have tried to compile samplemodule, videomodule and pdfviewer. The imports that are going unsatisfied are as follows:

samplemodule:
javax.vecmath.VARIOUS

videomodule:
javax.vecmath.VARIOUS
javax.media.VARIOUS

pdfviewer:
javax.vecmath.VARIOUS
com.sun.pdfview.VARIOUS

If I could find the jars for those I think I would be golden.

Also, I still have the question about how to debug a 'module'.

kaplanj
Offline
Joined: 2004-07-13

Setting up the module environment can be a bit tricky. The first thing to note is that since Netbeans is using custom ant scripts, unresolved imports don't necessarily mean the project won't build. They just mean that Netbeans can't find the given libraries. Of course it is much better if you can resolve all the imports. The libraries you are looking for are:

javax.vecmath.* : lg3d-wonderland/ext/
/jars/vecmath.jar
javax.media.* : lg3d-wonderland/ext/
/jars/jmf.jar
com.sun.pdfview.* : wonderland-modules/src/modules/apps/2d/pdfviewer/lib/PDFViewer.jar

Usually the problem is that the libraries are included for the wrong platform, so you just need to edit the project properties and choose the correct platform.

For a new module, one trick is that if you edit your modules nbproject/project.xml file by hand (and not using the Netbeans project properties dialog), you can include all the jars that Wonderland uses in a couple of easy steps. This is taken from wonderland-modules/src/modules/apps/3d/musicinwonderland/nbproject/project.properties. New lines are in [b]bold[/b]:

MusicInWonderland
[b]
nbproject/nb.properties [/b]

...



...
[b]${wonderland.client.classpath}:${wonderland.server.classpath}[/b]
1.5

You may need to compile the module once for the nb.properties file to get written, but when it does it will have the full Wonderland classpath for your platform.

morrisford
Offline
Joined: 2008-03-17

Thanks!! The problem was that the project was using macosx libraries instead of linux. Once I cleared that up everything was good. Thanks for all the information about setting up a project also. That really helps.

Is there any information about how to use debug mode to test a module?

kaplanj
Offline
Joined: 2004-07-13

There are some facilities for debugging in Wonderland use the NetBeans debugger. I have just written up a short HOWTO for debugging the client and server:

http://wiki.java.net/bin/view/Javadesktop/ProjectWonderlandNetbeansDebugger

It's quite terse right now, but as you start debugging, please feel free to edit and improve it.

morrisford
Offline
Joined: 2008-03-17

Thanks once again. I'll try to keep good notes as I move along and come back with a description of the process I go through in creating and debugging a new module.