EJB Free and Open Source Tools Summary
Pages: 1, 2
"Free" J2EE Servers
Many other application servers exist, and while they're not open source, some are free. By free I mean the license allows you to download and use the product with strict conditions. Many companies offer "free" products, which are usually limited one way or another. For example, demonstration versions expire or are incomplete. Other products limit the number of simultaneous users or lack advanced features. These companies bet that you will use the product and like it, and that you'll buy the "unlimited" versions. Despite these limitations, some of these products can very well be used for development purposes, and even for tiny projects.
Some people are afraid that if they use these commercial products, they'll be locked in. Again, J2EE applications are theoretically portable. If, later, you need a different application server, you can always migrate your application. Stick with the standard APIs in your code, and don't be afraid to use the commercial products.
J2EE 1.4 SDK, Containing the Reference Implementation
Although the SDK's reference implementation is free, and the source code is available, it is not open source, either. The license used doesn't allow modifying or reselling by the general public. It is provided for reference only. It is built on top of Tomcat, and contains a Web-based administration console.
I tried out the beta version; it was pretty buggy. Just remember that the
port used is 8000, not 8080, as suggested in the documentation
shipped with the beta version. The administrator username was
guest and the password was
The HP Application Server is an full-blown J2EE server that is part of the HP Sunset Program. What does that mean? No you don't get a free trip to Japan, the land of the setting sun, when you buy this product. It means the product has been shelved. It is still available for download, but there will be no more development, nor is there any support.
This is still an interesting product because it is commercial-quality, full-featured, and costs nothing. Find it at the HP middleware page.
Sun ONE Application Server 7, Platform Edition
This free J2EE application server comes straight from the people who manage J2EE. Can you ask for more? This version is complete, except for a handful of advanced features (management tools, load balancing, clustering, etc). Its homepage is here.
Sybase EAServer, Developer Edition
Another industrial-strength application server is EAServer. The Developer Edition is free, and, as opposed to the Sun ONE application server, it contains all features. Sybase chose to limit the number of users, instead: each server can only have five connections. Again, this can still work well for small projects. Find it here.
Free EJB 2.0 Development Tools
EJB technology is criticized for being a big burden for developers. Aren't components supposed to make their lives easier? Obviously, EJBs have a lot to offer, but are they worth the tremendous effort of manually coding them, writing big deployment descriptors, and making sure the entity beans map properly to a often-changing database? The answer is this: with good tools, EJB components make much more sense.
When these tools are free, they make perfect sense! The only question left is now "are the tools catching up"?
The most important tool is probably your IDE. It should contain the wizards, editors, and bells and whistles that provide RAD for fast EJB creation. Free IDEs like NetBeans and Eclipse lack EJB-specific features. A couple of plug-ins exist for Eclipse, but they are early versions. Sun ONE Studio Developer Edition (formerly Forte for Java) doesn't have any EJB support; the costly Enterprise Edition does.
Besides the IDE, there are many tools that help in developing EJBs. There are so many tools that I cannot list them all. For a better list, see these links:
I tried to avoid the demonstration versions. I didn't have the time to try them all, so don't blame me if some don't work as advertised.
Ant, with EJB tasks
Ant is a build utility that contains a very long list of commands. Many
compare it to the
make command, but made especially for Java
development. Some of the available commands are specific to EJBs. These
commands are vendor-specific (different ones for each application server). They
allow certain jobs to be accomplished, like compilation, packaging, deployment,
and operating the application server. See the Ant EJB
JUnit and Extensions
JUnit is a simple test utility. It allows easy unit testing of Java components. JUnit itself isn't made specifically for testing EJBs, although it is feasible. On the other hand, there are a few JUnit extensions (plug-ins) that make this even easier.
Probably the most famous of these extensions is Cactus.
Lomboz is an Eclipse plug-in that allows managing application servers (JBoss, WebLogic Server, Tomcat), and contains wizards to simplify J2EE development. Some of these wizards will help develop EJB 2.0 beans. This tool is integrated with XDoclet. Lomboz is at its version 0.97.x at the time I wrote this, and it worked pretty well for me. Way to go! See the Lomboz home page.
Imagine writing the bean's implementation file (annotated with many JavaDoc comments), and having a tool that generates interfaces and deployment descriptors. EJBGen is such a tool. This tool is implemented as a JavaDoc doclet. It will only generate the WebLogic-Server-specific deployment descriptor. Other application servers are not supported. EJBGen ships with WebLogic Server.
XDoclet is a tool that runs as Ant tasks to generate code automatically. Like EJBGen, XDoclet is implemented as a JavaDoc doclet. Many tags are available, each covering a different technology (EJB, JSP, JMX, etc.) or application server (WebLogic, WebSphere, JBoss, etc.). Using XDoclet, one can develop EJBs with little coding. It has a SourceForge project page.
Ejen is another solution for code generation. It is implemented as an Ant task with many options. The input format is XML. This tool has very little documentation at this time (version 1.1 beta), but I predict it will become a good alternative to the preceding code-generation solutions.
MiddleGen is a free graphical tool to generate J2EE code; by this, I mean entity beans (CMP EJB 2.0), JDO, or JSP components. Many different EJB containers are supported, including JBoss, HP AS, WebSphere, and WebLogic. How does it work? The tool connects to a database and extracts the metadata. It lets you then choose some options, and generates the entity bean code automatically! This is great! Its homepage is here.
One of the most tiresome jobs when developing EJBs is writing those darn XML deployment descriptors. These are cryptic, error-prone, and can become troublesomely large. A good XML editor is very important. There are lots to choose from. Here are a few of them:
There are a few things to remember from this article:
- First, there's a lot of choice out there, and choice is good. J2EE lets you make a choice now and change your mind without being locked in.
- Second, you don't have to pay the big bucks to get to where you want to go. There are plenty of free alternatives.
- Third, "work smarter, not harder." Do you not use a word processor instead
edlin? Do you not use a microwave oven instead of a camp fire? These gadgets are no luxury. Without them, our work would take orders of magnitude more time. The next time someone tells you how hard EJBs are to develop, tell them Writing EJBs without tools is like trying to cut down a tree with an axe. I suggest you use a chainsaw instead.
- Lastly, (and I'm referring to OpenEJB here) open source projects will not disappear as companies come and go. They will continue to live and grow as long as people use them. You can't say the same about proprietary tools!
Emmanuel Proulx is an expert in J2EE and Enterprise JavaBeans, and is a certified WebLogic Server 7.0 engineer. He works in the fields of telecommunications and web development.
Return to ONJava.com.