Topic: EJB Free and Open Source Tools Summary |
Print this page |
1.EJB Free and Open Source Tools Summary | Copy to clipboard |
Posted by: hawker Posted on: 2003-04-12 11:52 Published on The O'Reilly Network (http://www.oreillynet.com/) http://www.oreillynet.com/pub/a/onjava/2003/02/26/ejbinherit5.html See this if you're having trouble printing code examples EJB Free and Open Source Tools Summary by Emmanuel Proulx 02/26/2003 People often ask me "What's the best platform for J2EE development?" There's no clear answer for this question. First, the vendors each provide contradictory facts to prove that their product is the best. Second, each has its zealots who will tell you all of the good things about one server and bad things about the others. Third, there are dozens of products available out there. The Selection Process To that question, I always answer: There is not one clear winner. It all depends ... Then I suggest the following method for selecting a tool: Decide feature requirements and priorities. Do your homework, get informed. This article is full of links that may help you. Write a comparison matrix with products at the top and features on the side. Put higher priority items at the top of the matrix. Don't worry too much! Portability is an important feature of J2EE. If you change your mind later, you should be able to migrate with a few days' work. To help you choose the right application server, here are a few links. Some products are outdated, though: Application Server Comparison Matrix Java/J2EE Servers App-Serv Central: The Contenders One of the top priorities in the matrix should be price. Today's economy mandates careful investments, and free or open source software makes perfect sense. Many of these tools offer near-commercial-class stability (especially in their 2.x versions and above) with good-enough performance--and you can't beat the price! To help those people for whom price is an important factor, I've reviewed a few free or open source J2EE application servers that support EJB 2.0. Categories With so many products, it's easy to get lost. Foremost, I decided to ignore products that don't support EJB 2.0. That eliminates two-thirds of the candidates. Then I decided to separate my reviews into three categories: Open source J2EE servers "Free" J2EE servers Free EJB 2.0 development tools You will note that I completely left out very popular products, including Tomcat and Enhydra. These don't have EJB containers, though. They're JSP/servlet servers. Open Source J2EE Servers There are a few open source J2EE servers that support EJB 2.0. These servers are, in no particular order: JBoss JBoss is one of the most famous open source servers. It works with most of the J2EE technologies, including EJB 2.0 with CMP, JMS, JTA, Servlet/JSP, JNDI, JMX, SOAP, etc. That's a whole alphabet. JBoss uses the LGPL license. There are two flavors of JBoss 3.0 available. One has its own HTTP server (JBossWeb), and the other one comes with Tomcat bundled. I looked at JBoss 3.0/JBossWeb, and had no problem installing, running, or configuring it. The configuration tool that comes with it is not very good, so I had to configure it manually with text and XML files. The documentation is poor, but it's enough to get you started. This sounds too good to be true. Is there a dark side to JBoss? Not really. But there are a few things you should know: JBoss is managed by a company called JBoss Group, not by a committee. There's a community of developers that actively participate in the development of JBoss, but JBoss Group has the final word. In theory, JBoss Group make their money with services (support, consulting, education). I've heard rumors that one day JBoss may not be free anymore. But I was assured that this is not the case, and I'm convinced. The product isn't certified as a J2EE application server. The justification is that applying for this certification is expensive. Plus, I've heard a rumor that Sun doesn't like JBoss very much. In short, JBoss is the mother of open source J2EE application servers. For more information, see the JBoss homepage. JOnAS JOnAS is another important player in the open source J2EE server market. Like JBoss, it was originally an EJB container that was "upgraded" over time with many other J2EE technologies. It is also available under the LGPL license. In fact, the story of JOnAS sounds a great deal like that of JBoss. JOnAS supports EJB 2.0, JMS, JCA, JMX, etc. It doesn't provide Web containment, but can be used with Tomcat. This product is also bundled with Enhydra to provide EJB and JMS support. JOnAS is managed by a group called ObjectWeb. (No, not "WebObjects.") ObjectWeb also hosts many other open source projects. The bulk of the group's members work at Bull, so obviously Bull must help out. Unlike the JBoss Group, Bull's main products are not related to open source. JOnAS is somewhat less popular than JBoss. This is partly due to the high visibility of JBoss. (Better marketing?) I was able to get and install JOnAS easily. The examples worked fine. The configuration is done through editing text and XML files. In short, JOnAS seems to be a good product. It would be better if it were bundled with Tomcat, and if it had a graphical configuration tool. For more information, see the official JOnAS web site. OpenEJB OpenEJB used to be a promising open source EJB container. Officially, it was "shelved" last year by Intalio, the company that was managing it. OpenEJB is still in beta state, version 0.9.1. It supports the EJB 1.1 specification, plus a few EJB 2.0 features. Why am I talking about a product that was shelved and doesn't fully support EJB 2.0? Because the project is still alive and well. New versions come out once in a while. The mailing list receives new messages regularly. The product is still available for download. If someone wants to contribute and continue the development, the door is open. Here's proof: in October 2002, David Blevins, co-founder of the project, wrote in a mailing-list message: 0.8 through 1.0 will all be EJB 1.1 compliant. OpenEJB 2.0 will be EJB 2.1 compliant. We already have work in progress on 2.1 compliance. Another proof: OpenEJB is bundled with WebObjects 5.x to provide standard J2EE services. OpenEJB has two storefronts: ExoLab Group, which also manages a handful of other, related open source projects. ExoLab is composed of a team of elite programmers. The most famous of them are Richard Monson-Haefel and David Blevins, prolific authors and J2EE enthusiasts. SourceForge, which hosts numerous open source projects. OpenEJB is a member of a family of open source products, all managed by ExoLab Group, including OpenJMS (a JMS server), OpenORB (a CORBA server), Tyrex (a transaction server), and Castor (object-to-relational mapping). These can all be plugged into a Tomcat Web application. For more information, see the OpenEJB site at SourceForge and an ONJava article on OpenEJB integration with Tomcat. "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. Be aware that I have tried to avoid incomplete or expiring "demo" versions. This eliminates, among others, IBM's WebSphere and BEA's WebLogic application servers. 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 guest123. HP-AS 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. Related Reading Enterprise JavaBeans, 3rd Edition By Richard Monson-Haefel Table of Contents Index Sample Chapter Read Online--Safari Search this book on Safari: Only This Book All of Safari Code Fragments only 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: Javamug's J2EE links JMiddleware.com's EJB links Java Skyline's Enterprise Development page 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 page. 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 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. EJBGen 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 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 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 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. XML Editors 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: BEA XML editor XML Cooktop Microsoft XML Notepad IBM Xeena and many more ... Lessons Learned 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 of vi or 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! Cheers! Emmanuel Proulx is an expert in J2EE and Enterprise JavaBeans. He is a certified WebLogic Server 7.0 engineer. Emmanuel works in the fields of Web development and mentoring, revolving around Java technology. -------------------------------------------------------------------------------- Return to ONJava.com. oreillynet.com Copyright © 2003 O'Reilly & Associates, Inc. |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |