The Source for Java Technology Collaboration
User: Password:



Brian Leonard's Blog

April 2005 Archives


Developing for JBoss? Try NetBeans.

Posted by bleonard on April 26, 2005 at 06:56 AM | Permalink | Comments (6)

As an example, I'll show you how to use XDoclet and Ant to integrate with the JBoss Application Server. I'll create the same project that JBoss uses in their tutorial. I'll be very surprised if you don't find the NetBeans solution easier to use then JBoss' own Eclipse based IDE. In the JBoss Eclipse IDE, the XDoclet configuration steps are extremely tedious (ejb, servlet), and would have to be repeated for each component. With NetBeans, I provide you a set of generic Ant tasks that can be used over and over again, no further configuration necessary. Also, when you're done, your application will run on JBoss AND the J2EE RI (and could be EASILY extended using the principals outlined to run on other servers as well). Check it out: Integrating NetBeans with other J2EE Server Vendors.

But don't stop there. My colleague Geetjan Wielenga's blog is full of gems such as Monitoring HTTP Requests on JBoss 4 from NetBeans IDE 4.1, Remote Debugging from NetBeans IDE 4.1 to JBoss and Integrating JRun 4.0 with NetBeans IDE 4.1.

Finally, much of the NetBeans team will be in San Francisco for JavaOne and NetBeans Software Day. If you've found their blogs, articles, and e-mail responses on the aliases helpful, here's your chance to thank them in person. Just click the button below to register. As with NetBeans, it's free!

banner-150x75.png



NetBeans, NYC and Springtime

Posted by bleonard on April 08, 2005 at 10:36 AM | Permalink | Comments (2)

I spent this last Wednesday in NYC on what was probably the first nice day of Spring this year. I arrived from Connecticut via Amtrak into Penn Station. Generally, I take the subway up to the Sun offices near Grand Central Station, however, it was too nice of a day to be underground, so I decided to walk. It was close to lunch time when I arrived and the parks were overflowing with folks soaking up the sun.

I was in town to speak at the NY Java SIG. My presentation, NetBeans 4.0, 4.1 and Beyond, was to a capacity crowd of about 80 developers. There was lots of interactive Q&A, which is always a good sign, but it did limit the amount of material I could cover. I was able to demonstrate NetBeans' revamped UI, it's support for Tiger, the Ant based project system, J2EE (sans Web Services) and the profiler. I did not have time for JUnit, J2ME/Mobility or the new GUI builder. Given the same time constraints next time, I would focus on Web Services rather than EJBs for the J2EE portion, otherwise, I believe the presentation was well received.

After the presentation, I jotted down all the questions I could remember, and in some cases, spent some time after I returned coming up with some more thorough answers than I gave Wednesday night. Here they are for all that may be interested:
Q:
Will the editor detect unused import statements?
A:
Yes, but I didn't know this myself until I tried it on the fly. I added an unused import statement then selected fix imports and poof, it disappeared. Someone, half-jokingly, pointed out that the line containing the import statement should also be deleted. Turns out it is, unless that import statement is added to the bottom of the list. I filed a defect against this corner case.

Q:
Can you pass parameters into the Ant Script?
A:
Yes, via the Advanced dialog of the Run Target submenu on an Ant script (you can see the "Advanced..." item on the submenu in the image below).

Q:
My build script has lots of "private targets", can I prevent these from appearing in the Run Target menu?
A:
Yes. Target names that begin with a dash, e.g., "-do-init", will not appear in the Run Target menu. Also, only targets with a description will appear in the main Run Target menu. Targets without a description will appear in the "Other Targets" sub-menu.

targets.PNG
Q:
Does NetBeans support multiple web interfaces to a project? I haven't been able to get this to work with any other IDE.
A:
I don't see why not as you would just create another web-module project. Give NetBeans a try and let me know if you encounter any problems. (I also spoke to this guy for about 10 minutes after the session. He mentioned some pretty wacky stuff, like 3 different web.xmls for a project, but he liked NetBeans tight Ant integration and is going to give it a try. He's currently using Eclipse.).

Q:
Which server are you deploying to?
A:
The J2EE 1.4 Reference Implementation.

Q: Your J2EE demo was cute, but how does it work with REAL J2EE projects?
A: Fine. Try it out and let me know if you run into any difficulties.

Q: Are the Enterprise Resource Wizards (e.g., Call EJB), available from JSPs as well as servlets?
A: You can access the Enterprise Resource wizards from any Java class in an EJB module or web application. The Enterprise Resource wizards are not available from JSP files.

Q: Which version control systems do you support? 
A: CVS, Microsoft VSS 6.0, Merant PVCS are part of the standard NetBeans 4.x distribution.  There are also profiles available for ClearCase, StarTeam, Subversion and TeamWare.

Q: Does your Unit Testing support the Green/Red Graphical Result interface?
A: It is possible to code your test case to launch JUnit's Swing GUI, however, it is not integrated into the IDE as you may expect. Integrated support for this UI is planned for the JUnit module.

Q: XDoclet Support?
A: Yes. Since XDoclet is merely a set of Ant tasks, and the NetBeans project system is based on Ant, XDoclet integrates easily into the NetBeans environment.

Q: When selecting part of an application to profile, is it possible to set the filter at the package level (rather than at the method level)?
A: Yes. You can create a Customer Filter which includes only the packages you're interested in profiling.

Q: Could the API used by JFluid, which injects bytecodes on the fly to instrument the code, be used for other intentions, like say, a virus?
A: JFluid uses the JVMTI API. JFluid's "attach on the fly" capability will only work when (a) the user who wants to attach is on the same machine as the target VM and (b) is the same user who started that VM or a super-user.

Q: Does the IDE generate the necessary Ant targets to launch my J2ME app in the various configured emulators?
A: The IDE launches the application in the emulator based on the config.active property set in private.properties. You may either change this setting or override the properties on the command line to launch your application in other emulators when running Ant outside the IDE.





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds