Geertjan's Blog

  • September 18, 2007

Four For The Price Of One

Geertjan Wielenga
Product Manager
In NetBeans IDE 6.0 Beta 1, when you go to the Samples section of the New Project wizard, two of the samples you'll find are these:

These are two samples for the 'Quality of Service' (QoS) area, formerly known as WSIT. The samples are described in a brand new tutorial, called Web Service "Quality of Service" in NetBeans IDE 6.0, where you'll principally learn about web service security.

However, the interesting thing is that when you complete the wizard for each of the above samples, you'll end up with TWO projects. (In other words, if you create both the samples above, you will have four projects, instead of two.) That makes sense, because these samples each deal with a client AND with a service. Hence, rather than forcing you to complete the wizard twice, the IDE lets you generate both projects at the same time, when you complete the above wizard. This is an innovation by Martin Grebac, the NetBeans tooling engineer in the QoS area. The scenario where a sample requires two projects is pretty unique to the Java EE area, in general. So today I tried to learn how to create this kind of multi-project sample, for the brand new End-to-End Web Service Creation and Consumption in NetBeans IDE 6.0 tutorial, which deals with FOUR interrelated projects—an EJB module, a web service, a Java EE application, and a Java Swing application.

So now I have a new sample in the same category as the previous two:

Currently, there's still something I don't understand, because when the wizard completes, the projects do not open in the IDE. However, they're available on disk, as shown here:

So for now, you need to open the 4 projects from disk (after finishing the wizard by pressing Cancel, because it hangs there for some reason, currently), and once you've done so you'll find the four new projects, all generated from the one wizard, in your Projects window as follows:

Despite the error markings you see above, which refer to dependencies that are generated at compile-time, the projects are good to go as they are. I was able to deploy the Java EE application to GlassFish, after which I ran the Swing application, which (a moment or two later) displayed the flower pictures, described here and based on Milan's recent blog entry.

If you'd like to try the wizard that produces these four projects, download and install the plugin below, into NetBeans IDE 6.0 Beta 1:


Once they've been tested a bit, I'll put them on the Plugin Portal or somewhere else that is more public than my blog.

Update: The above link now goes to the Plugin Portal.

And how was the wizard created that produces these four projects? I simply copied from Martin's sources, in the websvc module. I don't understand much of it, haven't tried yet, which explains why it doesn't completely work. But it clearly does most of the job already. The amount of classes and files involved might seem a bit daunting, but really are identical per implementation, I really only copied them into my NetBeans module and then tweaked the layer file. Here's my whole module:

I am looking forward to the day when the current Project Template wizard will be extended to... allow you to select multiple projects simultaneously, instead of just the one that you can currently select, which would then wrap up all selected projects into a single module. After 6.0, this kind of 'apisupport' activity will hopefully become something that NetBeans engineers will be able to focus on.

Join the discussion

Comments ( 1 )
  • ranganaths Tuesday, September 18, 2007


    does it has the groovy & grails support?

    Thank you


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.