& FOCUS ISSUE

TM

Java COM

Conference: January 21-24, 2003 Expo: January 22-24, 2003 www.linuxworldexpo.com The Javits Center New York, NY see details on page 55

From the Editor Alan Williamson pg. 5

Java & Linux A Marriage Made in Heaven pg. 6

TCO for Linux Linux Fundamentals: Tools of the Trade Mike McCallister ...and J2EE Projects pg. 8 Programming Java in Linux – a basic tour $40010 60 Linux Vendors Life Is About Choices pg. 26 Feature: Managing HttpSession Objects2003 SAVEBrian A. Russell 8 PAGE CONFERENCE Create a well-designed session for a better Web appEAST INSERT PAGE18 63 Career Opportunities Bill Baloglu & Billy Palmieri DGE pg. 72 Integration: PackagingE Java Applications Ian McFarland for OS X Have great looking double-clickable applications 28 Java News ERVICES pg. 60 S EB Specifications: JCP Expert Group Jim Van Peursem JDJ-IN ExcerptsW Experiences – JSR-118 An inside look at the process 42 SPECIALpg. 61 INTERNATIONAL WEB SERVICES CONFERENCE & EXPO Letters to the Editor Feature: The New PDA Profile Jim Keogh OFFER!pg. 62 The right tool for J2ME developers 46

RETAILERS PLEASE DISPLAY UNTIL MARCH 31, 2003 Product Review: exe4j Jan Boesenberg by ej-technologies – a solid piece of software 56 Interview: JDJ Asks ...Sun on Java An exclusive chance to find out what’s going on at Sun 58

SYS -CON Blair Wyman MEDIA Cubist Threads: ‘(Frozen)’ A snow-packed Wyoming highway adventure 74 Everybody’s focused on exposing applications as

Web services while letting someone else figure out how to connect them. We’re that someone else.

Introducing SonicXQ ª

Integrate with ease, extend at will.™

Global Enterprise

Packaged J2EE™ Application .NET™ Application or Application Legacy System

JMS o r JCA JCA SOAP/HTTP

Transformation Services Enterprise Service Bus Content-Based Routing Services

SOAP/HTTP SOAP/HTTP

Partner Web System service

Internet

Most companies are focused on services that allow applications Web services and distributed exposing individual applications and business partners to easily processes can scale to meet as Web services, but haven’t interact over the SonicXQ bus, the demands of today’s global yet considered how to effectively eliminating the need for point- enterprises. integrate or manage them. And to-point integrations and the that’s no small task. expensive centralized solutions Capitalize on the promise of that implement them. Web services right now with SonicXQ is the first product to SonicXQ. After all, what good deliver on the vision of the And because SonicXQ is built is a Web service if it’s an Enterprise Service Bus:a standards - upon the proven SonicMQ® island unto itself? based, service -oriented architec- messaging backbone, it ture that reliably and securely provides end-to-end reliability integrates enterprise applications and comprehensive security through Web services and JCA between services. Our patent- technologies. SonicXQ includes pending Dynamic Routing configurable XML processing Architecture™ ensures that www.SonicSoftware.com/JDJ

© Copyright 2001 Sonic Software Corporation. All rights reserved. SonicMQ is a registered trademark and SonicXQ and Dynamic Routing Architecture are trademarks of Sonic Software Corporation in the U.S. and other countries. Java and all Java-based marks are trademarks or registered trademarks of , Inc. in the U.S. and other countries. All other marks contained herein are the property of their respective owners. their installer tool

nstaller letting you down? Can’t get your software out the door because those our other multi-platform guys say that you need to take a seminar before you can Ieven use their installer tool? Creating installers doesn’t have to be difficult. installer InstallAnywhere makes it child’s play to create masterful installers on the fly with tool our powerful, intuitive, task-based Advanced Designer. Our designer handles platform-specific actions intelligently, allowing you to focus on installer design, without worrying about how your installer will function on different operating systems. And, we save you time and money by speeding you through your multi-platform deployment. We’re faster than the competition – you can create a simple installer in just five minutes flat. And, we’re better too – with more built-in func- tionality so you don’t have to waste time writing tedious code to do the things that are built right into InstallAnywhere.

Pull the trigger. Give yourself a lift. Download a FREE fully functional trial version today at www.ZeroG.com and see for yourself why InstallAnywhere is the world’s most powerful multi-platform installer. Zero G www.ZeroG.com/install

© 2002 Zero G Software, Inc. Zero G, Zero G Software, and InstallAnywhere are trademarks or registered trademarks of Zero G Software, Inc. All other trademarks are property of their respective owners. MOTOSMARTER Technology gets smarter every day. What about you?

Join the Motorola Developer Program and access the up-to-the-minute training you need to develop killer apps for Motorola devices and platforms. Code smarter and get applications to market faster, whether you're a beginner or an expert looking to master the latest Motorola products. Online training? We've got it. Onsite training? Yep. Classroom training? Absolutely. J2ME™, Java™, tools? Sure, child's play. To get specifics on class times, platforms, and schedules, visit our site and click on Training.

>> Join today! Visit www.motorola.com/developers/wireless

For a limited time, MDP is offering free, self-paced, online training for all members.

MOTOROLA and the Stylized M Logo are registered in the U.S. Patent and Trademark Office. All other product or service names are the property of their respective owners. © Motorola, Inc. 2002. MG90950A-JDJ0902 FROMF THE EDITORDI J2ME INTERNATIONAL ADVISORY BOARD CALVIN AUSTIN (Lead Software Engineer, J2SE Linux Project, Sun Microsystems) JAMES DUNCAN DAVIDSON (JavaServlet API/XMP API, Sun Microsystems) JASON HUNTER (Senior Technologist, CollabNet) JON S. STEVENS (Apache Software Foundation) ALANWILLIAMSON EDITOR-IN-CHIEF BILLROTH (Group Product Manager, Sun Microsystems) BILL WILLETT (CEO, Programmer’s Paradise) BLAIR WYMAN (Chief Software Architect IBM Rochester) EDITORIAL JavaScript! = Java!!! J2SE EDITOR-IN-CHIEF: ALAN WILLIAMSON EDITORIAL DIRECTOR: JEREMY GEELAN EXECUTIVE EDITOR: NANCY VALENTINE If you ever questioned the usefulness or managers’ desks due to its large supplier J2EE EDITOR: AJIT SAGAR power of blogs, let me remove any remaining advertising. The editorial in this title has J2ME EDITOR: JASON R. BRIGGS doubt you may have with this story. I have gotten meatier over the years, but you J2SE EDITOR: JASON BELL PRODUCT REVIEW EDITOR: JIM MILBERY my own blog, http://alan.blog-city.com, and wouldn’t particularly buy the magazine FOUNDING EDITOR: SEAN RHODY I use it primarily as a public scratchboard, because of it. noting thoughts and various observations There was a piece written by Mike James PRODUCTION regarding our industry through the eyes of a (a well-established Computer Shopper J2EE PRODUCTION CONSULTANT: JIM MORGAN Java developer. What I find great about the writer) regarding Java development. Sadly, ASSOCIATE ART DIRECTOR: LOUIS F. CUFFARI ASSOCIATE EDITORS: JAMIE MATUSOW blog is that it enables others to chip in with the information he was basing all his facts on GAIL SCHULTZ their thoughts and ideas. You’ll discover that was at least five years out of date. Such clas- JEAN CASSIDY all of us at JDJ have blogs you can follow. sic hollers as “because it’s interpreted it has a JENNIFER STILLEY Now, I thought we had long passed the tendency to be slow”! Excuse me? It didn’t ONLINE EDITOR: LIN GOETZ stage of always defending Java from the old get any better, with major errors regarding TECHNICAL EDITOR: BAHADIR KARUV, PH.D. Home legacy arguments we were throwing around the pricing of Java, performance, and his WRITERS IN THIS ISSUE some five years ago. I was under the impres- general feel for the language. Remember the CALVIN AUSTIN, BILL BALOGLU, JASON BELL, JAN BOESENBERG, sion we had moved on from there and were piece was not written as an editorial; it was JASON R. BRIGGS, SCOTT HANDY, JIM KEOGH, VLAD KOLAROV, engaged in more meaningful debates. I was meant to be an informative piece, full of star- MIKE MCCALLISTER, IAN MCFARLAND, BILLY PALMIERI, BRIAN RUSSELL, proved wrong this month. The first item that tling facts, not personal opinions. The prob- AJIT SAGAR, JIM VAN PEURSEM, ALAN WILLIAMSON, BLAIR WYMAN came up on my radar was a press release lem isn’t so much that Mike James hasn’t a SUBSCRIPTIONS from a company announcing their joy that clue what he is talking about when it comes FOR SUBSCRIPTIONS AND REQUESTS FOR BULK ORDERS, they had removed Java from their B2B Web to Java, but the fact that many people in mid- PLEASE SEND YOUR LETTERS TO SUBSCRIPTION DEPARTMENT site and how the efficiency and speed of dle management will read this and believe it [email protected] their site was suddenly catapulted forward. – thus continues the cycle of stuff and leg- COVER PRICE: $5.99/ISSUE This demanded closer inspection. Thank end. DOMESTIC: $49.99/YR. (12 ISSUES) goodness I did; they were talking about The question is: What can we do? Many CANADA/MEXICO: $79.99/YR. OVERSEAS: $99.99/YR. JavaScript, not Java!!! Letting out a yelp, I leading Java dignitaries have suggested that (U.S. BANKS OR MONEY ORDERS) BACK ISSUES: $10/EA., INTERNATIONAL $15/EA. quickly blogged my comments, e-mailed we need to form a marketing coalition that the originator of the press release, and with- will present a clear and united front. I didn’t EDITORIAL OFFICES in 30 minutes we had a retraction and an think much of it, believing the language to SYS-CON MEDIA, 135 CHESTNUT RIDGE RD., MONTVALE, NJ 07645 apology for the confusion. My fear was the be strong enough to stand on its merit, but TELEPHONE: 201 802-3000 FAX:201 782-9600 countless “drones” who would have picked maybe we need to address this. Here at JDJ JAVA DEVELOPER’S JOURNAL (ISSN#1087-6944) is published monthly up on this, not read it properly, and used it we’ll be doing our bit. We’re establishing a (12 times a year) for $49.99 by SYS-CON Publications, Inc., 135 Chestnut Ridge Road, Montvale, NJ 07645. as fodder for assuming that Java was down working group of Java movers and shakers, Periodicals postage rates are paid at Montvale, NJ 07645 and out. under the guidance of our newly appointed and additional mailing offices. POSTMASTER: Send address changes to: Okay…“calm down, Alan”…I thought to chairman Joseph Ottinger. Their task: to JAVA DEVELOPER’S JOURNAL, SYS-CON Publications, Inc., 135 Chestnut Ridge Road, Montvale, NJ 07645. myself, innocent enough mistake, easily tackle head-on the issues facing Java in the made in the excitement of constructing a forthcoming year. ©COPYRIGHT press release! Rational and technical people Joseph is a strong personality and should Copyright © 2003 by SYS-CON Publications, Inc. All rights reserved. No part of this publication may be reproduced or transmitted in any wouldn’t make this mistake, would they? keep things in order; I’m looking forward to form or by any means, electronic or mechanical, including photocopy or Well, I was about to be proved wrong again, working with him on this. We’ll report how any information storage and retrieval system, without written permission. but this time from a source I didn’t expect. things are going next month. For promotional reprints, contact reprint coordinator Carrie Gebert, [email protected]. SYS-CON Media and SYS-CON Publications, Inc., While at my sister’s I was browsing through Until then, enjoy our Linux focus issue reserve the right to revise, republish and authorize its readers the well-known title Computer Shopper, (UK and please check our Calvin’s really enlight- to use the articles submitted for publication. edition). This title is seen everywhere, and ening article on Linux/Java threads. Java and Java-based marks are trademarks or registered trademarks of manages to creep onto the majority of IT Sun Microsystems, Inc., in the United States and other countries. SYS-CON Publications, Inc., is independent of Sun Microsystems, Inc. All brand and product names used on these pages are trade names, service marks or [email protected] trademarks of their respective companies. AUTHOR BIO When not answering your e-mails and working on the next issue of JDJ, Alan heads up a small team dubbed the “Thunderbirds of the Java industry,” providing on- and offsite rescue for Java projects in trouble. For more information visit www.javaSOS.com. You can also read his blog: http://alan.blog-city.com.

JANUARY 2003 5

Java COM GUEST EDITORIAL

PRESIDENT AND CEO Java and Linux – FUAT A. KIRCAALI [email protected] COO/CFO MARK HARABEDIAN [email protected] VICE PRESIDENT,BUSINESS DEVELOPMENT WRITTEN BY A Marriage Made in IT Heaven GRISHA DAVIDA [email protected] SCOTT HANDY ADVERTISING SENIOR VICE PRESIDENT,SALES AND MARKETING ho would have guessed that and the tools vendors – including IBM’s key CARMEN GONZALEZ [email protected] this duo – Java and Linux – competitors. The numbers speak for them- VICE PRESIDENT,SALES AND MARKETING MILES SILVERMAN [email protected] would revitalize the develop- selves. In its first year of availability, 175 J2SE W ADVERTISING SALES DIRECTOR ment community and help customers software vendors have participated in the ROBYN FORMA [email protected] make the move to an open, standards- project and have committed to delivering ADVERTISING ACCOUNT MANAGER based approach to computing? -based tools; there have been more MEGAN RING [email protected] The momentum surrounding Java and than 2.5 million downloads of the free ASSOCIATE SALES MANAGERS CARRIE GEBERT [email protected] Linux is undeniable. In just a few short years, Eclipse code by developers from around the KRISTIN KUHNLE [email protected] both have grown from grassroots movements to world. Pretty big numbers and a hot Java- ALISA CATALANO [email protected] leading topics in CTO offices around the world. based technology by most anyone’s metrics. The result is that both Java and Linux have sup- While it’s impossible to accurately chart the EDITORIAL J2EEport from multiple vendors and support J2ME multi- number of Linux-based applications that exist, EXECUTIVE EDITOR ple platforms – giving businesses the flexibility the number of developers who are just working NANCY VALENTINE [email protected] ASSOCIATE EDITORS required in today’s ever-changing marketplace. with IBM software has skyrocketed over the JAMIE MATUSOW [email protected] As the momentum builds, it’s clear that last five months. In that short time, more than GAIL SCHULTZ [email protected] developers go where the action is. Over the 34,000 developers have created over 4,200 JEAN CASSIDY [email protected] last three years Linux has been the fastest- Linux-based applications using IBM software. JENNIFER STILLEY [email protected] growing server operating system and IDC Creating this number of apps in five months – ONLINE EDITOR LIN GOETZ [email protected] projects that it will continue to be the fastest on any technology – is simply amazing. growing throughout their projection period. After taking a close look at these new appli- PRODUCTION Home When Linux first entered the picture, it cations, it quickly registered that all of these PRODUCTION CONSULTANT was mainly used for Web servers and file and new apps were developed using the Eclipse- JIM MORGAN [email protected] print serving. No additional Linux-based based WebSphere Studio tools for Linux, a Java LEAD DESIGNER applications were required beyond Apache tool. Over 56% of these developers said the LOUIS F. CUFFARI [email protected] ART DIRECTOR and SAMBA. Over time, businesses recog- new applications were created for a Java- ALEX BOTERO [email protected] nized the benefits of the operating system based app server that supports Web services. ASSOCIATE ART DIRECTOR and as Linux matured, they expanded the use Of course, this should not be surprising. RICHARD SILVERBERG [email protected] of the OS to run critical applications, such as Whether you talk to Microsoft or the J2EE- ASSISTANT ART DIRECTOR TAMI BEATTY [email protected] e-commerce, accounting, ERP, and CRM. based pack, which includes Sun, IBM, Oracle, It was at this phase of Linux adoption that BEA, and others, everyone agrees – Web ser- WEB SERVICES the developer community really started to vices is the direction for new application VICE PRESIDENT,INFORMATION SYSTEMS link Java and Linux together. As businesses development. Developers want to create ROBERT DIAMOND [email protected] demanded more Linux-based applications, apps that support a standards-based infra- WEB DESIGNERS developers turned to Java – because of its structure that will work with a variety of oper- STEPHEN KILMURRAY [email protected] CHRISTOPHER CROCE [email protected] multiplatform support – to create the apps. ating systems. They want an alternative to Another critical element that’s driving Windows and .NET. Increasingly, developers A CCOUNTING the success of Java and Linux is Eclipse. are using an Eclipse-based set of tools that ACCOUNTS RECEIVABLE Eclipse is an open-source development supports J2EE and Web services, enabling the KERRI VON ACHEN [email protected] FINANCIAL ANALYST platform that makes it much easier to cre- deployment of new applications on any JOAN LAROSE [email protected] ate tools and applications that work on a operating system, including Linux. ACCOUNTS PAYABLE number of different operating systems, The momentum surrounding Java and BETTY WHITE [email protected] including Linux. With Eclipse implemented Linux represents a huge shift in the IT as a Java-based framework, the tools that industry. More and more businesses are SYS-CON EVENTS were built on this technology would not be making the move to an open, standards- PRESIDENT,SYS-CON EVENTS locked into a particular operating system, based approach that works across platforms GRISHA DAVIDA [email protected] CONFERENCE MANAGER which was just what developers wanted. instead of getting locked into a proprietary MICHAEL LYNCH [email protected] While it’s true that IBM contributed the Windows-centric platform like .NET. REGIONAL SALES MANAGERS technology to open source and eclipse.org, As Forrest Gump would say, Java and MICHAEL PESICK [email protected] it has been broadly adopted by developers Linux “go together like peas and carrots.” RICHARD ANDERSON [email protected] C USTO MER RELATIONS [email protected] CUSTOMER SERVICE REPRESENTATIVE AUTHOR BIO MARGIE DOWNS [email protected] Scott Handy is director, Linux Software Solutions for the IBM Software Group, and is responsible for Linux activity across IBM’s broad JDJ STORE MANAGER portfolio of e-business infrastructure software. Scott has a BS in electrical engineering and computer science from the University of RACHEL MCGOURAN [email protected] California, Berkeley.

6 JANUARY 2003

Java COM Developing Web Services before WebLogic Workshop.

Developing Web Services after WebLogic Workshop.

If getting dinner via a spear strikes you as less than efficient, you’ll appreciate BEA WebLogic Workshop™. This unique development framework eliminates tedious and time-consuming steps, while you build Web services, create new applications and tackle the toughest integration challenges. Plus, you’ll have all the support of our dev2dev developer community. To see how BEA WebLogic Workshop can radically simplify your Web services development, download it today at dev2dev.bea.com/useworkshop.

The fastest route to enterprise Web services.

BEA and WebLogic are registered trademarks, and BEA WebLogic Workshop is a trademark of BEA Systems, Inc. © 2002 BEA Systems, Inc. J2EE EDITORIALOR J2EE INDEXX

J2ME TCO for Linux and J2EE Projects AJIT SAGAR J2EE EDITOR A colleague of mine is an easy target for anything that’s free. I’m not talking about free from the perspective of “unshackled” or “independent.” Rather, I’m talking about the type

J2SE TCO for Linuxand J2EE Projects of free that won’t make his wal- 8 colleague of mine is an easy target this case, Linux. You can, of course, obtain let thinner. Since there is ample for anything that’s free. I’m not Linux for free. But do you download the synergy between J2EE and Atalking about free from the per- free version or do you purchase the shrink- Linux environments, the cost of spective of “unshackled” or “indepen- wrapped version from Red Hat, Debian, or developing an application in dent.” Rather, I’m talking about the type of one of the other vendors? Chances are, if J2EE that’s deployed in Linux free that won’t make his wallet thinner. To you’re working on a commercial project, becomes a very attractive him anything that looks, tastes, or smells you do the latter; essentially you pay for the proposition. “free” is the most beautiful thing in the support and the installation utilities. If you by Ajit Sagar J2EE world, at least at that moment. As we all want to do J2EE development and deploy- know, there’s no such thing as free in real ment, you will need an enterprise version. life. There is the concept of what’s cheap, For example, I just looked up the price of but cheap is relative. Red Hat Linux Advanced Server. From one Tools of the Trade We all experienced the technology bub- online source, the cost is $2,638.25 for While the jury is still out on ble. A couple of years ago, if you wanted to standard support and much more for pre- whether Linux will ever conquer introduce a new product in the market, one mium. This moves Linux up from free to Aunt Sadie’s desktop, it has

Home of the best strategies was to buy a lot of stuff cheap, as compared to a similar vendor. always been a coder’s paradise. from third-party vendors, glue it all togeth- Wait a minute, you still need an applica- That goes for Java coders, too. If 10 er, and sell it as a new offering. Buy an OS tion server in order to build your J2EE appli- you’re a Java old timer, but a from here, an app server from there, a con- cation. For example, in August 2002, Linux newbie, follow me on this tent management system from hither, and a WebLogic announced an enhanced commit- basic tour of how to write Java commerce server from beyond – and voilà! ment to the Linux community through a new on Linux. you had a product. If your internal develop- deal with Red Hat, Inc. While this is all good, by Mike McCallister ment team couldn’t hack it together, you as you buy more third-party products that could always hire high-priced consultants will run on Linux to produce and deploy your from the same vendor who charged the big application, the costs keep mounting up. bucks for the product, and still deliver to the Don’t get me wrong. Linux is a leading Managing HttpSession customer on time. Time was the main fac- contender for the enterprise J2EE space. Objects tor, not money. The end client was willing to But the reason is no longer because it’s free. Java servlet technology pay for all the OEM-ed products that lay After all, J2EE is free if you use the reference provides developers with hidden inside your product. implementation. But do you make that functionality, scalability, and Obviously, all that has changed now. choice for your application? TCO studies portability that can’t be found Hence this propensity toward cheaper done by various sources indicate that in other server-side lan- alternatives and this migration toward Linux may be one of the cheapest and most guages. One feature of the open-source software as the only reason- feasible options for producing J2EE appli- Java servlet specification 18 able alternative. Since there is ample syn- cations. It definitely has industry support. that’s commonly used, and ergy between J2EE and Linux environ- However, what really counts is that it is one sometimes misused, is the ments, the cost of developing an applica- of the best options for deploying quality HttpSession interface. This tion in J2EE that is deployed in Linux products because of its scalability and reli- simple interface allows you to becomes a very attractive proposition. But ability and the amount of community sup- maintain a session or state when embarking on such a project, it’s port. One of the challenges still facing the for Web site visitors. important to consider all the facets Linux camp is to change the perception by Brian A. Russell involved in developing, marketing, and that management in large companies has deploying the application. Eventually, regarding the validity of “free” or “cheap” what is the total cost of ownership (TCO) software. Development has to emphasize of the deployed solution? the fact that these qualifiers do not mean Let’s start with the operating system, in “unsupported.”

[email protected] AUTHOR BIO Ajit Sagar is the J2EE editor of JDJ and the founding editor of XML-Journal. He is the director of engineering at Controlling Factor, a leading B2B software solutions firm based in Dallas, and is well versed in Java,Web, and XML technologies.

8 JANUARY 2003

Java COM

Home J2EE J2SE J2ME 10 M J ANUARY IKE M Tools of RTE BY WRITTEN C C ALLISTER 2003 and ahalf-dozen texteditors. My SuSE and/or GNOME desktopenvironments, installed by default, alongwiththeKDE ment tools. Odds are atleastoneJDKis generally comechockfullofdevelop- ready codingJava. tostart Distributions installed,you’retribution basically “Getting Linux.”) seethesidebar , need more onhow information toget a and installtheproper drivers. (If you the installersallautodetecteverything Basic hardware isexcellent support and is noharder thaninstalling Windows. (Reddistributions Hat, Mandrake, SuSE) days installinganyofthemajorLinux install” isincreasingly alegend. These now.worrying The “difficult Linux difficultytoinstall, stop of itslegendary Getting Started Start coding! 5. Chooseyour environment. 4. ChooseaJDK:Sun, IBM,Blackdown. 3. See whattoolsare already installed. 2. Install distribution. your favorite 1. Five EasySteps to Programming onLinux how Java towrite onLinux. newbie, follow meonthisbasictourof If you’re aJava oldtimer, butaLinux paradise. That goesforJava coders, too. desktop, ithasalwaysbeenacoder’s Linux willeverconquerAunt Sadie’s the OSjustsohecouldcodeathome. forgot isthatLinus Torvalds invented an OSforsysadmins. What thosepeople have thoughtthatLinuxwasreally just the universe. dot-comsslatedtorule underfunded Apache forthe stokedthefurnace stable itwasfornext-to-nocost.How greatprises gobsofcashinstorage. How the server. How Linuxwouldsaveenter- the late’90s, allthehypewasdirected at The best part isonceyou haveadis- The bestpart If you’ve Linux because beenfearing isstilloutonwhether While thejury In thefaceofallthathype, somemay When theGNU/Linuxboomhitin the Trade iu rwe,butcanyou actually codefromLinux browser, aLinux box? S r,there’s aJVMfor Linux andapplets willruninany ure, your systemtomakesure alldependen- Debian). Running anRPM filewillcheck tions (withthe majorexception of ed by mostofthepopularLinuxdistribu- applications underLinux,andissupport- system isastandard methodofinstalling file. The Red Hat Package Management option todownload theirSDKsasan RPM that bothSun andIBMgiveyou the nearly allthingsrelated toJava onLinux. site. Blackdown isalsothehomefor sion oftheBlackdown JDK from their Blackdown Organization ( ware developmentkitwascreated by the done thatalready). required atbothsites(ifyou haven’t preter, andaJVM.Free registration is time compiler, amixed-modeinter- version includesanenhancedjust-in- able forversions1.3.1and1.4.0.IBM’s do loads Java site( J2SE andJ2EEJDKsdirectly from theSun to use. nextiswhichJDK picking adistribution, abundance ofchoicestomake. After Javamers whowanttowrite havean Pick YourJDK required. muss, nofuss, and(usually)noreboot watch ittakecare oftheoperation –no do isgetonline, theupdateapp, run and have different names, butallyou haveto any appincludedinthedistro. They one-stop-shopping methodofupdating hasa to keepupdated.Eachdistribution on your system. The software issoeasy tion havebeentestedandwillwork well applications includedwiththedistribu- confident thattheJDKandother available onCDorDVD. the IBMJDKandhastwoothers 8.0 Professional installationincluded wn.or The goodnewsforLinuxnewbiesis The first official port oftheJavaThe firstofficialport soft- You canget recent ofthe Linuxports As withmanythingsLinux,program- Two advantages here: you canbe ). IBMalsohasaLinuxJDKavail- g ). You candownload anyver- http://jav FUNDAMENTALS a.sun.com/do www .black wn - appropriate directories.appropriate cies are present andinstallfilesintothe • • Edition forJava, andaMobile Edition. free Community Edition, anEnterprise NetBeans andcomesinthree flavors:a Sun ONEStudio(Forte) you’re already usingEmacs. ing, you probably wanttouseJDEonlyif with theEmacseditor. Generally speak- JEdit isfree software; andJDEcomes commercial IDEshave30-daytrials; which fitsyour stylebest. The three andJEdit. Emacs Java extensions(JDE), Borland’s JBuilder IDE,CodeGuide, the advanced: theSun ONEStudio, page. I’ll highlightafewofthemost tools listedontheBlackdown Products lighten theload. There are quiteafew Java from scratch. But how easyisthat? mand lineandtexteditor, you canwrite are available forLinux.So withacom- mentations ofothernoncore technologies JavaComm implementation,andimple- database connectivity. IBMoffersa SQL, Oracle, etc.) for haveJDBCdrivers major Linuxdatabases(MySQL, Postgre and technologiesfortheirversion.Allthe and JREscontainallthestandard tools Solaris Java developerhas. AllLinuxJDKs the everything virtually Windows or Pick anIDE Programming inLinux Java port for J2EE, the Enterprise Edition forJ2EE,the Enterprise port Community sup- Edition hasgeneric Enterprise Edition forJava: and XMLdocuments. mat. It alsogenerates Javadoc, HTML, nectivity toanyotherdatabase for- Tomcat Web server. You getJDBC con- PointBase databaseanda Server tem; andincludestheJava-based theAntbuildsys- supports servlets; applets, JavaServer Pages, and robust free optionletsyou build Community Edition: Sun’s own isbasedonForte’s offering Download anyorallofthesetosee Fortunately, there are Linuxtoolsto The LinuxJava developerhasaccessto J ava This surprisingly While the COM analyze the problem

understand the customer needs

define the requirements

control the changes

deliver the right solution

start club for overachievers

be liberated

A job? A job is something normal people have. You, however, have 20 jobs. You have customers to satisfy. Requirements to meet. Changes to control. And more. But if you’re lucky, you also have Rational.® With solutions to help you visually describe and manage requirements.

Solutions that automate traceability across your project’s lifecycle, so you can control and communicate the impact of changes. And solutions that are flexible, easy to learn in a day and easy to expand over time. Find out how Rational can liberate you and help you satisfy your customers. Go to www.rational.com/offer/roadmap4 today to get your free roadmap to business modeling and requirements management.

Rational and the Rational logo are trademarks or registered trademarks of Rational Software Corporation in the United States and in other countries. ALL RIGHTS RESERVED. Made in the U.S.A. ©2002 Rational Software Corporation. FUNDAMENTALS

(at $1,995) adds an RMI compiler, CodeGuide CORBA and application support, and CodeGuide from the German devel- the ability to create Enterprise oper Omnicore is a low-cost ($299 for a INSTALLING YOUR JDK JavaBeans. Enterprise also lets you single-developer license) cross-platform create SOAP-based Web services. Java IDE for Standard and Enterprise On the off chance your distribution does- Additional stuff is available on Solaris, Edition apps. It claims to analyze your n’t have the JDK you want, you may have to

J2ME but Linux users should find this more source code on the fly, comes with Ant do the heavy lifting of installing it yourself. than adequate. and Tomcat, and does instant compila- Here’s how. • Mobile Edition: This slightly stripped- tion. down version takes out what you Installing an RPM would expect (servlet and CORBA Java Development Environment for In MS Windows, installing any new appli- support, database connectivity) and Emacs (JDEE) cation is usually just a matter of double-click- adds the J2ME module. The fabled GNU Emacs text editor ing setup.exe. The install file does the rest, (and its GUI clone Xemacs) has a storied with the occasional user prompt. The Red Hat J2SE Borland JBuilder reputation of being able to do just about Package Management system is a largely JBuilder gives you all the tools you’d anything within its confines. James successful Linux way to do the same thing. expect in a modern IDE. Wizards to cre- Gosling even wrote his own version To install the Sun or IBM JDK/JRE from its ate projects, applets, apps, classes – before the GNU project began. So, of RPM file, type rpm IBMJava2-SDK-1.4- even beans! – and AWT GUI course, Emacs does Java. 0.0.i386.rpm from a terminal prompt. If you builders, debuggers, etc. As with Java, The JDE major mode is written and happen to be working from a GUI desktop, there are three flavors of JBuilder: managed by Paul Kinnucan. It’s includ- open a file manager like Konqueror (in KDE) or • Personal Edition: Not just for embed- ed with all recent versions of Emacs, but Nautilus (in GNOME) and – surprise! – click! ded apps, JBuilder Personal Edition is Xemacs users may have to download From Konqueror, KDE will load the KPackage J2EE a free download for creating all non- this package from the JDEE homepage RPM front end. Check your preferred options commercial Java apps, classes, and (http://jdee.sunsite.dk). The site is and click Install. After verifying that you have applets. This is a no-frills version (as worth checking out in any case. Root privileges, RPM checks for all dependen- you would expect), but is more than You must have a JDK installed for JDE cies, then installs the package where it should adequate for the beginning Java to work, and a set of Lisp programs (the go (most times there aren’t options here). developer. You can write, debug, and Enhanced Implementation of Emacs optimize your projects. You also have Interpreted Objects [EIEIO] object-ori- Installing from a Tarball or Bin File

Home access to the essential Java documen- ented Lisp package, the semantic parser The Blackdown JDK/JRE only comes in tation within the Help system. The generator, and the speedbar file browser) tarball format, though for v1.4 the tarball is Personal Edition is currently at ver- accessible from the site. wrapped in a self-extracting bin file. For those sion 7, and builds to the 1.3.1 JDK by Opening a file with a .java extension of you used to Windows, tarballs (i.e., files default. If you have another JDK on in Emacs automatically puts you in JDE with a tar.gz extension) are Unix archives, just your system, you can replace the mode. You get a Java menu and syntax like ZIP files. To install the Blackdown JDK, default JDK reference, but not add it. color coding; you can edit, compile, follow these steps: • Standard Edition: The Standard debug, and run files of all types; and you 1. Open a terminal. Log in as Root or Edition adds the ability to write can use Ant or make it a build system. SuperUser (su). JavaBeans and use other J2SE tools. It There’s even a BeanShell command 2. Change to the directory where the JDK file uses Ant as a build system for your interpreter included with JDE. (j2sdk-1.4.1-beta-linux-i586.bin) is. Ideally, projects. Write to multiple JDKs, gener- you’ve downloaded the bin file to the install ate JavaDoc documentation, and get JEdit directory (Blackdown suggests installing to support for translation and CVS ver- Much has been said in the pages of /usr/local). If you downloaded to another sion control. Version 8 adds accessibil- JDJ about the wonders of JEdit. This directory, copy the file over. ity features for Section 508 compliance very cool Java-based text editor is, of 3. Make the bin file executable: +x j2sdk- and red lines problem code. Download course, multiplatform and also open 1.4.1-beta-linux-i586.bin. a 30-day trial from the Borland site. source. JEdit is included with several 4. Run the bin file: ./ j2sdk-1.4.1-beta-linux- • Enterprise Edition: Borland throws in distributions (though the one includ- i586.bin.You’ll be asked to agree to the the kitchen sink in the enterprise ver- ed with SuSE 8.0 is an earlier version), license, then the file will extract, creating a sion (the feature matrix document and can be downloaded either as an new j2sdk141 directory with several new runs 17 pages!). Write EJBs (v1 and 2), executable JAR or as a Linux-specific subdirectories. EJB modules, and test clients, and RPM. 5. To give the system a pointer to this SDK, make Enterprise Archives (EAR) and JEdit is very much like Emacs with- add this path statement: export JMS projects. Use the Ant build system. out the complex keyboard commands. It PATH=/usr/local/j2sdk1.4.1/bin:$PATH. The Enterprise Edition has extensive comes with syntax highlighting, a This is especially important if you have XML support, Rational ClearCase and BeanShell interpreter, and a few Java- other JDKs or JREs on your system. Visual SourceSafe features, servlets for specific macros. Where the real power all major server types, a SQL tool suite, comes in is with the plug-ins con- If you download a plain tarball from Sun or an embedded database, and tributed by the JEdit community. You IBM, make sure the .tar.gz file is in the install JDataStore. You name it, it’s here. can install new plug-ins or update your directory, then type this command from the Version 8 adds Web services support current ones right from the Plug-ins terminal: and a Struts application framework. menu in the editor. The User Guide and The Enterprise Performance Bundle help system explain both the macro lan- Tar -xzvf j2sdk-141-beta-linux-i586.tar.gz adds the Optimizeit Suite. Download a guage and the plug-in architecture so 30-day trial from the Borland site. you can make your own.

12 JANUARY 2003

Java COM The ultimate JavaTM server ® and client components JClass

Now part of

JClass is the only professional-quality Java component family that covers every facet of Java development – sophisticated client-side user interface components, reporting and utility components, server-side web client components, and web services ready components. With unrivaled platform, JDK, web/application server and IDE support, JClass works everywhere your application does, or will.

JClass DesktopViews The only components you need for Java applications and applets: 2D/3D charts, tables, reporting, data-entry fields, database, tree view, layout managers, and much more. Build enterprise-class user interfaces quickly and cost-effectively.

JClass ServerViews Now fully XML and Web Services ready! Add professional, dynamic content to your Servlet, JSP, or J2EE applications. Generate interactive charts with JClass ServerChart and dynamic PDF documents and reports with JClass ServerReport.

Evaluate and experience JClass for yourself – visit: www.sitraka.com/jclass/jdj

© 2003 Quest Software, Inc. Quest, Sitraka and JClass are trademarks or registered trademarks of Quest Software, Inc. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. All other products are trademarks or registered trademarks of their respective companies.

FUNDAMENTALS

DISTRIBUTION PROS CONS WEB SITE

Red Hat • Leading distribution in U.S. • None to speak of, though www.redhat.com • Retail presence company’s focus is on server • Excellent support functions. • Stable company

J2ME • Update through Red Hat Network

SuSE • Leading European distribution • Get the Professional version www.suse.com • Excellent install/update tool (YaST) for serious programming • Some retail presence • Occasionally you’ll find docu- (mostly through technical bookstores) mentation in German • Professional version includes massive • Sometimes slow to add number of apps (8 CDs worth – updated software to server J2SE though you can use a DVD) • Great printed documentation

Mandrake • Generally rated the easiest Linux install • Buy the Power Pack edition www.linux-mandrake.com • Oriented toward the standard desktop user for the most development- • Can get it through some resellers, or related packages preloaded on some new PCs • No JDKs included in any bun- dle, but downloadable through MandrakeUpdate J2EE

Debian • Most stable distribution, new versions not • Standard distribution not www.debian.org released unless everything works easy to install (use Libranet www.libranet.com • Easy command-line updating with apt-get or Xandros Desktop to get all www.xandros.com • Oriented to the hobbyist, developer, geek the Debian pluses with an • Versions code named for Toy Story characters easier install) • Stable distribution not often

Home updated; mixing current “unstable” software can be troublesome (though less so than in earlier versions) FIGURE 1 The cutline TABLE 1: Linux distributions

Summary Further Reading • Sun ONE Studio: www.sun.com/soft- Yes, you can program Java in Linux. If you are interested in coding Java ware/sundev/jde/index.html This article showed you how to get and under Linux, check out Java Pro- • CodeGuide: www.omnicore.com install the three JDKs; introduced the gramming on Linux by Nathan Meyers. • A comprehensive list of Java-related Red Hat Package Manager; and Only slightly dated, the book describes RPM packages: www.jpackage.org described Sun ONE Studio, Borland everything you need to know, and JBuilder, Omnicore CodeGuide, JEdit, attempts to be comprehensive in identi- Mailing Lists/Support and the Java Development Environment fying tools. Its companion Web site, The Java-Linux mailing list is a place for Emacs (JDEE). www.JavaLinux.net, is an important for news and troubleshooting problems. source for updated information and It’s archived at the Blackdown site. GETTING LINUX essential links for both Linux and Java Subscribe at java-linux-request@java. beginners. blackdown.org with subscribe in the Want to get going on Linux, but haven’t subject. installed it on your box yet? You have choices. Links Run into trouble with JDEE? Different companies bundle the Linux kernel • Blackdown Organization and Java- There’s an active listserv of 600+ AUTHOR BIO with different application packages, installa- Linux archives: www.blackdown Emacs Java junkies ready to help. Mike McCallister is tion methods, and service/support options. .org Send a blank message to jde-sub- a freelance Linux These are called distributions. The practical • Links to all Linux JDKs: www.javalin- [email protected] to check it out. A writer based in differences between various Linux distribu- ux.net/JavaLinux/SDK.html searchable archive of the list is also at Milwaukee and is tions are small (especially compared to the • Nathan Meyers’ Java-Linux FAQ: the JDEE Web site. constantly on the differences between the various Unixes), so www.jguru.com/faq/Linux JEdit handles support through its lookout for virtually any Linux-specific app will run on any • Blackdown’s Java-Linux FAQ: www.black community site, http://community.jedit interesting distribution, and all have a JVM to run Java down.org/javalinux/docs/support/faq- .org. There are over 3,000 registered documentation apps. release/FAQ-java-linux.html members on the site, and on a recent projects. Mike is the There are dozens of distributions to • Java Development Environment for visit there were 300 guests to just 5 author of Computer choose from, if you’re so inclined, but the vast Emacs: http://jdee.sunsite.dk members, indicating an even larger Certification majority of Linux users pick one of the distri- • JEdit: www.jedit.org community. Handbook (2000, butions listed in Table 1. • Borland JBuilder: www.borland.com/ Arco Press). jbuilder/index.html [email protected]

16 JANUARY 2003

Java COM

J2ME J2SE

ava servlet technology provides developers with func- sessions are created and destroyed on the application server. Its best practical use would be to track session use statistics for tionality, scalability, and portability that can’t be a server. The use of HttpSessionListener requires a configuration J2EE found in other server-side languages. One feature of entry in the deployment descriptor, or web.xml file, of the application server. This entry points the server to a class that J the Java servlet specification that’s commonly used, will be called when a session is created or destroyed. The entry required is simple. All you need is a listener and listener-class and sometimes misused, is the HttpSession interface. This sim- element in the following format. The listener-class element must be a fully qualified class name. ple interface allows you to maintain a session or state for Web

Home site visitors. package.Class In my previous article (“Introduction to Session Management,” [JDJ, Vol. 7, issue 9]), I introduced you to ses- As you can see in Figure 1, the class that implements this sion management and the HttpSession interface. In that arti- listener can override two methods: sessionCreated() and cle, we walked through using the HttpSession API to create, sessionDestroyed(). These methods will be notified when the use, and destroy session objects for Web site visitors. The next server creates or destroys a session. step is to better understand how to manage the sessions and These methods take an HttpSessionEvent object as a those objects in a session. This article will help you achieve parameter. HttpSessionEvent is simply a class that represents this by helping you understand the following concepts: notifications of changes to the Web application’s sessions. • Code-based session management through listeners HttpSessionEvent has one method, getSession(), that returns • Proper design of the session and the objects it contains the HttpSession object that’s been modified. • Controlling what is in the session and why it’s there • Session persistence HttpSessionBindingListener • Memory management The HttpSessionBindingListener interface is implemented when an object needs to be notified if it’s being bound to a ses- The Java APIs discussed in this article are from Sun’s Java sion or unbound from a session. Servlet 2.3 specification. This interface has two methods, valueBound() and valueUnbound(), that are notified when the status of the Listeners object has changed (see Figure 1). A listener is an object that’s called when a specified event These methods have an HttpSessionBindingEvent param- occurs. There are four listener interfaces that allow you to eter that can be used to retrieve the session that the object was monitor changes to sessions and the objects that are in those bound to and the name it was given in the session. In Figure 2, sessions: you can see the methods of this object that are used to get the • HttpSessionListener name that’s assigned to the object, the session it’s bound to, • HttpSessionBindingListener and the actual object. • HttpSessionAttributeListener • HttpSessionActivationListener HttpSessionAttributeListener The HttpSessionAttributeListener interface is used to Figure 1 provides a method summary for each of the lis- monitor changes to attributes in any session on the server. tener interfaces. The implementing class that you write will This can be useful when you know the name assigned to a spe- override these methods to provide the functionality you need. cific object that gets put into the session and you want to track how often it’s being used. HttpSessionListener As with HttpSessionListener, HttpSessionAttributeListener The HttpSessionListener interface is used to monitor when also requires an entry in the deployment descriptor for the

18 JANUARY 2003

Java COM Automate unit test case generation “We make software work.” for JUnit and Java™ with Parasoft Jtest.

point click results

(It’s as easy as 1-2-3.)

Parasoft Jtest is the first and only automated unit testing tool for Java™ development.

With just a click, Jtest reads and analyzes code — quickly creating harnesses, stubs and test inputs — and tests without user interven- tion. Jtest also enables you to automate regression testing and stat- ic analysis. For loyal JUnit users, Jtest is designed to fully support existing test cases and automate the creation of new JUnit-compati- ble test cases. Learn how Jtest can enhance JUnit capabilities... Download a free eval copy of Jtest along with our informative new white paper entitled "Using Jtest With JUnit." • For Downloads go to www.parasoft.com/jdj1. Or call 888-305-0041. Special Offer: For a limited time, every 100th customer to download an eval copy of Jtest automatically wins a fully licensed copy — FREE OF CHARGE.

Copyright ©2003 Parasoft Corporation. All rights reserved. All Parasoft product names are trademarks or reg- istered trademarks of Parasoft Corporation in the United States and other countries. All other marks are the property of their respective owners.

Platforms: Linux Solaris Windows NT/2000/XP

A part of Parasoft Automated Error Prevention (AEP) Solutions and Services user will continue to receive all subsequent requests from that user. This means that a session created for the user on the application server will continue to be available for that user. If the server suddenly fails, there has to be a system in place to allow the session to continue on without it. Session persistence allows the session contents to be saved outside the application server so that other servers can access

J2ME it. Figure 3 shows the relationship between the persisted ses- sion data and the application servers that access it. In this fig- ure, you see a client accessing a Web site’s HTTP server. The HTTP server is forwarding requests for application resources to one of the application servers through the use of a proxy server. The application servers are persisting the session data in an external form. There are four types of session persistence: J2SE 1. Memory persistence (one server or a cluster of two or more) 2. File system persistence 3. Database persistence 4. Cookie persistence

Every application server will handle session persistence differently and all servers may not support all types of persist- ence. Objects that are placed in the session must be serializ- able for persistence to work. J2EE

Memory Persistence In most cases, a single standalone server will store sessions in memory. This allows for fast retrieval and update of the information. It also means that the session information will be lost when the server is shut down. This is usually the default configuration on most application servers. Memory persist-

Home ence can be used when two or more servers need to share the FIGURE 1 Listener APIs session information. The application servers can be config- ured to share any changes made to the session so that the server. This entry tells the server which class to call when an information is available on multiple servers. This redundancy attribute in a session has changed. of the session information helps the cluster preserve the ses- The HttpSessionAttributeListener interface has three sion during a failure. methods – attributeAdded(), attributeRemoved(), and attributeReplaced(). These methods, shown in Figure 1, are File System Persistence called by the server when attributes of a session are changed. File system persistence can be used to serialize any objects that are in the session. The object contents are placed in a file HttpSessionActivationListener on the server. The location of the files created is configurable; The final listener, HttpSessionActivationListener, is imple- however, the files must be accessible by all the servers in the mented when an object needs to know if the session that it’s cluster. The speed at which the file system is accessed can be bound to is being activated or passivated (moved). You would a factor in the performance of your Web site. A slow disk drive, come across this scenario if your session is being shared for example, would result in a delay as data is read from or across JVMs or your server is persisting the session in a data- written to the file. base or file system. This interface, displayed in Figure 1, has two methods that Database Persistence are overridden by the implementing class: sessionDid- Database persistence can be used to provide a central data Activate() and sessionWillPassivate(). These methods are store for the session contents. Each application server in the called when the status of the session in a JVM is changed. cluster must be able to access the database. When sessions are modified, the changes are immediately persisted in the data- Session Persistence base. A data source is usually set up for JDBC persistence and Today’s J2EE-compliant servers allow for fault-tolerance the connections are pooled. This provides a quicker response. and failover to provide support in the event that a server sud- There’s also the issue of database failover, which would be denly becomes unavailable because of hardware, software, or addressed at the database level of the system. network failure. This support is usually provided by allowing two or more application servers, often called a cluster, to run Cookie Persistence together and provide backup support for each other. If one The fourth type of session persistence, cookie persistence, server fails, the others pick up the requests and continue on as is so ineffective and insecure that it doesn’t deserve consider- if nothing happened. This allows your Web site visitors to keep ation when designing a fail-safe system. Cookie persistence, as going without interruption. the name implies, persists session data by storing the session A proxy server is usually used in front of the application information in browser cookie(s). There’s a limitation on data servers. This server is responsible for directing each HTTP handling because cookies store only text, not objects, and the request to the appropriate server. The proxy server can be set amount of data that can be transmitted in a cookie is limited. up to ensure that the server receiving the first request from a There’s also the fact that cookies transmit data back and forth

20 JANUARY 2003

Java COM

between the client and the server. This prevents you (at least it Some objects should be stored in the session. Objects that should) from saving sensitive information, like a social securi- may be needed over and over again as a user moves through a ty number. This type of persistence should be used in only the Web site are those that should be put into the session. smallest of Web sites, and only if there’s a good reason not to Anything that needs to exist longer than one request can be store the session in memory. stored in the session, as long as these objects are removed as The most common type of persistence is database persist- soon as they’re no longer needed. ence. It provides an efficient way of saving session data and it’s

J2ME usually fairly easy to set up on the application server. Memory Considerations for Managing Sessions persistence in a cluster is also easy to use, if your application When working with sessions, there are a few things to con- server supports it. The only drawback is that sessions can sider before designing or redesigning a Web application: sometimes hold large amounts of data. Storing the session in • Are sessions needed in the application? memory reduces the amount of memory available to the other • How long should the session be inactive before timing out? processes on the server. File system persistence can be slow at • Are all the objects in the session serializable? times and the file system may not always be accessible to mul- • Are the objects being bound to the session too large? tiple servers. • Do the objects that are in the session really need to be J2SE there? Watching the Session Size As you and your fellow employees work on a Web applica- A Need for Sessions tion, you may notice that more and more objects are being If you have unique users on a Web site and need to know who they are or need to get specific information to them, such as search results, then you should be using sessions. If you fol- low the guidelines set here, there’s no reason not to use the HttpSession interface that Java provides. It’s easy to use, flexi- ble, secure, and it helps you to build a better Web site. J2EE There’s another architecture that deals with maintaining state for a client. Instead of relying on the HttpSession inter- face, state for clients can be maintained within Enterprise JavaBeans (EJBs). The EJB architecture takes the business logic for an application and places it in components or beans. A session bean is a type of EJB that exists for a given client/serv- er session and provides database access or other business

Home logic, such as calculations. Session beans can be stateless or FIGURE 2 HTTPSessionBindingEvent API they can maintain the state for a client, very much like an HttpSession object. thrown into the session, often “for convenience” or “just tem- There is still some debate over where the state for a Web porarily.” The session becomes a quick catch-all for any infor- site visitor should be maintained. The best design for the mation you need to get from your servlets to your JSPs. The application at this time is to continue using the HttpSession HttpSession interface makes sessions easy to use, which can object for maintaining the state of the presentation layer of lead to the session being overused. This is a concern because the Web application and to use stateful EJBs to maintain the the session takes up space. In most cases that would be mem- state of the business logic and data layer. There are many ory space. In other cases, it could be database or file system other factors that should be considered with EJBs, one being space. In all cases, it means more work for the server and more the better performance of stateless beans over those that work for the programmers to manage what is there. maintain state. These issues, which are outside the scope of Although the session is convenient because it’s accessible this article, should be considered carefully when architecting from every servlet or JSP, it’s not always the best place to put an application. information. Most of the data that’s retrieved for display in a Web application will only be used on one page. Instead of put- Session Timeout ting the information into the session scope, use the By default, on most servers the session is set to expire after request scope and then forward the request from 30 minutes of inactivity. The amount of time can be config-

Today’s J2EE-compliant servers allow for fault-tolerance and failover to provide support in the event that a server suddenly becomes unavailable”

the servlet to the JSP. This causes the objects to be ured in the deployment descriptor of the Web application. The destroyed after the request has ended, which is after the HttpSession API also provides a setMaxInactiveInterval() data is displayed by the JSP. If you put the objects into the ses- method that you can use to specify the timeout period for a sion, you would either have to remove them in your code or session. The getMaxInactiveInterval() method will return this leave them there. Leaving objects in the session is not a good timeout value. The value given is in seconds. idea because you’re using up valuable resources for no reason. The length of time will vary depending on what your visi- This becomes even more of an issue when your Web site has tors are doing on your site. If they’re logging in to check their “hundreds or thousands of visitors, all of whom have a session account balance, a shorter session timeout period can be used that’s loaded with objects. because it doesn’t take long for a person to read a couple of

22 JANUARY 2003

Java COM DESIGN ONCE...

Instant Design/View SQL Builder or Write Your Own SQL

Multiple Data Sources: DB EJB XML API Dynamic Parameters Run Time Group/Sort Property Re-usable Inspector Components Drilldown, Hyperlink R TRADEMARKS BELONG TO THEIR RESPECTIVE HOLDERS. REPORT ANYWHERE.

Printer, Postscript

Flexible API’s

Excel Integration with Email App. Server, LDAP, etc. Data API SQL Server XML DB2

J R EJB e Oracle po rt Sc alab r PDF le Server Cluste HTML © COPYRIGHT 2002 JINFONET SOFTWARE, INC. ALL RIGHTS RESERVED. JREPORT AND ARE TRADEMARK OF OTHE JREPORT TM JReport lets you take your reports anywhere you want. And all this is built on 100% J2EE architecture, to provide Imagine creating reports that pull together data from virtu- secure, reliable, scalable performance and easy integration ally anywhere, arranging them any way you wish, and deliv- with your enterprise systems. You can count on JReport: ering them precisely – whether in pure HTML, PDF, Excel, any report, any format … anywhere. XML, JSP, email, or your network printer. Imagine having ad hoc reporting ability to create or modify reports on the fly, right from the end user’s browser.

FREE DOWNLOAD! VISIT www.jinfonet.com/j1.htm OR CALL 301-838-5560 numbers. If, on the other hand, the user is the session, why it’s there, and where it logging in to read large amounts of data, you gets removed. If you’re redesigning an need to be sure that you provide enough existing site, this may be a little tougher, time for the user to do what he or she wants especially when you have hundreds of without being logged out. If the user is con- servlets and JSPs to deal with. In this stantly navigating through your site, the ses- case, try implementing an sion will last indefinitely. HttpSessionAttributeListener to get an

J2ME idea of what is going into the session. Implement Serializable With this information, you may be able It’s important to make sure that all to better manage your sessions. objects placed in the session can be serial- ized. This may not be an issue if you know Conclusion that your Web application will not run in a Hopefully this article helped you to cluster, but it should still be done anyway. better understand the design issues What happens if your Web site grows too big involved in using the HttpSession inter- J2SE for one server and you suddenly have to face. Java provides a more robust session move to two? If you implement Serializable implementation than other languages. It’s in your code now, you won’t have to go back because of this power and flexibility that and do it later. you must take the time to properly lay out the use of the session. A well-designed ses- Keep It Simple FIGURE 3 Server cluster sion will help make a Web application bet- You should design objects that are going ter for the programmers and the users. to be placed into a session so that they’re not too big and don’t contain unnecessary information. A JavaBean that con- References J2EE AUTHOR BIO tains a customer’s name, address, phone number, e- • Hall, M. (2002). More Servlets and JavaServer Pages. Prentice Brian A. Russell is a address, credit card numbers, and order history should not be Hall PTR. software engineer at placed into the session if you’re only going to use the object • Java Servlet Technology: http://java.sun.com/products/ Priority Technologies, to get the customer’s name. servlet Inc., a leading • Enterprise JavaBeans Technology: http://java.sun.com/ software Session Contents products/ejb solutions provider for When you’re working on a Web site, it’s important to know • Java BluePrints (J2EE): http://java.sun.com/blueprints

Home the student loan which objects are in the session and why they’re needed. The /guidelines/designing_enterprise_applications industry, located in size of the session should be kept as small as possible. If you’re [email protected] Omaha, Nebraska. building a new Web site, work out ahead of time what goes in

24 JANUARY 2003

Java COM

J2SEJ EDITORIALOR J2SE INDEXX

Dipping Your Toe in the Water JASON BELL J2SE EDITOR There’s a saying – “Life is about choices” – that can also be applied to Linux. In the mainstream there are Dipping Your Toein the Water about 60 different vendors with a Linux distribution 26 here’s a saying – “Life is about understand how the server works, what working on a number of J2SE choices” – that can also be applied makes it tick, and what makes it crash. Also hardware platforms. Tto Linux. In the mainstream there it’s time to get serious about the way we Knowledge is key here and are about 60 different vendors with a Linux program and how we manage the way our knowing what to do if some- distribution working on a number of hard- programs work. For example, do you need thing goes wrong. ware platforms. For the enthusiasts that’s to implement a message queue system so by Jason Bell okay, as they can reinstall as often as they you don’t throttle the server with process- like. A business, on the other hand, may es? You need to know, and it’s knowledge not share the view that the best way to run like this that will advance your career to an operating system is by trial and error. bigger and greater things. A good working Packaging Java Knowledge is key here – and knowing what knowledge of the operating system you’re Applications for OS X to do if something goes wrong. using can create a better foundation for the Java on OS X is a Planning and preparation are key to a applications you’re building. first class citizen. You can successful Linux install. Be prepared to do Banco do Brasil is in the process of integrate your app so well a lot of reading before you make a deci- replacing its entire fleet of Windows boxes that users probably won’t 28 sion. If you don’t know which hardware is with Linux. As a result, they are converting even know they’re using a

Homeinstalled J2EEon the machine you’re going to their J2ME business logic over to Java. They oper- Java application. This article use, find out; it could make or break your ate with 78,000 employees and serve 12 mil- will show you how apps are chance of creating a working system. For lion customers. From where I’m standing it packaged on OS X. example, does your machine have an Intel sounds like they’ve really done their home- by Ian McFarland i810 video card that’s supported by your work, seen the cost benefits, and are moving Linux distribution? If not, how difficult will forward in quite an aggressive way. I just it be to include that in the kernel? Talk to wish more people were in a position to do as many people as you can, find a local the same. If anything the key here is that Java Java and Linux Linux user group to get involved with, and has matured over the last couple of years One well-known arrive at the meeting with a list of ques- and people are starting to see the benefits. difference between deploying tions. The nice thing about Linux users is With the right amount of research in the on Linux compared to other that they like to help. areas of Linux and Java, you can transform Unix operating systems is the Choosing a Java version can be a selective business practices, cut costs, and show the implementation of the system task too. First of all find out which Java ver- world that Java doesn’t revolve around a threads library. Linux threads 34 sions are currently stable within your chosen PetStore demo. It does come at a price: knowl- are implemented as a cloned Linux distribution. At the time of writing, edge and preparation. Once again I can’t stress process and, consequently, Debian (www.debian.org) is still using JDK enough the importance of talking to other the underlying thread imple- 1.1.8 as a stable (this is people, in person or on mailing lists. The mentation can affect the shipped under license). This may suit your chance of someone else being in the same behavior of the Java runtime. needs just fine. You can run a basic setup of predicament or situation is very high. By shar- by Calvin Austin Tomcat and a MySQL driver, for example, ing knowledge and experiences the Java com- and run a couple of Web apps from JDK 1.1.8; munity stands a very good chance of being the only thing you have to take into consider- able to deliver some exceptional products. ation is that some of the core classes from the Java 2 API will be missing (you’ll be surprised References how much you miss them). • Full Banco do Brasil story: We’re now entering an exciting time in www.vnunet.com/News/1137229 which Java on the server side is taking off. • Debian Linux: www.debian.org Java on the Linux server side gives us a • Tomcat: http://jakarta.apache.org/tom- secure and reliable architecture with which cat to host our applications, but we have to • MySQL: www.mysql.com

[email protected] AUTHOR BIO Jason Bell is a programmer and chief technical officer for a B2B Web portal in York, England. He has been involved in numerous Web projects over the past five years, the last two of which have been servlet-based.

26 JANUARY 2003

Java COM

INTEGRATION Packaging Java Applicationsfor OS X

Have great looking

J2SE double-clickable applications

Java on OS X is a first class citizen.You can integrate your app WRITTEN BY so well that users probably won’t even know they’re using a Java IAN MCFARLAND application.

You can package your apps so they first class application. The first thing cuss how to package your app using one have one of those lovely 128x128 icons. you’ll notice after the generic icon is that of the available tools. Then I’ll walk you Apps can be launched with a double- your app looks a little different from through the file hierarchy these tools click, and can even be bound to particu- other apps when it’s running. The appli- create so you’ll know what’s really going lar file types so that your app gets cation menu, which in other apps con- on underneath it all. launched when the documents are dou- tains the name of the application, sim- ble-clicked. Swing apps also get the lus- ply specifies the fully qualified class Packaging Tools cious Aqua user interface for free, and name of the main class you specified in There are a few tools that you can use with a couple of lines of code you can the manifest or on the command line to package your app for OS X. We’ll look

Home J2EEalso tell the runtime to let your app use J2ME (see Figure 2). Any menus in your app briefly at three of them, MRJAppBuilder, the system menu bar, and even use the will show up at the top of the window Project Builder, and OSXize. hardware acceleration, which you won’t the MenuBar (or JMenuBar) is associat- find on any other platform. ed with as well. This is not what your MRJAppBuilder Let’s look at how apps are packaged Mac users will expect, although it works MRJAppBuilder is included free in on OS X. just as well. With a tiny bit of work pack- the developer tools that ship with every aging your app, you can get full integra- copy of OS X. You can use it to package The Extremely Portable Approach tion with the system menu bar (see your own applications or to package up First, the easiest way to package a Figure 3). JAR files that someone else wrote. It also Java application for OS X is as a JAR file. Another advantage is that you can has a nice GUI (see Figure 4). As long as your JAR file includes the associate file types with your applica- You’ll find MRJAppBuilder and Project standard Main-Class attribute (and is tion when you package your app Builder in /Developer/Applications once otherwise properly formatted), you can according to the Apple guidelines. That you install the developer tools. (These double-click it and it will launch, or run way, you can have your app launch tools are found on a separate CD or in it from the command line by executing automatically when any of its associated /Applications/Installers on your hard java -jar filename.jar. (Without that files is double-clicked on. I’ll show you drive, depending on how you acquired OS Main-Class attribute, you’ll have to how to do that in detail in my next arti- X.) specify the main class, just as you would cle. For now, though, suffice it to say that on any other platform.)(The source the little bit of extra work you do pack- Project Builder code for this article can be downloaded aging your app gives you a lot nicer inte- Project Builder is the integrated from www.sys-con.com/java/sourcec gration to the platform on OS X. development environment that’s .cfm.) In the rest of this article, I’ll first dis- included free in the same set of develop- Of course, it won’t have its own fancy icon, just the standard OS X JAR file icon (see Figure 1). However, in the write FIGURE 1 The JAR Icon once, run anywhere tradition, this exact same file will run on OS X, Windows, The little bit of extra work you Solaris, Linux, or any other Java plat- form. If all you’re writing is a simple util- do packaging your app gives ity and you don’t want to spend the extra “ effort to support OS X, then you’re done. you a lot nicer integration to The Extremely Well-Integrated Approach Although the extremely portable the platform on OS X approach works pretty well as far as it goes, what you get doesn’t look like a

28 JANUARY 2003 Java ”COM

INTEGRATION

er tools as MRJAppBuilder. It’s a nice existing JAR files to fully fledged OS X OS made the big leap to Unix, it’s been a IDE, and I use it for a lot of my own applications, whether you wrote them lot more file-oriented than previous development work, whether it targets or not, and whether you have the source incarnations. Gone are the days of com- OS X or not. (I’ve written a lot of Web code or not, although since it’s a com- plex file formats with separate resource applications that were eventually mand-line app, you can do it in just a and data forks. Well, almost gone. The deployed on Linux, Windows, and few keystrokes. OS still supports them, but mostly for Solaris using Project Builder and I like it In fact, to convert an existing JAR file backward compatibility reasons at this a lot.) It includes project templates for a to an OS X application, all you have to point. wide number of Java project types, do is run the following command line: Instead, the Apple team based most Swing applications, Swing applets, AWT of their packaging on special arrange- applications and applets, command- java -jar osxize.jar -addjar ments of files in the filesystem. Modern line Java applications (the template is MyApp.jar OS X applications (with the exception called “Java Tool”), JNI-based applica- of some monolithic Carbon binaries) tions, and also Cocoa-Java applications. I won’t go into how to build an appli- J2SE cation with Project Builder here, but any application project you build with Project Builder is automatically pack- The .app extension is a aged as a first class OS X application. (The JAR file inside is quite portable, magic, or “blessed,” however, unless you’re using some spe- “ cific native feature.) extension that says: treat OSXize this directory differently OSXize is a packaging tool I wrote in Java a while back. It can be used from

If MyApp.jar has the Main-Class are a collection of files living in a direc- attribute set, in less than a second you’ll tory with the .app extension, and not have a new application called much more. The .app extension is a

Home J2EE J2ME JavaApplication.app. Okay, so you prob- magic, or “blessed,” extension that ably want to specify a more descriptive says: treat this directory ”differently. name for your app. You can handle that (There are a few other magic exten- by passing the -n attribute: sions, such as .kext, that contain other types of bundles, and other special file java -jar osxize.jar -n "My Fabulous hierarchies like those in /Library/ Application" -addjar MyApp.jar StartupItems.) Inside an .app directory, you’ll find a OSXize then generates My Fabulous special directory hierarchy that’s used to FIGURE 2 The com.javaosx.Example Application Menu Application.app for you. (It also does contain the files and resources that some nice things that MRJAppBuilder make up the application. These include doesn’t do, like making sure your app the icon file, files with special informa- shows up as My Fabulous Application tion for the Finder describing the appli- when you look at what processes are cation, an executable binary file for Java running, e.g., through ps or top.) applications, one or more JAR files, the There are a number of other flags MRJApp.properties file, and a number of you can specify as well. No Main-Class other files as well. attribute in the manifest? No problem. The example command line shown Just specify the main class with -m. Want earlier would create a file hierarchy as to specify your own icon file? Make a follows: new icon (see Figure 5) using the ICNS Editor (also in /Developer/Applications) My Fabulous Application.app/ and specify the path to the file with the Contents/ FIGURE 3 The same application, after packaging -i option. Want to specify an application PkgInfo version to show up in the Get Info dia- Info.plist the command line to generate a fully log? Use the -version flag. The full set of MacOS/ packaged OS X application, and can also options is documented on the Web site My Fabulous Application be used as an Ant task to automate gen- as well as how to use the OSXize Ant Resources/ eration of your OS X application, if task. You can download it from MRJApp.properties you’re using Ant for build management. www.javaosx.com/apps/. NeoAppPackagerDefault.icns (And you should!) It also has the advan- Java/ tage of being fully cross-platform, so if The .app Application Bundle MyApp.jar you’re building your apps on a Linux box What exactly have we created when or on Windows, you don’t need to for- we’ve used these tools? Happily, all we’ve In the rest of this article, we’ll look at sake your OS X friends. Like MRJ- created is a file hierarchy that OS X rec- what each of these files is and what it AppBuilder, it can also convert any ognizes as a “bundle.” Ever since Mac does.

30 JANUARY 2003

Java COM

INTEGRATION

The PkgInfo File inside of the MacOS directory, you’ll find lower-right corner of a given window) This is an 8-byte file, which must a file called My Fabulous Application (or should intrude into the root pane of contain “APPL” (in ASCII) as its first 4 if you used MRJAppBuilder, your window or if the window should bytes, and contains as its last 4 bytes the JavaApplication). This is a native OS X be padded vertically so that it doesn’t “creator code” that the finder should executable, which is the file actually have to intrude. These are useful for associate with this application. Mac OS launched by the Finder. It then reads the tweaking the final appearance and per- has had the notion of creator codes from rest of the configuration information in formance of your Java application. It’s the beginning. These are used to associ- MRJApp.properties and executes the just a regular Java properties file, so ate files with the applications that creat- main() method on the appropriate class take a look at it. Much of it is fairly self- ed them (thus the name). This is why in the contained JAR file(s). explanatory. Mac files of the same type may be asso- The big thing to note here is that this ciated with different applications. You file must have the execute bit set in The ICNS File can register your own creator code on order for the application to work. (In OS X icons are packaged in .icns files, the Apple developer Web site for free. fact, if you use OSXize to generate your which can be created with the Icon Unless you have an officially recognized application on a Windows machine, Composer app found in /Developer J2SE creator code, though, you must use the you’ll need to set the execute bit manu- /Applications. You’ll need to create your reserved code “????” (also in ASCII.) This ally before you can run the app on OS X, icon files in another application, the is reserved to mean “Unknown since Windows filesystems don’t have most suitable being Adobe Photoshop. Application” and is guaranteed not to execute bits.) This execute bit issue is (You can directly import these files with interfere with any other application. one that often comes up when an app full transparency into Icon Composer.) Applications built with OSXize have mysteriously won’t run. If this happens Icon files should follow the Apple jNeo as their creator by default. to you, cd to the /Contents/MacOS Human Interface Guidelines, and are directory, and then chmod +x the file huge and rich compared to icons on The Info.plist File you find there. If everything else was other systems. They are 128x128 with The Info.plist file is one of many okay, your app should now be double- full transparency support, thanks to the .plist files used throughout the operat- clickable and run appropriately. power of the underlying Quartz graphics ing system to hold parameters. Most of engine. If there is interest, I can write them, including Info.plist, are XML files, The MRJApp.properties File about how to create your own icons in although there are some other older for- This file contains important run- my next column. mats still in use. Info.plist contains most time information used to configure,

Home J2EEof the information about the application J2ME among other things, whether to use the The JAR Files that the Finder keeps track of, like ver- system menu bar for Java menus, Of course, your application bundle sion information, and which .icns file to whether to use hardware acceleration, needs to have your actual Java code in use for the icon. at which threshold levels the garbage order to run it. You can have one or more collector should run, where standard JAR files packaged together into your .app The Application Stub out and standard error should be writ- bundle, although you can’t just throw JAR In the previous directory listing, ten, and whether the grow box (in the files in there and expect them to show up on the classpath. You have to also add them to the com.apple.mrj. application .class path property in the MRJApp.prop- erties file. (Both MRJAppBuilder and AUTHOR BIO OSXize do this for you if you specify addi- Ian McFarland is the tional JAR files.) president of Neo That’s really all there is to a typical Ventures Ltd., a packaged Java application. There are software consulting some additional attributes to add to the company in San Info.plist if you want to associate a given Francisco, and author file extension with your app, for of Mastering Tomcat instance, .foo. You’ll also need to include Development additional .icns files in the Contents/ (Wiley); he also Resources directory if you want to asso- maintains ciate icons with the files owned by your www.javaosx.com. Ian app, for instance, a foo.icns file contain- been a Java developer ing the icon the finder should use for all since release 1.0 .foo files. Here again, there are some alpha 2. tweaks you’ll need to make to Info.plist to tell the finder which icon to associate with which file type. Having great looking double-click- able applications is just something you can use to make your friends on other platforms a little jealous while waiting for Apple to get the kinks out of their J2SE 1.4 port.

FIGURE 4 MRJAppBuilder FIGURE 5 The new icon [email protected]

32 JANUARY 2003

Java COM

Java J2SE Linux

written by Calvin Austin

t’s been over two years since I wrote

Home J2EE J2ME my last article about using the Java

runtime on Linux (“Java Using Linux Technology on the Linux Platform” [JDJ, Vol. 5, issue to develop 12]). The Java platform and Linux distributions have not and deploy stood still during that time, so I’m taking this opportunity to applications answer some of the frequent questions that have surfaced written since then and provide some insight into some of the more in Java complex issues. If you’re a seasoned Java on Linux user or are

planning to move to the Linux

platform, I trust you’ll find the answer

you’re looking for!

34 JANUARY 2003 I Java COM Linux Threads One well-known difference between deploying on Linux compared to other Unix operating systems is the implementa- tion of the system threads library. Linux threads are imple- mented as a cloned process and, consequently, the underlying thread implementation can affect the behavior of the Java run- time. The most visible difference when deploying a Java applica- tion on Linux is that each Java thread shows up as its own process. This means that the /proc filesystem will have an entry for each thread and the output of the ps command will list 10 or so processes for a single . This is normal, but it’s also confusing and inefficient. Later releases of the ps command (in package procps 2.0.7 and later) will hide the Java threads and display only the master process in the ps output. The full list of threads can be displayed using -m option to ps. Only in newer releases of the Linux kernel will the number of entries in the /proc filesystem be reduced. The overhead for implementing threads using this design means that you may need to allow a little more time for Java applications to start up on Linux and reduce the number of concurrent threads if the application is thread heavy. Why Doesn’t Someone Fix This? The scalability and signal-handling issues of the LinuxThreads implementation are well known, and over the past two years there have been several attempts to improve the situation. The two most well-known thread library projects are Next Generation Posix Threads (NGPT) and a newer library called Native Posix Thread Library (NPTL). The earlier NGPT project is based on an M:N thread map- ping that has been popular with other Unix operating systems. The M:N solution maps multiple user threads, Java threads in our case, and often runs those threads on a smaller number of kernel threads. Kernel threads are traditionally seen as more expensive for an operating system than user threads. The newer NPTL approach is to keep the 1:1 thread map- ping – one user or Java thread to one kernel thread – but opti- mize the kernel for thread-related operations, including signal handling, synchronization, and thread creation speed. Both thread libraries also require modifications to the Linux kernel. NPTL requires the 2.5 kernel that’s the develop- ment version of the official 2.6 Linux kernel. NGPT can be bolt- ed on to existing 2.4 kernel distributions by rebuilding the ker- nel with an NGPT patch. There’s also a chance that some of the necessary NPTL ker- nel changes may also be back ported to 2.4 kernels as a patch. We’ve been evaluating both these libraries and have seen some encouraging results from the newer NPTL library due to its compatibility with the existing LinuxThreads pthread library. The current level of compatibility means that applica- tions like the Java runtime will not need to be recompiled or ported and will work “out of the box.” Do You Really Need All Those Threads? The new thread libraries may still take another year before they’re adopted by the major Linux distributions. In the mean- time, you can make a real difference now to server applications that use many sockets. Before J2SE 1.4, most multithreaded Java server applications used blocking IO to wait for requests from the client. Blocking IO in this scenario resulted in a single thread for every server socket connection. You can reduce the number of threads by using either a connection pool of listening threads or the new New IO Selector and ServerSocketChannel. The Selector class avail- able in J2SE 1.4 manages a list of registered channels and returns those with an event pending. Each ServerSocket-

JANUARY 2003 35

Java COM 2. Change directory (cd) to the Mozilla installation directory. The default installation directory is /usr/local/mozilla. 3. Find the plugins directory. 4. Remove the libjavaplugin_oji.so file from the plug-in direc- tory, if it exists. 5. Link the libjavaplugin_oji.so file from the JRE or JDK you downloaded to the plug-in directory. The libjava- plugin_oji.so file is either in the directory jre/plugin/ i386/ns610 or plugin/i386/ns610, depending on whether you installed the JDK or JRE, respectively

The following small script can be used if you have installed JDK 1.4.1_01 and are using the default Mozilla install directo- ry.

(cd /usr/local/mozilla/plugins; rm libjavaplugin_oji.so; J2SE ln -s FIGURE 1 Scalability benefits /usr/java/j2sdk1.4.1_01/jre/plugin/i386/ns610/libjavaplug- in_oji.so Channel can be placed in a nonblocking mode; in this mode libjavaplugin_oji.so) the Selector can be used to multiplex sockets in a way that’s similar to the Unix poll command. The scalability benefits of To verify that you have successfully upgraded your plug-in, using one thread to manage socket connections can be seen in look at the Java console output. This can be configured using Figure 1. the ControlPanel command from the Java runtime. The chat server used in this test was first implemented using blocking IO (Old IO), and then rewritten to use the mul- Linux Debugging Tools tiplexing sockets (New IO). The Linux thread overhead Whenever possible try to use a Java IDE to debug Java pro- becomes apparent after as little as 100 connections. grams. The Linux debug and tracing tools do work but are not as advanced as other operating systems. The most useful tools The Java Runtime and GCC 3.2 are ltrace, used to trace library calls; strace to trace system Over the past year there have been significant changes to calls, especially useful for catching files that can’t be opened or

Home J2EEthe GNU C++ Application Binary Interface J2ME (ABI). This means permission problems; and finally the GNU debug tool GDB. that programs built against an earlier C++ library are not com- The ltrace and strace tools are available on most distributions, patible with newer C++ libraries and vice versa. but are not always installed by default. This change in compatibility is apparent if you try to use a Java plug-in with a build of the Mozilla Web browser that Using GDB on a Running Process was compiled with GCC 3.2. Fortunately, most As Linux threads are implemented as Linux processes, this

Whenever possible try to use a Java IDE to debug Java programs. The Linux debug and tracing tools do work but are not as advanced as “ other operating systems Linux distributions still supply a browser based on the earlier makes debugging Java programs running on Linux a little C++ interface. We’re working with the Mozilla team to remove more complicated. If the JVM is already running, you can the C++ plug-in dependency; this would enable the plug-in to attach the system GDB tool to the JVM as follows: work with a browser built with either compiler. If the Java run- time were built with GCC 3.2 today, then the plug-in wouldn’t gdb /usr/java/j2sdk1.4.1_01/bin/java 11712 ” work on an earlier browser. We are planning to build the next major J2SE release on The 11712 number in the example is the parent Java Linux with GCC 3.2, and it should work on both old and new process thread ID. Most of the Java processes in a ps listing browsers. Our friends at blackdown.org are also planning to will have a common parent process; this is the parent thread release a special GCC 3.2 version for testing. that you’ll use as the process number to pass to the GDB. With the GDB attached to the JVM, you can run any GDB Java Plug-in Installation Tips for Mozilla commands. If you’ve used GDB before, these commands will If you’ve just downloaded the latest Mozilla browser (1.2) look familiar. The info threads command lists the Linux threads, and then loaded a page with a , you’ll be prompted the t command selects a thread to be the current thread, and the to download the Java plug-in. However, the latest plug-in where command lists the stack frames in that thread. available on the download server is only JRE 1.3.1. To use a later plug-in, such as 1.4.1_01, you need to do the following: Starting a Java Virtual Machine Using GDB 1. Download JRE 1.4.1_01 or J2SDK 1.4.1_01 from Attaching a GDB trace to an existing program is normally the http://java.sun.com. simplest way to debug a deadlocked JVM; however, you might

36 JANUARY 2003

Java COM

want to start the JVM from within the GDB debug tool, especial- >set stop-on-solib-events 1 ly if you’re trying to debug some native code from a JNI library. To enable the JVM to run from inside GDB on Linux with Use the cont GDB command to continue execution until J2SE 1.4.0 and later, use the following steps. you can see that your library has been loaded; this should First, set the LD_LIBRARY_PATH environment variable to occur after a dozen attempts. You can list the shared libraries point to the Java installation directories; the example shown is by running the sharedlibrary GDB command. for the J2SE 1.4.1_01 release. You can add your own Finally, to break on a function in your JNI library, enter the LD_LIBRARY_PATH to point to a JNI library, for example, but GDB command break with the function name you want to add those directories to the end of the LD_LIBRARY_PATH stop in. variable. Summary export Using Linux to develop and deploy applications written in LD_LIBRARY_PATH=/usr/java/j2sdk1.4.1_01/jre/lib/i386/client the Java programming language has become increasingly pop- :/usr/java/j2sdk1.4.1_01/jre/lib/i386:/usr/java/j2sdk1.4.1_ ular as the Linux platform has reached new heights. With the 01/jre/../lib/i386 introduction of the new threads libraries and the transition to the new C++ ABI complete, the next year promises to be an J2SE Next start GDB. From J2SE 1.4.0 onward the Java shell script exciting one for Java and Linux users. wrapper used to start the JVM has been replaced by a small exe- cutable program. The GDB session can simply be started as follows: Resources • Native POSIX Thread Library: http://people.redhat. gdb /usr/java/j2sdk1.4.1_01/bin/java com/drepper/nptl-design.pdf • Next Generation POSIX Threading: www-124.ibm. All that remains is to instruct GDB to ignore some of the com/pthreads common signals used by the Hotspot Virtual Machine, and • Java technologies on Linux: http://java.sun.com/linux then provide the arguments to the Java program, in this • team: http://blackdown.org instance the Java2Demo.jar file. AUTHOR BIO gdb /usr/java/j2sdk1.4.1_01/bin/java Calvin Austin is the J2SE 1.5 specification lead and lead engineer for the Java 2 > handle SIGUSR1 nostop noprint pass Standard Edition Linux project at Sun Microsystems, Inc., and works with the > handle SIGUSR2 nostop noprint pass Blackdown.org Java porting group. He is cofounder of the Java Developer Connection, > run -jar Java2Demo.jar and also the coauthor of Advanced Programming for the Java 2 Platform

Home J2EE J2ME (Addison-Wesley, 2000). If you want to stop in your own JNI library, enter the follow- [email protected] ing GDB command to trap each time a dynamic library is loaded.

38 JANUARY 2003

Java COM

J2ME EDITORIALOR J2ME INDEX

A United Front Along with many others, I’ve believed for quite some time

J2ME now that there must be a JASON R.BRIGGS J2ME EDITOR change in the custodianship of Java for the platform to survive these uncertain times. My per- sonal belief is that any future J A UnitedFront custodian of the Java platform 40 must be an organization of com- long with many others, I’ve reason why Sun is the wrong guardian for munity members (both corporate believed for quite some time now Java. However, don’t get me wrong; this and individual) working toward Athat there must be a change in the doesn’t come out of some misguided dis- definable open-source goals. custodianship of Java for the platform to like for Sun as a whole, rather it comes by Jason R. Briggs survive these uncertain times. My personal from a desire to see the platform – in all its belief is that any future custodian of the forms, not just J2ME – survive an increas- JCP Expert Group Java platform must be an organization of ingly embattled position. A united front by Experiences – JSR-118 community members (both corporate and definition has to be stronger, and you’re The individual) working toward definable more likely to see a united front if compa- defines the way Java standards open-source goals. Take the best from the nies feel they can have more personal own- are created. Through this JCP, the Apache model, the Linux/Kernel ership of the platform. process, members of the com- semi-dictatorship model, etc., and build Of course, the other advantage of hav- munity are invited to work something new to lead us forward. ing a more open custodianship of Java is together in expert groups (EG) 42 I have numerous reasons for thinking that when they release a toolkit for only to create new Java specifica- this – too many to go into detail here – and one platform, people like me can say tions. This article describes my I recently added a new reason to the list (a things like…“Doesn’t this strike anyone experiences at leading the

Homecomment J2EE that has been said J2SE before by else as vaguely sacrilegious…blah blah expert group for a recent JSR – wiser minds than myself): Sun might talk blah.” And maybe, just maybe, they might JSR-118 – Mobile Information the talk, but they definitely don’t walk the actually be heard. Device Profile 2.0. walk. • • • by Jim Van Peursem Case in point: the early access release of “Crud.” If you have an e-mail address, the J2ME Wireless Toolkit 2.0 (Beta 1), now you get a lot of it. If you’re one of the edi- The New PDA Profile available for the following platforms: tors of a magazine, there must be a J2ME developers Murphy’s Law somewhere that says you’re have long desired the opportu- Windows in for an exponential increase in the nity to build sophisticated amount of “crud” that filters through your applications for the personal Does this strike anyone else as vaguely inbox. Occasionally, among all the “you digital assistant (PDA) market, sacrilegious? Why is it not completely Java might already be a winner, click now!,” “try applications common to and available to any supported platform? our natural remedy for guys who have resource-rich desktop comput- 46 Why is there not a download available for trouble rising to the occasion,” and “me ers. One thing stood in their Solaris, Linux, Mac, and any other Java and my 18-year old sister took photos of way: most PDAs lacked 1.4.x supporting platform I care to think of? ourselves at the beach, check them out resources to efficiently execute I’m sure someone will come up with the here” e-mails (yes, I actually did get that those applications. argument that there are platform-specific last one; where do these people get my by Jim Keogh facilities built into the Toolkit that make address?) that magically filter themselves porting it to other platforms more difficult; into my trash can, something comes along hence a Solaris/Linux port won’t be imme- that might actually be worth reading. Of diately available, and certainly not avail- course, among all the other rubbishy titles, of enormous amounts of money rolling in able for the first beta. That’s not the point. it can sometimes be hard for a poor, by a certain date and time with a degree of Ninety-nine percent of the Toolkit should defenseless e-mail to attract my attention. skepticism. However, the amount isn’t be built in Java. Call me a die-hard purist if But “Java [mobile] games to be worth over really the important issue in this case. you want, but anything that simply has to US$3 billion” will definitely do it. What is important is that there is a realiza- be coded in C/C++ (and therefore rewrit- As many will already be aware, I don’t tion outside of the immediate J2ME devel- ten for each platform) should be an put much credence in the opinions of most oper community that Java games for optional feature that isn’t required in order analysts – a certain choice few, with the mobile phones will be a big thing in the for the software to run. prerequisite of actually having a sense of years to come. US$3 billion or not, if you This unwillingness to toe the philo- humor being the exception (you know who need any validation that J2ME is the space sophical line, in my view, is yet another you are, John J.). Hence, I view any claims to be in, this is it.

[email protected] AUTHOR BIO As well as being the J2ME editor for Java Developer’s Journal, Jason R. Briggs is a Java programmer and development manager for a wireless technology company, based in Auckland, New Zealand.

40 JANUARY 2003

Java COM Name: Hartmut Neven Company: Eyematic® Most recent titles: Shout Messenger™ & MyGenie™ Dream: To make wireless communication as visual as it is verbal.

As CTO of Eyematic, Hartmut Neven is responsible for creating the most viable and cutting-edge wireless applications imaginable. Two prime examples are the new BREW™ applications Shout Messenger – the first U.S. multimedia messaging app to wirelessly deliver animated content – and MyGenie Daily Horoscope. “BREW is extremely convenient for the developer because it’s a one-stop solution,” Neven said. “After an app is tested, it is immediately made available to all other BREW carriers, and consumers can literally begin downloading within hours.” And Neven isn’t alone. Commercial services are launched and BREW applications such as games, email, news, weather, stock trades, position location and ringers are now heading to market – a market of millions upon millions. If you aren’t developing for BREW, you aren’t developing to your potential. To get started, go to www.qualcomm.com/brew. ©2002 QUALCOMM Incorporated. All rights reserved. QUALCOMM is a registered trademark of QUALCOMM Incorporated. BREW and Customize. Personalize. Realize. are trademarks of QUALCOMM Incorporated. Eyematic is a registered trademark and MyGenie and Shout Messenger are trademarks of Eyematic Interfaces Inc. SPECIFICATIONS JCP Expert Group Experiences– JSR-118

J2ME An inside look at the process

The Java Community Process (http://jcp.org) defines the way Java standards are created.Through this process, members of the WRITTEN BY community are invited to work together in expert groups (EG) to JIMVAN PEURSEM create new Java specifications.

If you wanted to create a new specifi- was taking off in the marketplace and the the size of the meeting room (concert hall) cation, you would file a Java number of individuals and companies we had to find to hold expert group meet- Specification Request (JSR) with the JCP involved was becoming significant. ings with over 100 people attending. Then Program Management Office (PMO). To For our CAFE, we received approxi- imagine how unproductive such a meeting date, there have been over 200 JSRs filed, mately 60 responses, so a choice had to could be! To make the face-to-face meet- and they’re at various phases of devel- be made whether to keep the group ings manageable, we limited attendance to opment. Some have been finalized and small and focused and include only a approximately 30–35 (depending on how are being deployed in products, while fraction of these applicants in the expert large the room was). Even at this size, it was others are just getting started. group, or to be inclusive and let everyone a challenge finding rooms that could In this article, I describe my experi- become involved. We ultimately decided accommodate us in a productive round- ences at leading the expert group in a upon the latter; the advantage of this table style (nonclassroom) setting. For each recent JSR – JSR-118: Mobile Inform- choice is that it assisted the further meeting, the participants were given the ation Device Profile 2.0. (To see a list of adoption of MIDP in the marketplace by first chance at claiming a seat. After the par-

Home J2EEthe JSRs and learn J2SE more about what letting all interested parties have a voice ticipants responded, the reviewers were their goals and statuses are, please visit in the direction it should go in. The risk, given a chance to claim the remaining http://jcp.org/jsr/all/index.en.jsp.) however, was the schedule. As you can seats. For each subsequent meeting, pref- As you would expect, the Mobile imagine, getting 60 companies to reach a erence (after participants) was given to Information Device Profile (MIDP) 2.0 consensus on a decision is a lot more dif- reviewers who had not previously partici- expert group created a new revision of the ficult and can take significantly longer pated in a face-to-face meeting. In this way, MIDP 1.0 (JSR-037) standard, which was than with 20 companies. We decided that all reviewers were given a chance to attend finalized in September 2000 and is ship- the potential advantages outweighed the at least one meeting. ping in many devices around the world. risks, and so jumped in with both feet. As The vast majority of our expert group Mark VandenBrink from Motorola was a result, JSR-118 became the largest communications took place via e-mail. the specification lead for JSR-037, which expert group attempted (and finished) in To make this manageable, several topic- means Motorola is the specification lead the Java Community Process, with specific e-mail lists were set up. In the for the revised MIDP standards, including approximately 60 companies and over MIDP 2.0 JSR, several technical areas version 2.0. However, this time around, 120 individuals participating from coun- were listed for development; one list was Motorola tapped me on the shoulder to tries all around the world. This became a created for each of the 13 topics being lead, which turned out to be an interest- tremendous challenge in terms of com- developed in the expert group. Then all ing and challenging experience. munication (during the peak, I typically members of the expert group were invit- got 250+ e-mails per day), program man- ed to subscribe to the lists they were Creating the Expert Group agement, diplomacy, reaching consen- interested in, and more than one person The expert group experience for JSR- sus, scheduling, etc. from each company could participate. 118 was interesting both in terms of the With such a large expert group and In this way, the relevant experts on each technology we developed and the fact that the large number of people involved, topic from within each company could it pushed the envelope of the JCP process. some structure had to be provided to participate in each of the subareas. This The JCP Executive Committee (EC) make the group manageable. The Java was advantageous for three reasons: approved the JSR in April 2001 and the Community Process had defined the 1. It was easier to keep the discussion work began shortly thereafter. The first concepts of participants and reviewers threads together so they could be fol- step is to form the expert group through a so the specification lead could distin- lowed more clearly. process called the Call for Experts (CAFE). guish the levels of involvement of an 2. Not all members had to deal with all During this phase, experts in the industry individual or company. For JSR-118 the the messages (they subscribed only to and members of the community are invit- members of the expert group were each the areas they were interested in). ed to join the expert group. For JSR-118, assigned one of these roles; however, in 3. The experts from each company asso- even this was a challenge. For a typical practice this distinction was rarely used. ciated with each topic could partici- CAFE, the specification lead receives It was only utilized to decide participa- pate, which made the discussions 15–25 applications to join the expert tion in our face-to-face meetings. more efficient than if all communica- group, and accepts somewhere around Coordinating our face-to-face meetings tions had to be funneled through one 15–20. However, it was clear that MIDP was an interesting challenge. First, imagine representative per company.

42 JANUARY 2003

Java COM Ensure high-performing ® JavaTM code, wherever it runs JProbe

Now part of

Award-winning JProbe provides deep J2EE diagnosis tools that give you a complete picture of your Java application, right down to the offending line of code. JProbe includes everything you need for fast, accurate analysis of your application servlet, JSP and EJB code.

Track down inefficient algorithms, memory leaks, threading problems and untested code. JProbe works virtually everywhere with unrivaled application server, JDK and operating system support.

JProbe Suite JProbe Profiler JProbe Memory Debugger JProbe Threadalyzer

For more info and a free eval, visit: www.sitraka.com/jprobe/jdj

© 2003 Quest Software, Inc. Quest, Sitraka, PerformaSure and JProbe are trademarks or registered trademarks of Quest Software, Inc. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. All other products are trademarks or registered trademarks of their respective companies. SPECIFICATIONS

Defining the Technology toward a merger. Since ultimately it to the expert group. This review lasted Once the expert group was created, made sense to specify only one API for a 30 days, and we received around a the development process began. As given functionality, I set a deadline for dozen comments, which helped us filed, the JSR described the scope for the choosing one basis proposal in each improve the specification. During this expert group to be: area. This basis would then be the API time, the expert group continued to • Backward compatibility with MIDP that the expert group would focus on debate the features and improve the 1.0 improving to meet the requirements we specification as well. We created a new

J2ME • Continued focus on small, high-vol- defined in the first meeting. In some draft of the specification, incorporating ume wireless phones cases, this meant combining the best improvements both from internal • Maintain tight footprint objectives to elements from multiple proposals, but debates and from the Community limit growth in the core APIs in most areas one of the proposals was Review feedback. • Information learned from MIDP 1.0 chosen over others. The next step for getting an even deployments to fine-tune MIDP 1.0 Once the basis proposal was chosen broader review was to submit the specifi- APIs for each area, the expert group collabo- cation for Public Review. This is where • Focus on core functions needed by all rated on refining the designs. This was the specification is published openly so devices and applications the part of the process where the most that anyone with network access can • Focus on enabling m-commerce, debate and disagreements occurred. download it and send in their comments service-based applications Most of the arguments centered around and feedback. This review also lasted 30 the naturally recurring tension between days, during which time we received The JSR also listed the functional new features and the added cost that nearly 100 comments. Reviewing and areas to investigate, including: came with the associated increase in responding to all these comments was a • Domain security model, including implementation size. On the one hand, significant effort that I had not anticipat- signing of applications and verifica- since the target devices for this technol- ed. However, many of the public review tion of certificates ogy are extremely resource limited, we comments resulted in new features being • HTTPS and secure networking had to keep a close eye on the imple- added, changes in design, and even sim- • Network connectivity via sockets and mentation budgets. This meant that ple (and useful) editorial clean up. Even datagrams some members of the expert group were though this created a lot of work, this • Formal inclusion of OTA Provisioning constantly trying to reduce the feature feedback was beneficial and I would (i.e., Recommended Practice 1 for set to lower the cost of implementation. encourage you to get involved in provid- MIDP 1.0) On the other hand, there was obvious ing feedback when JSRs are in Public

Home J2EE• Push architecture J2SE – external events value to adding more functionality, as it Review. and messages routed to appropriate enabled a richer set of applications. This The expert group continued to tension is what caused most of the inter- review the specification and work on • User interface – extensions to low- esting debates in the expert group. clarifications when areas were found to level LCDUI to allow greater game One of the unfortunate victims of be vague in meaning. At the same time, functionality and layout control for these debates was the XML functionali- the Reference Implementation (RI) and AUTHOR BIO larger screen sizes ty. As we were developing this portion of Technology Compatibility Kit (TCK) James E.Van • A small, efficient XML parser to the specification, it became clear that teams started working on their imple- Peursem is chief enable platform-independent data the implementation size was a very large mentations. As a part of the JCP process, architect for the exchange percentage of our overall budget. Even an expert group must complete the J2ME platform at • Base sound API after we trimmed its functionality down specification, as well as an RI and TCK. Motorola. He has as far as we could without significantly At the time of this writing, the Proposed been actively Given broad goals and functional crippling the design, it was still too large. Final Draft of the specification has been involved in the descriptions like these, the expert As a result, we decided that a new JSR submitted, and the RI and TCK are near- application of Java group’s first step was to examine each (JSR-172) should be filed for developing ing completion. With any luck, by the technologies in area and agree on the requirements. Our an XML specification for the MIDP mar- time you read this, the specification, RI, mobile wireless first face-to-face meeting in June 2001 ket. In this way, those devices that can and TCK will all be complete and avail- devices for as long was therefore dedicated to refining the afford the extra implementation budget able for download and implementation as Java has existed. scope of the JSR and coming to an agree- can incorporate this functionality, while in your products. His contributions to ment on these requirements. those very cost-sensitive devices can external forums After we reached consensus, it gave choose to leave it out. It also allows the Summary include being the us a basis for agreement upon which we new expert group to have more freedom Participating in the JCP is a challeng- specification lead for could start the design of the APIs. A call in terms of implementation budgets and ing and rewarding experience. I would JSR-118 (MIDP 2.0) for design proposals was issued, and features. The disadvantage is that XML recommend it for anyone interested in and interpretation several proposals from different compa- developers can’t rely on parsers being the technologies being specified. Even if guru for JSR-037 nies and individuals were distributed available on every MIDP platform. you don’t have the bandwidth to (MIDP) as well as and discussed via e-mail. In some areas, become directly involved, you should being involved in the only one proposal was received, while in Opening the Specification for Review become involved in the Public Reviews. development of the others there were competing proposals. Once we brought the specification The comments you send in are taken JavaPhone APIs and The expert group members then to what we considered a relatively sta- seriously and can have a direct impact the MExE standard focused on comparing the features and ble point, it was time to get a larger on the designs being specified. This is within ETSI/3GPP. Jim merits of each proposal. After the audience to review it. In the JCP, the first your opportunity to shape and influence received his PhD in debates and discussions evolved for a step in this process is the Community the APIs that you may want to use in the computer while, it became clear that the compet- Review. This is where the specification future. Don’t pass it up! engineering from ing proposals in some areas were start- is published to JCP members so they Iowa State University. ing to evolve independently, not driving can send their comments and feedback [email protected]

44 JANUARY 2003

Java COM

J2ME

2ME developers have long desired the oppor-

tunity to build sophisticated applications for J the personal digital assistant (PDA) market, applications common to resource-rich desktop computers. One PDAP and MIDlets thing stood in their way: most PDAs lacked resources to effi- A PDAP application is called a PDAlet, which is a variation of the MIDlet application model. Actually, a PDAlet is a MIDlet ciently execute those applications. that uses the PDAlet API and follows the same principles used in a MIDlet and MIDlet suite.

Home J2EEHowever, that’s J2SE about to change with the introduction of There isn’t a PDAlet class because a PDAlet is a conceptual ARM processor–based PDAs and the PDA Profile that’s soon to entity that refers to the capabilities and requirements of a be incorporated in SDKs and VMs. PDAlet. A PDAlet is created by defining a class that extends the Improvements in processor design have transformed new MIDlet class. Think of it as an extension of a MIDlet; those PDAs into a powerhouse platform capable of running sophis- rules that apply to a MIDlet also apply to a PDAlet. ticated J2ME applications and clients of enterprise Java sys- Listing 1 shows an empty MIDlet and Listing 2 converts tems. New PDAs bring higher performance previously known this empty MIDlet into an empty PDAlet by calling the only on desktop computers. getDefaultToolkit() method within the startApp() method. The With performance and power barriers removed from the default toolkit is a subset of AWT and is used to create a GUI new PDA, a committee of the Java Community Process that for the PDAlet. The getDefaultToolkit() method makes the included PalmSource, the software division of Palm, defined a PDAP API available to the PDAlet. new profile called the PDA Profile (PDAP) that introduces Although many developers will use AWT components to classes for building highly responsive J2ME applications. build a GUI for their PDAP application, a GUI isn’t required for PDAP is an extension of the Connected, Limited Device a PDAlet. You can create a PDAlet without having a GUI by Configuration (CLDC) 1.1 and the Mobile Information Devices calling the Display.setCurrent(null) method within the Profile (MIDP) 1.0. New PDAs powered by an enhanced processor startApp() method. The PDAlet is then placed in the active- are capable of running both MIDP applications and PDAP appli- without-UI state, which means the PDAlet is still active but the cations using a PDAP-enabled VM. There are two key features implementation determines what, if anything, is displayed on introduced with the PDAP: the capability to develop sophisticat- the screen. ed graphical user interfaces for a PDAP application using the Abstract Windowing Toolkit (AWT – a subset of the J2SE AWT), The PDAlet Suite and the capability to access a PDA’s native personal information A PDAlet suite’s functionality is similar to a MIDlet suite’s in data. A PDAP application can access data managed by the PDA that both are packages of PDAlets and MIDlets, respectively. device’s address book, , and to-do list applications. Suites make it easy for the developer to group related PDAlets and MIDlets for deployment and installation. The New PDA A PDAlet suite is a bundle of PDAlets and MIDlets that’s I use the term “new PDA” to describe the latest incarnation implemented simultaneously on a PDA. All PDAlets (and of a PDA, but that doesn’t help you know if a PDA can run MIDlets if any) within a PDAlets suite are considered a group PDAP applications. A better definition of “new PDA” is to and must be installed and uninstalled as a group. Each PDAlet describe the footprint required to run a PDAP application. and MIDlet within the PDAlet suite must be listed in the PDAlet A PDA must have a minimum of 1,080KB of memory: suite’s manifest, which is also contained in the PDAlet suite. 500KB for CLDC and MIDP, 540KB for the PDAP user interface Members of a PDAlet suite share the same resources from libraries, 20KB reserved for the PIM API, 10KB for the Generic the host environment and share the same Java class instances, Connection Framework, and another 10KB for the PDAP secu- and run within the same JVM. This means if three PDAlets rity model. Table 1 describes other hardware configurations from the same PDAlet suite run the same class, only one that are required to run a PDAP application. instance of the class is created. A key benefit of the relation-

46 JANUARY 2003

Java COM Some people say the convergence of application development and integration is difficult.

Three days in Orlando doesn’t sound all that difficult to us.

The 8th Annual Technology Conference Gaylord Palms Resort & Convention Center, Orlando, FL March 2 - 5, 2003

[ One place. One time. One idea. ]

Join us at BEA eWorld 2003-Converge, our 8th Annual During these three groundbreaking days, you will Technology Conference. Where trends in enterprise learn how building, integrating and extending software computing are reshaping everything in the software applications are converging into a single, powerful industry. And where the brightest minds–with the most framework that promises to drive dramatic increases in provocative ideas, most innovative approaches to solving developer productivity. Which is precisely why you can’t difficult problems, and richest store of practical afford to miss a moment. information–will shake the foundations of the industry.

> > > REGISTER TODAY! It’s easy at www.bea-eworld.com < < <

Brought to you by: Diamond Sponsors: Community Sponsor:

© 2002 BEA Systems, Inc. All rights reserved. BEA is a trademark of BEA Systems, Inc. All other company and product names are trademarks of their respective owners. CHARACTERISTIC REQUIRED CHARACTERISTIC MIDlet-Vendor Display Ranges from a resolution of 128x128 pixels to MicroEdition-Profile 240x320 pixels PDAlet-n Minimum display depth of 1 bit MIDlet-n Color support from 1-bit black and white to 64K MicroEdition-Configuration colors Input A stylus or other pointing device and a method Listing 3 is a manifest file that contains the minimum number of character input of attributes. All these attributes are required for a PDAlet mani-

J2ME Power Battery fest. Create a manifest file as a text file with the .txt file extension Network Two-way wireless networking with a limited using an editor. The manifest file’s file extension is changed to .mf bandwidth. The network connection can be when the PDAlet suite is prepared for deployment. intermittent. Entries in the manifest are name:value pairs and can there- Processor Performance range from 15MHz up to 206MHz. fore appear in any order within the manifest file. Each pair ROM and RAM Range from 2MB to 32MB. Minimum of must be terminated with a carriage return. Whitespace 1,000KB total memory (ROM and RAM) that is between the colon and the attribute value is ignored when the available for Java runtime and libraries application manager reads the manifest file. Heap Space Range from 64K to 64MB Let’s step through the manifest file shown in Listing 3. The User Interface Text based, windowing, dialogs, buttons, text MIDlet-Name attribute specifies the name of the PDAlet suite. Capabilities input fields, and images The MIDlet-Version and MIDlet-Vendor attributes identify the version number of the PDAlet suite and the company or per- TABLE 1 Hardware requirements for running a PDA profile application son who provided it. The MIDlet-n attribute and the PDAlet-n attribute contain ship between PDAlet suite members is that they share the information about each MIDlet and each PDAlet that is in the same data, including persistent storage such as that used to JAR file. The number of the MIDlet and PDAlet replaces the store user preferences. letter n. The MIDlet-n attribute and the PDAlet-n attribute can Sharing data among PDAlets exposes each PDAlet to data contain three values that describe the MIDlet/PDAlet. A errors caused by concurrent read/write access to data. comma separates each value. However, this risk is reduced because synchronization primi- The first value is the name of the MIDlet/PDAlet. Next is an tives on the PDAlet suite level restrict access to both volatile optional value that specifies the icon that will be used with the and persistent data. MIDlet/PDAlet. The icon must be in the Portable Network Data cannot be shared between PDAlets that are from Graphics (PNG) image format. The last value for the

Home J2EEanother PDAlet suite J2SE because the PDAlet suite name is used to MIDlet/PDAlet attribute is the MIDlet class name. The appli- identify data associated with the PDAlet suite. A PDAlet from a cation manager uses the class name to load the PDAlet. different PDAlet suite is considered an unreliable source. The next MIDlet/PDAlet attribute is the MicroEdition- A PDAlet suite is installed, executed, and removed by the Profile, whose value is the J2ME profile that’s required to run application manager running on the device (the manufactur- the PDAlet. In this example the PDAP-1.0 profile is required. er of the PDA provides the application manager). And the last MIDlet/PDAlet attribute is the MicroEdition- Once a PDAlet suite is installed, the application manager Configuration, which identifies the J2ME configuration that’s gives each member of the PDAlet suite access to JVM and necessary to run the MIDlet/PDAlet. CLDC classes. Likewise a PDAlet can access classes defined in Attributes can be listed in any order in the PDAlet manifest the MIDP and PDAP to interact with the user interface, net- and may contain spaces. The PDAlet manifest cannot have the work, and persistent storage. MIDlet-Jar-URL and MIDlet-Jar-Size attributes. Both these The application manager also makes the Java Archive File attributes are permitted in the MIDlet manifest. (JAR) file and the Java application descriptor file (JAD) available to members of the PDAlet suite. Note that the JAD file is optional. PDAlet/MIDlet Options All the files that are necessary to implement a PDAlet suite A PDAlet suite can contain PDAlets and MIDlets, and both must be contained within a production package called a Java are listed in the manifest as illustrated in the previous exam- Archive File (JAR). These files include PDAlet classes, graphic ple. Both a PDAlet and a MIDlet listed in the manifest can pro- images if required by a PDAlet, and the manifest file. vide the same functionality except that the PDAlet uses the PDAP API and the MIDlet uses the MIDP API. The Manifest If the implementation doesn’t support the PDAP API in the A PDAlet suite is created almost the same way you create a VM, both PDAlets and MIDlets in the PDAlet suite won’t run. MIDlet suite except PDAlets are identified within the PDAlet However, you can specify that a MIDlet should run in place of suite’s manifest using the PDAlet= attribute, where a PDAlet by assigning the same index number to a PDAlet and name represents the name of the PDAlet class. a MIDlet. The PDAlet runs if the implementation supports the The manifest file contains a list of attributes and related PDAP API, otherwise the MIDlet runs. definitions that are used by the application manager to install Listing 4 illustrates this technique. Notice there are two the files contained in the JAR onto the small computing poker programs in this manifest. The first is MIDlet-2 and is device. There are 10 attributes that are defined in the manifest called poker. The other is PDAlet-2 and is called PDAPoker. file; all but seven of these attributes are optional. Since MIDlet-2 and PDAlet-2 have the same index number, Table 2 lists attributes contained in a manifest file. Of the PDAPoker is the preferred poker program if the device sup- these, the following attributes are required for every manifest ports the PDAP API. The MIDlet-2 program is used if the file. Failure to include them causes the application manager to device does not support the PDAP API. halt the installation of the JAR file. It’s critical that the numbering sequence of MIDlets and PDAlets remain sequential without duplication except to MIDlet-Name resolve preferences, as in the case of PDAlet-2. Although there MIDlet-Version are six programs in the manifest in Listing 4, only five pro-

48 JANUARY 2003

JJavaava COMCOM

grams are visible to the implementation. Only one program is MANIFEST FILE ATTRIBUTE DESCRIPTION visible per index number. MIDlet-Name MIDlet suite name Both the PDAP 1.0 and CLDC 1.1 APIs must be present on MIDlet-Version MIDlet version number the device to install and execute the PDAlet suite, because MIDlet-Vendor Name of the vendor who supplied these values are specified in the MicroEdition-Profile and the MIDlet MicroEdition-Configuration attributes in the manifest. The MIDlet-n Attribute per MIDlet. Values are MIDP 1.0 API is implied whenever you specify the PDAP 1.0 MIDlet name, optional icon, and profile in the MicroEdition-Profile attribute. However, you can MIDlet class name.

J2ME explicitly specify the MIDP 1.0 API and the PDAP 1.0 profile MicroEdition-Profile Identifies the J2ME profile that is together by including the MIDP 1.0 in the MicroEdition- necessary to run the MIDlet Profile attribute as shown here: MicroEdition-Configuration Identifies the J2ME configuration that is necessary to run the MIDlet MicroEdition-Profile: PDAP-1.0 MIDP-1.0 MIDlet-Icon Icon associated with MIDlet. Must be in PNG image format. (optional) A PDAlet suite that contains both MIDlets and PDAlets MIDlet-Description Description of MIDlet (optional) requires both the PDAP API– and the MIDP API–compatible VM PDAlet-n Attribute per PADlet. Values are to install and execute the PDAlet suite. However, there are times PADlet name, optional icon, and when you want the PDAlet suite to be installed and execute only PADlet class name. the MIDlets within the PDAlet suite if the VM is only MIDP 1.0. MicroEdition-Profile-Opt A list of noncritical profiles support- In this situation, you can specify that the PDAP API is optional. ed and desired by the PDAlet suite. To specify that the PDAP API is optional to run the PDAlet Installation of the suite will proceed use the MicroEdition-Profile-Opt manifest attribute as shown even if any of these profiles are not in the following code segment. The PDAlet suite will install present in the PDAlet suite. This and execute on a MIDP 1.0–only VM. Only MIDlet programs complements the MicroEdition- will be installed and executed. PDAlets are considered appli- profile attribute. cation-specific attributes and are not available for execution. TABLE 2 Attributes of the manifest file MicroEdition-Profile: MIDP-1.0 MicroEdition-Profile-Opt: PDAP-1.0 Version, and MIDlet-Vendor attributes in the JAD file must MicroEdition-Configuration: CLDC-1.1 match the same attributes in the manifest. If the values are different, the application manager uses the attribute of the

Home J2EEJava Application J2SE Descriptor File JAD file. Failure to include these attributes in the JAD file will Application management software uses a Java Application prevent the JAR file from loading into the device. Descriptor File (JAD) to manage the PDAlet, and the JAD can A developer can include application attributes in a JAD file. be used by the PDAlet to configure specific attributes. You may An application attribute is a name:value pair that contains a include a JAD within the JAR file of a PDAlet suite as a way to value unique to the application. Any name can be given to an pass parameters to a PDAlet without modifying the JAR file. A application attribute as long as the name does not begin with JAD file is also used to provide the application manager with MIDlet-, PDAlet-, or MicroEdition-. additional content information about the JAR file to deter- mine if the PDAlet suite can be implemented on the device. Abstract Windowing Toolkit A JAD file is similar to a manifest in that both contain The PDA profile uses common user interface elements of attributes that are name:value pairs. Name:value pairs can the Java Abstract Windowing Toolkit (AWT) as the user inter- appear in any order within the JAD file. There are six required face solution for PDAlets. These user interface elements are system attributes for a JAD file, see below. A system attribute native to many PDAs that use the ARM processor. is an attribute that’s defined in the J2ME specification. Table 3 The AWT used in the PDA profile is a subset of the J2SE AWT contains a complete list of system attributes. All JAD files must that’s designed to utilize the limited display space and memory have the .jad extension. Listing 5 illustrates a typical JAD file. constraints found in a PDA. This subset contains all the features that you’ll require when developing a PDA application. MIDlet-Name A subset of AWT is used as the user interface API for two MIDlet-Version J2ME profiles: Personal Basis Profile (PBP) and Personal MIDlet-Vendor Profile (PP). Each is used for a targeted class of devices. As a PIDlet-n point of reference, the PDAP AWT is a subset of the Personal MIDlet-n Profile. MIDlet-Jar-URL The PDA Profile subset contains support for all but the fol- lowing features: The JAD file shown in Listing 5 contains a few attributes • Serialization of UI components that are also found in the manifest file. The first three attri- • Object cloning butes in the JAD are identical to attributes in the manifest file. • J2SE security model The MIDlet-Jar-URL attribute contains the URL of the JAR • Buffered images file, which in this example is called bestmidlet.jar. The last • Data transfer APIs required attribute in the JAD file is the MIDlet-n and PDAlet- • Alpha composite image manipulation n attribute that defines a PDAlet and MIDlet of the PDAlet suite that’s identical to the PDAlet-n and MIDlet-n attributes Characteristics of PDA Profile AWT of the manifest. A MIDlet-n attribute is required for each PDAlets run on a variety of PDA devices, each having sup- MIDlet in the PDAlet suite, and a PDAlet-n attribute is port for some set of graphical user interface elements. required for each PDAlet in the PDAlet suite. Fortunately for developers, PDA devices that run PDAP A word of caution: the values of the MIDlet-Name, MIDlet- API–capable VMs must adhere to a minimum of GUI elements

50 JANUARY 2003

JJavaava COMCOM live well work smart play hard —wireless makes it possible

Success can be measured. Whether you climb one rung at a time, or shoot CTIA WIRELESS 2003’s Pavilions for Developers, straight up like a rocket, making it to the top in Mobile Entertainment and “Wireless Lifestyles” business requires preparation, information and will generate more wireless and mobile computing vision. In wireless, that means knowing what’s product announcements than any other show. new, what’s hot and what’s not before your Whether you’ve seen it on BBC, CNN, in the competition does. Wall Street Journal, Wireless Week or RCR Wireless News—when it’s news in wireless, it’s out of With 900+ exhibitors, more than 400,000 sq. ft. CTIA WIRELESS. of exhibit space, International Pavilions and attendees representing more than 90 countries, Climb the ladder. Grab the brass ring. CTIA WIRELESS 2003 will place you at the pinnacle of everything that’s new in wireless—globally. CTIA WIRELESS 2003 is the place to start.

CTIA Educational Sessions – March 17-19 Special Interest Seminars • Wireless Data University – March 16 • Mobile Entertainment Summit – March 16 • Latin American Conference – March 18 Co-located Conferences • IEEE Wireless Communications and Networking Conference - WCNC 2003 – March 16-21 • Microsoft® Mobility Developer Conference – March 18-21 Attend the Microsoft® Mobility Developer Conference— the premier developer event for building and bringing to market wireless applications for Microsoft Windows® Powered mobile devices, including Pocket PC and Smartphone. Designed for developers, independent software vendors, wireless operators and IT professionals, this three-day event will provide the tools and strategies to build and market mobile applications, content and Smartservices. Register today at www.MobilityDevCon.com/CTIA. CTIAWIRELESS 2003 ERNEST N. MORIAL CONVENTION CENTER, NEW ORLEANS, LA, USA

Day 3 www.ctiashow.com Ted Turner Vice Chairman Register NOW and save up to $345 AOL Time Warner

Hosted by: Show Partners: Show Sponsors: that enable you to design a PDAlet that can take advantage of might permit multiple top-level windows to be shown and be these GUI elements. active simultaneously. Color choices for your PDAlet GUI might be limited to Tip: The implementation determines the behavior of win- black and white since these are the only two colors that an dowing for the application if your PDAlet does not make a top- implementation is required to support. Realistically, however, level window visible. many implementations will support a variety of colors Top-level windows may not be resizable by your PDAlet or through the RGB constructor for the Color class. Therefore it’s by the user, and calls to the setSize() method are silently wise to test your PDAlet on as many implementations as pos- ignored. Therefore, you should assume that resizing is not

J2ME sible to be assured that your color choices don’t negatively available unless you’re designing an application for a specific impact your application. PDA that you know enables top-level windows to be resized. You also need to be alerted to the fact that some imple- Likewise, you should expect that the implementation mentations that support a broad color palette may not permit might limit or prohibit the resizing of dialogs. Attempts to you to change the colors of standard GUI elements such as change the size of a dialog may result in a different size than menus and title bars. However, this lack of support doesn’t the size you requested – or no change whatsoever. prevent you from calling methods to change the color of those Implementations that prohibit resizing of dialogs will not elements. The implementation won’t throw an error, but will notify your application that an attempt to resize has failed. simply ignore your request to change the color of the element. Instead, they ignore your request to resize the dialog. In some PDAlets you may want to set your own cursor Always minimize the need to change the size of a dialog using the AWT Component class. While setting the cursor is within your application. If you must change the dialog size, commonplace in J2SE applications, you might not be able to make sure you test those changes on all the implementations do so using the PDAP API because some implementations that will be running your application in order to determine may prohibit such settings. Attempts to set the cursor will the visual effect those changes have on the application’s cause a silent error. The implementation will continue to run graphical user interface. Failure to do so might result in an your PDAlet, but ignore your request to change the cursor. unexpected GUI for your PDAlet. Avoid using a variety of fonts in your application’s graphi- Additional restrictions might apply to the location of user interface because they may not be supported by the dialogs on the screen. Some implementations may limit the implementation. The PDAP only requires support for location on the screen where you can display the dialog, and Font.Plain. Support for other fonts is implementation other implementations outrightly prohibit the application to dependent. You can’t assume that a font other than Font.Plain determine where the dialog is displayed on the screen. And, as is available unless your application is tailored to run on a spe- with other prohibitions discussed in this section, your PDAlet cific implementation. continues to run uninterrupted because your request for

Home J2EEAnother limitation J2SE of running a PDAlet is thread safety. change is ignored by the implementation. The PDAP does not mandate that AWT be thread safe. PDAP does not require that an implementation provide a Therefore, avoid concurrent access to GUI objects using dif- means to display a title for a dialog. This means that calling ferent threads. However, you can use a system event thread to the setTitle() method and getTitle() method have no effect on enable concurrent access by calling the static invokeLater() the dialog. method and the invokeAndWait() methods of the EventQueue Frames also have many of the restrictions found in dialogs. class. You can expect that an implementation will support a one- AWT offers window management capabilities that enable sized frame that can’t be resized by a user or an application. you to instantiate frames, windows, and dialogs from any- An attempt to size or resize a frame causes a silent error to where in the PDAlet and then show them by calling appropri- occur without an error message being sent to your applica- ate methods. All PDAP implementations support multiple tion. top-level windows that are visible at any given time. Likewise, the location of a frame is determined by the However, there are window management limitations that implementation, not by the application or the user of the restrict windowing. Only one top-level window (window, application. Frames also can’t be iconified or titled. As with all frame, or dialog classes) can be shown (seen by the user) and the restrictions discussed in this section, an implementation active (has input focus) at a time. Some implementations may not have these restrictions.

JAD FILE ATTRIBUTE DESCRIPTION Personal Information Management MIDlet-Name MIDlet suite name A PDA device has native personal information management MIDlet-Version MIDlet version number (PIM) data that’s managed by personal information applica- MIDlet-Vendor Name of the vendor who supplied the tions that run on the PDA device. The PDA profile requires that MIDlet an implementation grant PDAlets access to PIM data. This MIDlet-n Attribute per MIDlet. Values are means that your PDAlet can access data managed by the PDA MIDlet name, optional icon, and device’s address book, calendar, and to-do list applications. PIM MIDlet class name. data does not have to reside on the device. Your PDAlet can MIDlet-Jar-URL Location of the JAR file access the data even if the information is contained on a remote MIDlet-Jar-Size Size of the JAR file in bytes (optional) device, such as a PC that’s linked to the PDA device. MIDlet-Data-Size Minimum size (in bytes) for persist- The PDAP API implementation will handle security man- ent data storage (optional) agement to prevent unauthorized Java applications from MIDlet-Description Description of MIDlet (optional) accessing PIM databases. The implementation also provides a MIDlet-Delete-Confirm Confirmation required before mechanism to enable a PDAlet to access PIM data efficiently removing the MIDlet suite (optional) without hindering performance. MIDlet-Install-Notify Send installation status to given URL PIM data can be imported and exported using a format (optional) specified by the Internet Mail Consortium. The vCard 3.0 for- mat is used for address book entries and the vCalendar 1.0 for- TABLE 3 Attributes for a JAD file mat is used for calendar and to-do entries.

52 JANUARY 2003

JJava COMCOM

You can access PIM data directly from your PDAlet by A Welcome Addition using the PDAP PIM API found in the javax.microedition.pim J2ME developers who design and build applications for PDAs package. All PDAP implementations support the PDAP PIM will find the PDA Profile an invaluable addition to their develop- API. ment arsenal, enabling the creation of powerful applications that There are three types of PIM databases supported by the take advantage of a new PDA footprint. The PDA Profile provides PDAP PIM API: Event, Contact, and ToDo. The Contact specifications for a rich set of AWT components that are used to Database also supports a photo field that can receive and implement sophisticated graphical user interfaces for PDA appli- store data in any of the IANA registered image formats or a cations, GUIs similar to those found on desktop applications.

J2ME nonstandard image format. The Photo field is consistent with The PDA Profile also gives J2ME applications access to the definition of the PHOTO field in the vCard specification information stored on a PDA by proprietary, personal infor- and must support the Portable Network Graphics (PNG) for- mation management software that OEMs supply with the mat. devices. This means your J2ME application can interact with a PDA’s address book, calendar, and to-do list, including storing Connectivity your own information in the databases used by these applica- Every PDAP implementation must have an HTTP connec- tions. Combining connectivity and security capabilities with tion for networking devices, which is the same requirement AWT and personal information management, the PDA Profile for the MIDP profile. However, some implementations may is the right tool for every J2ME developer. support the Generic Connection Framework API, the logical [email protected] serial port connection using CommConnection class, as well as the file systems and/or removable memory cards using the FileConnection class. Support for the logical serial port connection and Listing 1: A simple MIDlet for the file systems is dependent on the operating sys- public class MyApp extends MIDlet { public void startApp() tem and hardware support that’s available on the { device running the PDAP implementation. The device } public void pauseApp() is not necessarily required to have a serial port con- { nection if the device’s operating system enables an IR } public void destroyApp() port to be configured as a logical serial port. { The file system of a device that implements PDAP } } is typically located either in the device’s memory or on memory cards, depending on the device and the limits Listing 2: A simple PDAlet

Home J2EEof the operating J2SE system. Memory cards that contain public class MyApp extends MIDlet { file systems include: public void startApp() { • SmartMedia Card (SSFDC) java.awt.Toolkit tk = java.awt.Toolkit.getDefaultToolkit(); • CompactFlash Card (CF) } public void pauseApp() • Secure Digital Card (SD) { • MultiMedia Card (MMC) } public void destroyApp() • MemoryStick (MS) { } Security } There are multiple security features imposed by the Listing 3: A manifest file PDA profile that protect the user of the application MIDlet-Name: CardGames and the device from malicious access and use. The MIDlet-Version: 1.0.0 MIDlet-Vendor: PalmSource, Inc. PDA employs the sandbox security model that’s imple- MicroEdition-Profile: PDAP-1.0 mented in CLDC 1.1 and MIDP 1.0. Security is further MicroEdition-Configuration: CLDC-1.1 MIDlet-1: Solitaire, /solitaire.png, com.acme.cards.Solitaire enhanced by the authorization security that enforces MIDlet-2: Poker, /poker.png, com.acme.cards.Poker access privileges on resources of the device. These MIDlet-3: BlackJack, /bj.png, com.acme.cards.BlackJack PDAlet-4: ScoreManager, /manager.png, com.acme.cards.Manager enhanced security policies will also be found in MIDP PDAlet-5: CardPlayers, /players.png, com.acme.cards.Players 2.0. The enhanced security policies are hidden from Listing 4: Showing preference for a PDAlet over a MIDlet in the manifest file the application and become visible only if a security MIDlet-Name: CardGames MIDlet-Version: 1.0.0 exception occurs when using the PDAP API privilege MIDlet-Vendor: PalmSource, Inc. functionality. Restrictions and permissible actions are MicroEdition-Profile: PDAP-1.0 MicroEdition-Configuration: CLDC-1.1 associated with all PDAlets and MIDlets in a PDAlet MIDlet-1: Solitaire, /solitaire.png, com.acme.cards.Solitaire suite and all code that runs on behalf of a member of MIDlet-2: Poker, /poker.png, com.acme.cards.Poker MIDlet-3: BlackJack, /bj.png, com.acme.cards.BlackJack the PDAlet suite. PDAlet-2: PDAPoker, /PDApoker.png, com.acme.cards.PDAPoker The implementation determines how authoriza- PDAlet-4: ScoreManager, /manager.png, com.acme.cards.Manager PDAlet-5: CardPlayers, /players.png, com.acme.cards.Players tion results and configuration settings are presented to the user in the user interface. However, the implemen- Listing 5: A JAD file AUTHOR BIO tation will require privileges to: MIDlet-Name: Best MIDlet Jim Keogh is a member of • Read data from and write data to a PIM database MIDlet-Version: 2.0 MIDlet-Vendor: MyCompany the faculty at Columbia • Read data from and write data to components (i.e., MIDlet-Jar-URL: http://www.mycompany.com/bestmidlet.jar University and author of files, directories) of the file system MIDlet-3: BlackJack, /bj.png, com.acme.cards.BlackJack PDAlet-2: ScoreManager, /manager.png, com.acme.cards.Manager J2EE,The Complete • Read data from and write data to input/output Reference and J2ME,The streams Complete Reference • Access the AWT system event queue (Osborne McGraw Hill). • Listen to all AWT events

54 JANUARY 2003

Java COM Conference: January 21-24, 2003 Expo: January 22-24, 2003 The Javits Center New York, NY

Where PEN Minds Meet O Linux is thriving! Financial services, telecommunications, government and retail are utilizing this amazing technology. Shouldn’t you? • Attend Keynotes and learn from inspiring visionaries who are devoted to Linux and Open Source. - Hector Ruiz, Ph. D., President & CEO, AMD - Jeffrey M. Birnbaum, Managing Director & Global Head of Enterprise Computing in the Institutional Securities Division, Morgan Stanley - Michael Tiemann, Chief Technical Officer, Red Hat - Steven A. Mills, Senior Vice President & Group Executive, IBM Corporation - Randy Mott, Senior Vice President & Chief Information Officer, Dell Computer Corporation

• All-new - Linux Financial Summit is an executive program created to address the growing demand for quality information and insight on Linux and Open Source solutions for the financial industry. Sponsored by:

• Check out the all-new Enterprise Solutions Center, where you’ll experience multi-vendor Linux and Open Source enterprise solution demonstrations. Presented by:

• Participate in LinuxWorld’s world-class education program and learn how Linux has been implemented in financial services, communications and government, gain technical and enterprise know-how in areas such as sys admin, business and emerging technologies. • Explore the newest technologies from leading Linux and Open Source suppliers and a growing array of start-ups. • Take your seat at The Golden Penguin Bowl, the lively quiz show. www.linuxworldexpo.com

Cornerstone Sponsor Platinum Sponsors Silver Sponsors PRODUCT REVIEW JDJ Labs

lthough developing full-featured product name and the directories used for desktop applications with Java has the project. Abecome a manageable task and 3. exe4j distinguishes between the console performance has improved greatly, devel- and GUI application (just like java.exe and opers still face obstacles that make it diffi- javaw.exe). For GUI applications, the out- cult to get their Java applications more put can be redirected into a log file, and for widely accepted. One problem with many console applications the output will be sent Java standalone applications is a lack of to the console. integration into the desktop environ- For the icon, an icon file (*.ico) can be ment, which frequently alienates users. specified. One feature I’d like to see here is a way to use a .png or another type of The Product graphic file for the icon, since many people exe4j from ej-technologies is a tool don’t have an application that creates J2SE that promises to help you seamlessly Windows icon files. integrate standalone Java applications 4. exe4j gathers the Java-related information, into the Windows environment. such as main class, classpath, VM parame- Seamless integration into the ters, and command-line arguments. The exe4j Windows environment means that the classpath generation is flexible; for exam- average user will not notice from the ple, it allows you to scan directories for .jar installation and launch process that files at runtime. by ej-technologies the application is written in Java. To 5. Afterward, exe4j shows its real strength J2EE J2ME achieve this, exe4j creates an applica- when you determine the JRE search tion-specific native launcher that sequence and JRE version requirements. serves as a bridge between the Java You can configure your executable to search application and the Windows desktop the Windows registry for installed JVMs, environment. It’s responsible for: evaluate environment variables, or look for • Providing the application icon a JVM in a directory relative to your exe- • Displaying a splash screen at start- cutable. The last method also enables you to Labs up (without the usual delay that we bundle your own JRE with the application. know from starting Java applica- 6. Now you can determine whether your exe- Home tions) cutable will show a native splash screen. After REVIEWED BY JAN BOESENBERG [email protected] • Looking for available JREs (Java choosing a bitmap file, you can add some Runtime Environments) on the lines of text to the splash screen that can be info ej-technologies, GmbH computer and prompting the user if updated during the startup of your applica- Schwanthalerstr. 178 the required JRE is not available tion to provide further feedback (see Figure 1). • Redirecting output streams 7. exe4j’s error handling can be international- 80339 München • Launching the Java application Germany Phone: +49-89-51086595 To the user the launcher is the appli- Web: www.ej-technologies.com cation, because this is what he or she will double-click on to start the application.

Specifications Installation and Usage Platform: JDK 1.3 and higher on all exe4j is available only for the Windows platforms Windows platform, which makes sense since testing a finished application Pricing: $69/$99 (single developer requires Windows. Installation is license with Basic/Gold support) straightforward, just like installing any $690/$990 (site license with other standard Windows software. In Basic/Gold support) fact, the exe4j launcher was created using exe4j itself, so the installation and launch process gives you a little taste of Test Platform how a launcher created by exe4j works. Windows XP on Pentium III 1GHz, The user interface is organized as one big 256MB RAM, 20GB hard disk wizard. It looks very polished and profession- Windows 98 on Celeron 450MHz, al, and can easily compete with native GUIs. Nevertheless, some people with high screen ized. You can choose a predefined message 128MB RAM, 6GB hard disk resolutions will probably wish for a slightly set or enter your own messages if your larger font. desired language is not present. An exe4j project is divided into nine steps. 8. Now that all necessary information is gath- 1. On the welcome screen, you can open a ered, exe4j generates the executable. previously saved project and enter the 9. In the final step, you can save your configu- license information to unlock the full ver- ration for later use or for integration within sion. an automated build process like Ant. 2. On the second screen, exe4j asks for the Most of the steps are self-explanatory, but

56 JANUARY 2003

Java COM if you get stuck, the exe4j documentation will probably solve your problem. It comes in HTML format, and while working with exe4j it’s accessed through JavaHelp. All the wizard’s steps are explained in detail, which should make it easy for a devel- oper to finish the first project without problems. In addition, it contains some information for experts, such as using exe4j from the command line or with Ant. One thing I noticed about the documentation is that the small demo application that’s included with exe4j is not mentioned at all. Total Integration Since the launcher that exe4j creates is a normal Windows application, the finished application can be distributed using any Windows install tool. In addition, to completely hide from the user that an application is written in Java, the required JRE can be bundled. This way, installing and launching the appli- FIGURE 1 Configuring the splash screen of the demo application cation will be exactly the same as installing and launching a native Windows application. Moreover, exe4j does not touch the application’s bytecode, which means that platform inde- Product Snapshot pendence will not be sacrificed. Target Audience: Java programmers Level: All Summary Pros: exe4j keeps its promise to integrate Java applications • Intuitive and aesthetic user interface seamlessly into the Windows environment. It has an intuitive GUI, and all in all looks like a solid piece of software. If you’re • Keeps promise of seamless integration with Windows developing a standalone desktop application with Java and • Well-written documentation some of your customers are using Windows (which is more Cons: than likely), I recommend downloading the evaluation version • Separate tool needed for creating *.ico-files to see how much value it can bring to your customers.

JANUARY 2003 57

Java COM Interview with Sun JDJ Asks…Sun

ava developers will have noticed in As Java technology integrates the next-generation devices, such as wire- the past few weeks that Sun has world of IT with the world of mobile less phones, pagers, PDAs, and other Jalready begun to crank up a new communications, the next generation of handsets, all the way down to smart “unified” approach to its software busi- computing will open up. Just as every cards. To speed things along, we’re ness. Sun gave JDJ an exclusive previous generation of computing has creating support programs like the chance to ask questions, offering you brought new efficiencies and better pro- Java Application Verification Program the reader the opportunity to ask ductivity to individuals and enterprises, for the Enterprise to help ensure that IT Jonathan Schwartz, the dynamic young we think the one developing now will is gaining efficiencies by building appli- executive VP of Sun’s new Software provide great benefit to us all. cations that run across all versions of J2SE Group, what’s going on at Sun. I think it’s worth noting that there’s J2EE. And we have programs for nothing fundamentally wrong with the developers, like the Java Blueprints for : I’ve been working exclusively high-tech sector. It’s a lagging indicator, J2EE and J2ME, that give “best prac- with Java since its birth. I’m a big not a leading indicator. When the lead- tices” advice. fan, especially of Sun’s Java. ing economic indicators – employment, Then there’s the , which However, this past year I noticed that GDP growth, consumer confidence – provides a flexible, semiconductor- Sun’s stock wasn’t doing well. Many point in the right direction, tech will go based computing environment that can people, Microsoft folks included, back to being a shining light of the run small Java applications. Like the J2EEhave started to claim J2ME that Sun won’t global economy. And Sun will play an rest of the platform, it’s highly secure be around in five years. I’m really important role. I have no doubts. and can be used in a variety of ways: concerned; I know Java will be fine embedded in a credit card, as an identi- because of broad support from the : This may sound like ty badge, or as a Subscriber Identity industry, but I would like to see the a broad question: In addition to Web Module in a mobile phone. Sun has creator of Java always be the leader services, what other technology built an end-to-end identity solution of Java. directions is Java targeting? around the Java Card that’s being put : Sun has plenty of : Certainly Web services is the to use in major projects such as the staying power. We are coming off a sea- main new feature to use with J2EE and U.S. Department of Defense Common

Home sonal low period and making some the rest of the Java platform. The Java Access Card and the 22 million cards adjustments to get back to profitability. Community Process has defined cross- that the Bureau of National Health If any tech company is doing well in this platform APIs for all the key Web servic- Insurance of Taiwan is issuing. economy, it’s Sun. Just take a look at es technologies: XML, UDDI, ebXML, Altogether, more than 240 million Java our annual report. We’ve been generat- SOAP, WSDL, etc. They are available for Cards have been deployed, providing ing cash every quarter, we have a strong download today – over 217,000 have another new frontier for developers to balance sheet, and we’ve been gaining already been downloaded. explore. “Despite tough times for the high-tech industry and the world economy, we believe network computing is the future”

market share against our competitors in Other technical directions? One : Are there plans to bun- both the high and low ends of the mar- would be continuing to build out the dle JDO into the J2EE environment, ket. And we made those gains even J2ME platform – by far the most in spite of its competition with CMP though telecommunications and finan- widely deployed full-featured applica- entity beans? Is Sun going to develop cial services – two of our bigger markets tion and services technology in the an official implementation? – have been hit hard in the current eco- mobile marketplace. Thirty million : As the specification lead, nomic downturn. That’s what I call handsets, 19 deployments worldwide Sun has produced a Reference resilience. Despite tough times for the – and more to come. Subscribers Implementation of JDO, but there are high-tech industry and the world econo- have the ability to play full-color currently no plans to include JDO as my, we believe network computing is games, access data from the Internet, part of the J2EE platform specification. the future. From wireless phones to take and send digital photos with If the J2EE expert group sees sufficient automobiles, game players to vending camera-equipped handsets. Lots of adoption of the JDO specification in machines, embedded controllers to opportunities here. enterprise environments, it may consider environmental sensors – all kinds of We also want to help developers JDO for inclusion in the J2EE platform. things are being connected to the net- leverage the broadest range of com- work. When economic conditions patible application support in the : Will JSR127 (JavaServer improve, we intend to be ready. We’re industry. Java gives you a common, Faces) be adopted and supported by managing our resources very carefully in compatible application platform that Sun ONE products once finalized by order to protect R&D and to continue ranges from J2EE on any sized server the expert group? bringing out compelling products. to J2SE on the desktop to J2ME on : Yes, JavaServer Faces will

58 JANUARY 2003

Java COM be included in the Sun ONE Application requests to add or upgrade functionality, ware acceleration for Java2D graphics Framework 3.0, scheduled for the first with Sun participating in many of the in each Java release. As you know, half of 2003. Sun wants to have the first expert groups. Today, Java reaches from everything that’s rendered by Swing is compliant product in the market. end to end in the world of computing, done through Java2D, so this directly and part of Sun’s focus is to also have benefits Swing. In the current release : I’m concerned about the platform reach from top to bottom, (1.4.1) the Win32 implementation of Java on the client side. It has so much to integrate everything that developers Java takes advantage of both DDraw potential, yet I feel there’s not enough need to have a rich and robust applica- and D3D. We will continue to tune per- marketing of client-side Java to the tion development and deployment envi- formance. industry. Also, is Sun putting enough ronment. The short answer is that APIs One new hardware acceleration money behind Java? Are they finding track to what the community needs. strategy we’re working on is having ways to make money in software? I Java2D target OpenGL, as Apple does have heard that Sun pushes Java only : Why doesn’t Sun just in their Java implementation. This to the extent that it can sell more hard- hand Java off to a standards body, so it approach provides cross-platform hard- ware. If this is the case, then client- can become dominant and win James ware acceleration for the Java2D imple- side Java will never be as refined as it Gosling a Nobel prize? mentation and the work we’ve done can be because desktop hardware is : First of all, James should looks very promising. not something Sun is known for. win a Nobel regardless of how Java is Distribution of the Java Virtual : We have continued to governed. The technology he pioneered Machines on the desktop is an issue we enhance the J2SE platform with the has already become virtually ubiquitous. are still working on. We need to get an up- 1.4.1 release. The Sun implementation Every major technology company to-date version of the JVM on the new has posted a world-record benchmark (except one) has adopted Java technol- desktop systems being sold and upgrade performance, and we are continuing to ogy, and 80% of the world’s companies the older versions on existing PCs. We are add improvements to the user interface are using it in their business systems. It working with PC OEMs to bundle the JVM technologies. Sun is making major runs on PCs, wireless phones, set-top on their systems, and we have decided to investments in the desktop, not only in boxes, smart cards, and network offer the industry an alternative Linux and the wider distribution of the latest Java servers – not to mention about 7 million open software–oriented desktop system. Virtual Machine, but in new Linux desk- Web pages. The Java JVM is a key part of the soft- tops, which will include Java technology. How should it be governed? We ware that will make up the system. We invest in Java to advance our any- believe the Java Community Process is • • • where/anytime/any device vision of net- working very, very well. There’s broad For future Ask JDJ sessions and to have work computing. We believe it opens up industry involvement and the platform your questions answered, please check the market, not just for our hardware, but has matured rapidly as a result. While www.n-ary.com/java/jdj/askjdj.cfm. for our software and services as well. Sun has representation in the Java : Why are you talking up Community Process and works Linux on the desktop and not Java? on many of the expert groups, :There’s no contradiction. it has no blanket veto power. We’ve always made Java available on We can veto a change to the various platforms, including Linux. It’s language or the creation of a just that we’ve decided to sell Linux new edition – that’s all. And desktops, bundled with GNOME, we’ve never even done that. Mozzilla, Evolution, StarOffice, and the We tried twice to work with latest desktop Java technologies, traditional standards bodies, including Java Card for secure identifi- but in neither case could they cation. We think there’s a market for find a way to legally secure the these systems in classrooms and call continued compatibility of the centers, banks and retail outlets – platform. Compatibility is places where the systems may have a Java’s core value proposition. limited number of functions but an The JCP has done a great job almost unlimited numbers of users. I of making Java open and mean, why should customers pay available, while continuing to Microsoft’s monopoly rents if they don’t build and expand the platform. have to? : What are : What additional APIs do your plans (if any) to improve you see being added? There are a Java on the client (and large number of APIs in Java already; Swing), technology-wise? are there any glaring omissions? I What are your plans (if any) have heard rumors about artificial to improve Java on the intelligence APIs being added. Is client, business-wise (i.e., there any truth to this? Is this really help improve the adoption of necessary given the number of algo- Java on the client side)? rithms and concepts in AI? : We are constantly : The Java Community working to improve the per- decides what new APIs will be devel- formance, UI, and distribution oped. Since 1999, the community has of J2SE. We’ve been gradually approved 190 new specification increasing the level of hard-

JANUARY 2003 59

Java COM JAVANEWS>

IntelliJ IDEA 3.0 Unleashed SOAP-based Web services, (Prague, Czech Republic) – JetBrains, enabling users to quickly Inc., has released IntelliJ IDEA 3.0, the track and troubleshoot BEA SYSTEMS AND latest version of its Java development problems such as errant > COMPONENTSOURCE FORM environment. IntelliJ IDEA 3.0 comes data, performance issues, fully equipped with industry-setting and interoperability issues. STRATEGIC ALLIANCE refactoring support, intelligent code www.mindreef.com editing assistance, a wide range of J2EE (San Jose, CA / Atlanta) –BEA Systems, Inc., an application development features for rapid Web CodePro Studio Supports infrastructure software company, and application and other enterprise devel- IBM WebSphere Studio 5.0 ComponentSource, a marketplace and community for J2SE opment, a powerful Code Inspection Development Tools reusable software components and a software reuse tool, and many other productivity fea- (Portland, OR) – infrastructure provider, have announced a strategic tures for Java developers. Instantiations, a provider alliance to increase Java developer productivity by Developers may also download a free of advanced Java develop- expanding the range of third-party components and 30-day evaluation copy of IntelliJ IDEA ment and deployment tools available on the market. Under the alliance, both from IntelliJ’s Web site at solutions, has begun ship- companies have agreed to work with the global www.intellij.com/idea/download.jsp. ping CodePro Studio 2.0, a Independent Software Vendor (ISV) community to create comprehensive suite of new reusable components, includ- J2EEMindreef Releases J2ME products that enhance ing Web services and tools for the SOAPscope Personal 1.0 IBM WebSphere Studio BEA WebLogic Enterprise Platform (Boston) – Mindreef, LLC, has and Eclipse development and other Java platforms. announced the availability of Mindreef environments. CodePro www.bea.com SOAPscope Personal 1.0, the first offer- Studio now fully supports www.componentsource.com ing in the company’s flagship product IBM WebSphere Studio 5.0 family and the industry’s first Web ser- and ensures that Java devel- News vices diagnostics system. This emerging opers deliver high-quality software in another 25,000–30,000 readers per category of products addresses the chal- record time at a reduced cost. month via its digital edition, which is an Home lenges of isolating and solving problems CodePro Studio gives developers a identical copy of its print version in applications built with Web services. rich set of tools that includes Java coding (www.sys-con.com/java/pdf/lucene.pdf). SOAPscope Personal 1.0 is an easy-to- best practices features like code audit, “Our research shows that most of our use, platform-independent diagnostics code metrics, and design patterns. readers are corporate i-technology buy- aid for developers, testers, and applica- www.instantiations.com ers of software and IT services, decision tion support technicians. It provides a makers, and developers who evaluate, scalable logger and intelligent viewer for Metrowerks Provides Advanced recommend, or approve purchases,” said Java Tools for PDAs Carmen Gonzalez, executive vice presi- PARASOFT SUPPORTS (Austin, TX) – Mobile Java developers are dent of sales and marketing at SYS-CON INDUSTRY PLATFORM FOR empowered to create professional appli- Media. “With an average pass-along rate > cations for PDAs with Metrowerks’ of 2.7 readers per copy, JDJ’s reach OPEN SOURCE DEVELOPMENT CodeWarrior Wireless Studio 7, PDA exceeds an unmatched 310,000 i-tech- Edition. This toolset provides extensive nology professionals.” (Monrovia, CA) – Parasoft, a provider of automated support for building PersonalJava appli- (*) – All circulation figures provided here are the pub- error-prevention software, has joined the Eclipse cations for Sharp Zaurus handhelds, lisher’s own data, and an audited circulation statement consortium to help support, create, and define poli- HP/Compaq iPAQs, and other Pocket will be published as soon as this information becomes cies, practices, and technology for the open-source PC–based devices. available. tool development platform. Parasoft joins industry CodeWarrior Wireless Studio 7, PDA leaders on the Eclipse Board of Stewards, including Edition, will provide developers with a Wireless Industry and Sun Deliver IBM, Sybase, Fujitsu, Red Hat, and Rational. Roman debugging-enabled version of the MIDP 2.0 Salvador, Parasoft vice president of research and Insignia PersonalJava Virtual Machine (Hong Kong) Sun Microsystems Inc. has development, will represent Parasoft on the board. and Metrowerks proprietary announced the completion of the Mobile The Eclipse platform allows system development, launch/debug agent and world-class Information Device Profile (MIDP 2.0) testing, and management tools debugger. standard and the availability of the final from multiple vendors to be www.metrowerksstore.com MIDP 2.0 specification, reference imple- integrated providing a com- www.wireless-studio.com mentation, compatibility test suite, and plete solution for users. beta version of the J2ME Wireless Toolkit Parasoft tools, including Jtest, Java Developer’s Journal Projects 2.0. Developed by more than 50 wireless SOAPtest, and WebKing, plug Record Print Circulation of Over 115,000 industry leaders worldwide to extend the into and extend the platform (Montvale, NJ) – SYS-CON Media has base collection of Java technologies for with automatic static analysis, func- announced that it is projecting a new mobile devices, MIDP 2.0 supports new tional testing, load testing, and Web services verification. record circulation for Java Developer’s and enhanced gaming, graphics, video, www.parasoft.com Journal – a more than 115,000(*)-copy audio, security, and many other features www.eclipse.org average for the most recent six months for mobile devices. ending in December 2002. JDJ is reaching www.sun.com

60 JANUARY 2003

Java COM Exclusive: Excerpts from JavaDevelopersJournal.com

IS IBM SLOWLY AND SURELY BECOMING MICROSOFT TWO? by JDJ News Desk

SPEAKING TO INDUSTRY ANALYSTS and the world’s leading with IBM’s infrastructures such as WebSphere and other mid- technology publications, including Java Developer’s Journal, dleware frameworks. “Yes, we see a stronger integration with the IBM elaborated on the details and intentions behind its WebSphere Suite and other infrastructures,” Mills said. “And this biggest announcement since its purchase of Lotus is primarily in the Java middleware space,” he added, “as IBM Development Corporation in June 1995, namely its has always been a big player there.” acquisition of Rational Software for a staggering sum in excess Sagar himself views the Rational acquisition, which is still, of $2 billion. J2EE Editor Ajit Sagar asked the senior vice presi- of course, subject to formal approval by Rational’s sharehold- dent of IBM’s Global Software Business, Steve Mills, whether ers, as “a great move” for IBM and for the Java community. the purchase would in any way diminish IBM’s commitment to “There will be more support in terms of integrated offerings Java. both in design and infrastructure products,” he explains. “I can see more comprehensive design environments in IBM’s prod- Since Rational’s heritage is cross-platform, Sagar quizzed ucts as well as in open-source Java products coming out of this Mills as to whether the perception of IBM as one of the de facto acquisition.” champions of Java infrastructures would change in any way. Is there a “but”? There’s always a but. “We’ve always been cross-platform,” Mills replied. “Clearly “All this comes at a cost,” says Sagar. “Rational has been the from a standards/open platform standpoint,” he continued, “we Microsoft of the design and development process world, while build things around Java; we principally write to Java and to IBM has been seen as a champion of things ‘not-Microsoft,’ C++. We don’t write things in Visual Basic, and we’re not working meaning effectively, Java- or IBM-specific. The combination on C# in any direct sense. So we’re not explicitly building to the gets them to a much more ‘single source for all technologies’ Microsoft infrastructure. What we’re doing is enabling on top of stance.” their infrastructure – any infrastructure we build focuses very Which begs a startling question: “Will we see IBM buy Sun heavily on the Java/J2EE environment, though not uniquely. We next?” wonders Ajit Sagar. “Are we seeing another Microsoft in mix in and extend to other languages – for example XML, anoth- the making?” er language-type structure that’s a key part of our strategy going • • • forward.” To respond to this article go to www.sys-con.com/java/ Sagar asked Mills if the move heralds a closer integration articlenews.cfm?id=1789.

JANUARY 2003 61

Java COM LETTERS TO THE EDITOR

Well-Versed in Design Patterns ever got fired for choosing IBM.” With t was great reading Alan Williamson’s edi- modeling tools integrated with their plat- Itorial “Design Pattern Snobs” (Vol. 7, issue form that can generate a lot of the more 11). His synopsis matches mine. These challenging code, we snobs are getting so bad, if you’re not well may finally have a versed in design patterns, they make you challenger for VB- feel like a second-class citizen. I’ve been in itis. While Rational software development much can also help devel- engi- longer than a lot of these people. op .NET apps, I think neers In a few recent job interviews, the I would be safe in at Sun think interviewer asked about my predicting a slant Jini relies on J2SE knowledge of design patterns. toward Java in the RMI. Sun’s Jini After answering his questions near future that will implementation currently does, but Jini is correctly, I asked him if his com- significantly level the a specification and is protocol agnostic. pany applied any of these pat- development playing field. Indeed, you mention Psinaptic, which terns. What do you think his has created LUSes without answer was? You guessed it, no. Bill Reister using RMI. The whole idea He was trying to demonstrate his [email protected] is you obtain a proxy to a superiority. This is becoming a pattern, no service, and they commu- J2EEpun intended, in this tough J2ME technology job No Respect nicate with each other environment. The requirement for knowl- f there wasn’t something to the J2EE however they choose (if at edge of design patterns is overshadowing a Iframework, do you think Microsoft would all; the proxy might be the solid knowledge of designing and have traveled down the .NET service!). building shipped enterprise appli- road? (“’Tis the Season for cations. Amalgamations” by Ajit Sagar William Swaney [Vol. 7, issue 12]). After all, isn’t [email protected] Letters Ravil A. Desai .NET just Java resculpted by [email protected] Microsoft to be proprietarily run Wake Up Home on their OS? It is the way of the ll the responses I’ve seen so far reek of SSL in MIDP 2.0 future, so hold on to any Adefensiveness and oger Ritter’s article “MIDP thoughts of taking any steps crying on the part of Java R2.0: Mobile Computing backward into C++ land. I’m not developers (“Review of The Arrives” (Vol. 7, issue 11) is a a big fan of Microsoft, but they PetStore Revisited” by good review but asserts the common are huge and I don’t think they would bet so Rickard Öberg [Vol. 7, issue misconception that much of their stakes on a framework that 12]). As with statistics, the HTTPS/SSL/TLS is a “requirement” wasn’t going to be around for a while. numbers never tell the true for IT security. In fact, SSL is broken story and can always be and it also depends on PKI, which is via e-mail manipulated to suit one a pain. SSL/TLS is mostly a “feel side or the other. I’m a Java good” requirement for security that Kudos to Sun programmer, but have also gets worse in a wireless environ- his is a great way to build GUIs worked a little with C# and the .NET ment. SSL cannot prevent server T(“SpringLayout: A Powerful and Framework. The real issue here is that Sun spoofing. And SSL, contrary to pop- Extensible Layout Manager” by Joe and others in the Java community have, in ular belief, cannot prevent man-in- Winchester and Philip Milne [Vol. 7, issue their dislike/distaste for anything Microsoft, the-middle attacks either for about 12]). The Mac folks have been building made the cardinal mistake of underestimat- 95% of all Internet users. UIs with springs with Apple’s Interface ing their opponent. Clearly, history has not About 95% of all browsers today are MSIE Builder. It’s great to be able to visualize taught us anything (Apple comes to mind) 5.0, 5.5, and 6.0, and they contain what will happen to a UI before about disregarding Microsoft. a vulnerability allowing for an it’s run. I’m glad to see that Sun Having worked in both environ- active, undetected, man-in-the- is imitating best practices like ments, I must say that building Web middle attack. No dialogs are this in the industry. Let’s hope services with Visual Studio .NET and C# shown, no warnings are given. that Apple will push Swing even was a breeze (and I was using C# for the further (directly or indirectly). first time). I was able to deploy a useful Ed Gerck application in two days, complete with [email protected] Dave Paules content delivery to an IP phone. That’s [email protected] the kind of productivity improvement Timely Tidings... that the Java community should be don’t think Alan Williamson Jini ! RMI focused on, rather than getting into Iknew how timely his editorial would be ini depends on RMI” is not a true state- meaningless contests that have no real- (“Stuff and Nonsense,” [Vol. 7, issue 12]), Jment (“Java and the Future of Ad Hoc world bearing. what with the announcement that IBM is Networking” by Karl McCabe [Vol. 7, buying Rational. I can’t tell you how many issue 12]). This is, unfortunately, a com- Raghavan times I’ve heard managers say, “No one mon misconception – many software [email protected]

62 JANUARY 2003

Java COM Special Insert: Web Services Edge East Conference & Expo Featuring FREE Tutorials, Training Sessions, Case Studies and Exposition

g

www.sys-con.com/ east/registernew.cfm

Call TODAY TODAY Call

webservicesedge2003

TO REGISTER TO 201-802-3058 2003 Hong Kong Hong EAST 2003 Berlin 2003 London March 18–20, 2003 March 18–20, Hynes Convention Center Boston

3rd Annual

200

PRODUCED BY PRODUCED

2003 $ 400

Connecting the Enterprise with Connecting the Enterprise Services, Java, XMLWeb & .NET

Connecting the Enterprise with Connecting the Enterprise Services, Java, XMLWeb & .NET

&Exposition Conference Web Services Edge Services Web Boston

$

Register by by Register March14th March14th

OWNED BY OWNED

SAVE SAVE Register by by Register SAVE SAVE MEDIA SPONSORS February 14th 14th February THELARGEST WEB SERVICES, XML AND .NET CONFERENCE JAVA, AND EXPO IN THEWORLD We are pleased Keynotes and Highlighted Speakers to bring the latest edition of the very successful Web Services Edge Conference & Expo to the Dave Chappell city of Boston this March 18-20, VP, Chief Technology Evangelist, Sonic Software 2003. Now in our third year, we Dave Chappell is the vice president and chief will continue to build on our past technology evangelist for Sonic Software. He success to make available the has more than 18 years of industry experi- most current and relevant infor- mation to you, our valued ence building software tools and infrastruc- attendee. ture for application developers, spanning all aspects of R&D, sales, marketing, and support services. Mr. Chappell With the widespread adoption of Web services across the industry, developers are facing has also been published in numerous technical journals, new challenges. In this year's conference program, we and is currently writing a series of contributed articles for will address these challenges with our most comprehen- Java Developer's Journal. sive program to date. Web Services Edge 2003 will pro- vide practical approaches and solutions to overcome the Eric Newcomer hurdles in developing and deploying Web services in Chief Technology Officer, IONA today's competitive markets. Once again Web Services Edge will feature four distin- In the role of Chief Technology Officer at guished tracks - Java, Web IONA, Eric is responsible for IONA's technolo- Services, .NET, and XML - gy roadmap and the direction of IONA's along with the newly added Orbix E2A e-Business Platforms as relates to Vendor Track. The Vendor standards adoption, architecture, and product design. Eric Track will allow specific joined IONA in November 1999, and most recently served sponsors, along with their customers, a platform to as IONA's Vice President of Engineering, Web Services present their latest technical Integration Products. Eric is a member of the XML developments and real world applications across all the Protocols and Web Services Architecture working groups at related technologies. the W3C and IONA's Advisory Committee representative to Your three days will include highly informative keynotes, UDDI.org. conference sessions, tutorials, industry-leading university certification programs, case studies, and demo presenta- Simon Phipps tions. The Expo Hall will be open on March 19 and 20, Chief Technology Evangelist , Sun Microsystems featuring the largest grouping of quality exhibitors pre- Simon Phipps, currently chief technology pared to field your questions and solve your develop- ment needs. evangelist at Sun Microsystems, speaks fre- quently at industry conferences on the sub- All the best, ject of technology trends and futures. He SYS-CON Events was previously involved in OSI standards in the 1980s, in the earliest collaborative conferencing software in the early

Web Services Edge East Conference & Expo Web Features & Attractions 1990s, and in introducing Java and XML to IBM. Featuring FREE Tutorials, Training Sessions, Case Studies and Exposition Training FREEFeaturing Tutorials, TO ALL CONFERENCE & EXPO REGISTRANTS • 3 Days Packed with Education and Training John Magee Vice President, Oracle9i Oracle • 5 Keynotes & 3 Panel Discussions John Magee is Vice President, Oracle9i at • 60 Hard Hitting and Current Seminars Oracle. He has more than 14 years experi- • FREE .NET with Russ’ TooL Shed Tutorial ence in the enterprise software industry and • Web Services & XML Tutorials has held positions in product development, product management, and product market- Java University Certification Training • ing. In his current role, he manages technical product mar- • HOT Industry-Leading Certification Programs keting for Oracle's application server and development • NEW Extended Learning: Evening Conference tools products, and is responsible for evangelizing Oracle Session & Certification Classes technology initiatives around • INFORMATIVE Round Table Discussions • Opening Day Welcome Reception

Special Insert: • SAMS Meet the Authors Hot Topics Lounge Event Sponsors • COMPELLING Case Studies & Best Practices • FEATURED Product Demonstrations on the show floor • RIVETING Real-time SYS-CON Radio Interviews

REGISTER BY PHONE–201-802-3058 Direct from the Industry Leaders, the latest in .NET, Special Insert: Web Services, Java and XML Strategies and Solutions

TM SUN MICROSYSTEMS Java University Program Web Services Programming Java™ 2 Platform: Java™ 2 Platform: Using Java™ Technology and Architect Certification Programmer Certification XML Fast Path Fast Path Thursday, March 20, 2003 Wed, March 19, 2003 Tuesday, March 18, 2003 9:00 am - 5:00 pm 9:00 am - 5:00 pm 9:00 am - 5:00 pm

Who Should Attend Who Shoud Attend Who Shoud Attend Web services designers and programmers, application This session is designed for enterprise application archi- This session is designed for programmers who have some developers and programmers using the Java programming tects, system analysts, experienced technologists and exposure to the JavaTM programming language, and are language who have experience using the JavaTM 2 developers using JavaTM technology seeking certification as ready to prepare for the Sun Certified Programmer for Platform, Enterprise Edition (J2EETM). an architect for the Java 2 Platform, Enterprise Edition Java 2 Platform exam. (J2EETM). Web Edge East Conference & Expo Services Prerequisites: Prerequisites Tutorials,Featuring FREE Training Sessions, Case Studies and Exposition Experience using the Java programming language and Prerequisites Object-oriented software development experience and basic knowledge of XML. Understanding the benefits of Java technology solutions; familiarity with the syntax and structure of Java technology- experience with object-oriented analysis and design; famil- based development. Overview: iarity with concepts of distributed computing. This one-day seminar provides in-depth knowledge of Overview Web services and shows how to develop Web services Overview The development community recognizes that certified using the Java programming language and XML, the tech- Gaining recognized competency architecting J2EE platform- competency in developing solutions using Java technology nologies of portable code and portable data respectively. based solutions is vital to your success as an architect and is vital to productivity, reaffirms your value to your organi- The session will start with an introduction on fundamental increases your career opportunities. zation, and increases your career advancement opportuni- concepts and characteristics of Web services. This will be Developed and presented by Mark Cade, this one-day ses- ties. followed by a detailed explanation of how to implement, sion helps prepare attendees to pass the Sun Certified how to describe, how to register, how to discover, and Enterprise Architect for J2EE Technology exam. Cade pro- This valuable session, developed and delivered by Philip how to invoke Web services using core Web services stan- vides an overview of the components comprising the J2EE Heller, author of the two leading Java technology certifica- dards - Simple Object Access Protocol (SOAP), Web architecture as a whole, emphasizes the incorporation of tion preparation manuals and president of Philip Heller Services Description Language (WSDL) and Universal J2EE technology into an architecture, and reviews the Associates, helps to prepare you for the Sun Certified Description, Discovery, and Integration (UDDI). In addi- exam’s testing objectives. Multiple real-world case studies Programmer for the Java 2 Platform exam. In a compre- tion, the ebXML standard, which defines the framework for demonstrate correctly architected J2EE technology-based hensive one-day seminar, Philip provides code-level, the global electronic marketplace, will be talked about in solutions and pinpoint key topics within the exam. detailed review of the Java skills and knowledge you need to confidently approach the exam. detail. Also, the tools for building and deploying Web serv- Additionally, you’ll learn how to interpret exam objectives, ices will be discussed. Each topic will be presented with what each of the three exam phases contains, and guide- Benefits concrete examples and demonstrations when possible. lines and resources to use after the course. • Receive an intensive review of the advanced topics cov- Attendees will also learn how to use standard Java APIs for Benefits ered on the Sun Certified Programmer for the Java 2 Web services, mainly Java API for XML Messaging (JAXM), Platform Exam • Receive an intensive review of the topics covered on the Java technology API for XML-based RPC (JAX-RPC), and • Increase your understanding and knowledge of Java pro- Sun Certified Enterprise Architect for the Java 2 Platform, Java technology API for XML Registries (JAXR), for devel- gramming language syntax and structure Enterprise Edition Exam oping and deploying Web services. • Prepare for the exam by reviewing practice tests and • Increase understanding and knowledge of architecting questions solutions using J2EE technology Benefits • Gain a strong understanding of Java technology funda- • Understand the system qualities: scalability, availability, • Learn the fundamental concepts and characteristics of mentals Web services extensibility, performance, and security • Gain detailed understanding on core Web services stan- • Understand trade-offs of different architectural choices Outline dards: SOAP, WSDL, UDDI • Describe the benefits and weaknesses of potential J2EE • Operating on data • Gain detailed understanding on ebXML, the standard technology-based architectures. • Shifting framework for electronic business • State benefits and costs of persistence management • Shallow and Deep Comparison • Learn Java programming language APIs for Web services strategies • The Literal String Pool – JAXM, JAX-RPC, JAXR • Review case studies of J2EE technology-based architecture • Review practice tests and questions Outline • Web services and Sun™ Open Net Environment (Sun Outline ONE) overview • Architect examination overview • Web services standards • Part multiple choice • Java APIs for Web services • Part assignment • J2EE technology and Web services • Part essay

XML Certified Developer Fast Path technologies: Web Services and the Semantic Web. XML • XSL Formatting Objects (XSL FOs) Tuesday, March 18, 2003 expertise and certification is critical for developers who • Formatting XML with CSS 9:00 am - 5:00 pm want to remain competitive in the current tight IT job mar- • XLink and XPointer ket. The practice tests and questions in this course are • XML Encryption Audience specially designed to teach you XML essentials and the • XML Signatures key concepts to successfully pass IBM® Test 141 on XML SOAP, UDDI, and WSDL This tutorial is for programmers who have some knowl- • and related technologies. XML architectures based on business and technical con- edge of XML and related technologies and would like to • siderations pass the IBM Certified Developer Test 141 on XML and Outline • Optimization and testing of XML applications Related Technologies. • Well formed XML documents • XML Infoset Prerequisites Presenter Bio: Joel Amoussou is Founder and Chief • XML namespaces Background in object-oriented programming and knowl- Learning Architect of XMLMentor. Joel is the author of the • Document analysis and modeling edge of Hypertext Markup Language (HTML). Exposure to first XML training course specially designed to prepare • Document Type Definitions (DTDs) XML and related technologies. developers for IBM® Test 141 on XML and related tech- • XML schemas nologies. Joel has created XML content management Overview • The SAX API applications for the aerospace, pharmaceutical, and pub- XML is the foundation of two important emerging • The DOM API lishing industries. • XPath and XSLT

www.sys-con.com/webservicesedge2003east/registernew.cfm Conference at-a-Glance JAVA WEB SERVICES .NET 8:00AM – 4:00PM Registration Open

(JV1) Squeezing the Best Out of Java (WS1) Security: SAML, WS-Security and relat- (NT1) .NET Framework Overview 9:00 – 9:50AM ed issues

John Magee, ORACLE

10:00AM – 10:50AM

(JV2) Testing Your Java Using JUnit (WS2) Web Services Management (NT2) Introduction to ASP.NET 11:00AM – 11:50AM

12:00PM – 2:00PM Break

2:00PM – 2:50PM Panel - WS-I “A road Map for Web Services Standards”

(JV3) Building/Deploying the Ant Way (WS3) Web Services Integration (NT3) Introduction to Web Services TUESDAY MARCH 18 TUESDAY 3:00PM – 3:50PM

(JV4) Unlocking the Secrets of JDK1.4 (WS4) Using Web Services to Integrate J2EE (NT4) How To Build Mobile Solutions 4:00PM – 4:50PM and .NET Enterprise Applications Using the Microsoft Mobile Internet Toolkit

8:00AM – 4:00PM Registration Open

(JV5) Java and .NET (WS5) Combining BPM and BRM technologies: (NT5) ASP.NET with Visual Studio.NET 9:00AM – 9:50AM a major step towards corporate agility

10:00AM – 10:50AM KEYNOTE - Sun Microsystems, Speaker TBA

11:00AM – 6:00AM EXPO OPEN 11:00 a.m. - 6:00 p.m.

(JV6) To Not Swing is to SWT! The Swing (WS6) Web Services Fundamentals: UDDI, (NT6) Best Practices for .NET 11:00AM – 11:50AM Alternative WSDL, XML Development

12:00PM – 2:00PM BREAK & EXPO

2:00PM – 2:50PM Panel - Web Services & .NET

(JV7) Talking Back to the Server; the SOAP (WS7) Portals and Web Services (NT7) Best Practices for ADO.NET Way Development 3:00PM – 3:50PM WEDNESDAY MARCH 19 WEDNESDAY

(JV8) Unlocking the Power of XML (WS8) Web Services: Next Steps After the Hype (NT8) Developing Pocket PC Web Services Edge East Conference & Expo Web 4:00PM – 4:50PM applications using the Smart Device Featuring FREE Tutorials, Training Sessions, Case Studies and Exposition Training FREEFeaturing Tutorials, Extensions for Visual Studio .NET

8:00AM – 4:00PM Registration Open (JV9) Writing SOAP Services (WS9) Web Services Best Practices (NT9) How to Debug with .NET 9:00AM – 9:50AM

KEYNOTE - Microsoft, Speaker TBA 10:00AM – 10:50AM

11:00AM – 6:00AM EXPO OPEN 11:00 a.m. - 4:00 p.m.

(JV10) Working with Data the JDO Way (WS10) Web Services Startups: Telltales of the (NT10) XML and Web Enabling Legacy 11:00AM – 11:50AM Future Applications Using BizTalk

12:00PM – 2:00PM BREAK & EXPO

2:00PM – 2:50PM PANEL - “The Future of Java”, Moderated by Alan Williamson Special Insert:

(JV11) Enterprise: The Next Generation (WS11) Web Services Interoperability: The (NT11) Migrating Visual Basic Last Mile Applications to Visual Basic.NET THURSDAY MARCH 20 THURSDAY 3:00PM – 3:50PM

(JV12) Moving Around the Limitations of (WS12) Web Services Case Study (NT12) How to Develop an End-to-End 4:00PM – 4:50PM J2ME .NET-Connected Application The Largest and Most Complete i-Developer Conference in the World Special Insert: XML VENDOR Conference Overview

(XM1) XML - A Managers Guide Session TBA Java Technology Track The Java track has been specifically designed to allow you to squeeze as much information out of each session as possible. This track is designed for the Java developer, and will be led by industry- (XM2) OASIS Standards Update XMLSPY 5 Altova leading speakers and authors. Not a track for the beginner or the novice, this track is designed for the experienced developer who wishes to catch up on the latest techniques and APIs. The Java Track has been designed with you, the more experi- enced Java developer, in mind. We know you don't have a lot of Web Edge East Conference & Expo Services spare time, and we've designed the track to ensure that your Tutorials,Featuring FREE Training Sessions, Case Studies and Exposition time is maximized and you are armed with all the necessary (XM3) A Definitive Introduction to XML SOAP and Java - Parasoft tools to take your development to the next level. Schemas Microsoft .NET Track (XM4) XML in Print - XSL:FO Session TBA Microsoft .NET represents a major evolution in how applications are developed deployed and managed on the Microsoft platform. The .NET Framework gives developers an object oriented develop- (XM5) XML in Financial Services Session TBA ment environment for building all types of applications including desktop, client/server, dynamic web page, wireless devices, serv- er based as well as complete support for XML Web Services and the related XML standards. The sessions in the .NET Track will give you a broad as well as deep understanding of the capabili- ties in the .NET Framework and how applications built on .NET are easily integrated with applications running in a heteroge- neous environments including mainframe, UNIX and J2EE plat- (XM6) Case Study: XML in Life Sciences Pattern Driven Application Development- forms. Oracle Compuware Web Services Track The Web Service track is focused on issues and topics that are at the forefront of development efforts in (XM7) Using XML for EAI - Best Practices Managing the Developer Relationship - Web Services. Although the current Sun Microsystems specifications provide a minimum set of protocols, issues such as security, transaction management, service management and coordination remain in flux. This track presents some of the (XM8) Take XML with You: XML and Mobile Session TBA leading authorities in the field on these urgent topics and Computing addresses all of the questions that currently concern designers, developers and consumers of Web Services.

XML Technology Track (XM9) Analyzing XForms Session TBA IONA Whether you’re looking to under- stand different XML standards, application techniques, or develop- ment tools; or using XML to devel- op the next generation of Web applications and services, the XML Track is your ultimate training, collaboration, and innovation ground. Sessions include fast-track, in-depth training on XML (XM10) XML Query SOAP Security- Schemas and XSL-FO. We will update you on standards develop- Rational ment and offer a comprehensive review of the various technolo- gies related to XML that are essential for today’s IT manager. The XML Track is armed with real-world applications of XML in finan- cial services, life sciences, enterprise and B2B integration, and mobile computing. We will discuss new developments around XForms, a recent W3C Standards which marks another era of standards based application development; XPath and XSLT 2.0 (XM11) XPath & XSLT 2.0 Why Web Services Management? - BEA HP XML; and Query. The XML Track explores the technology and standards, real- world applications, and trends which will set the course for the (XM12) Third Generation XML Tools Session TBA future. FREE .NET Advisory Board Web Services Tutorial Russ’ Tool Shed Wednesday, March 19, 2003 9:00 a.m. – 5:00 p.m. Join Russ as he shows you how to use Visual Studio.NET 9-12:15 Intro to Web Services using VS.NET by Sean Rhody Alan Williamson Derek Ferguson Editor in Chief, Editor in Chief, Java Editor in Chief, .NET Russ Fustino Web Services Developers Journal Developers Journal One of the key ideas behind the .NET strategy is the concept Journal Chief Technology Chief Technology Evangelist, of software as a service, or in short, Web Services. This ses- Partner, CSC Officer, n-ary Expand Beyond Corp. sion will explain what a Web Service is and provide an overview of its related technologies like XML, SOAP and UDDI. We will demonstrate how the .NET Framework makes it easy to implement them for new and existing applications. This session will also provide concrete best practices for building XML Web Services using Visual Studio.NET. We ll answer many common questions like: How will my Web Service scale? How can my XML Web Services enable interoperability with Web Services from other vendors as well as within my Thomas Robbins own organization? We ll delve into building highly reliable and Bob Familiar .NET Architect, Senior Technology Specialist, secure Web Services. Also, we will discuss issues such as Microsoft Microsoft dealing with complex data types using WSDL (Web Services New England New England Description Language), as well as securing SOAP messages using encryption. We ll see how developers can use enter- prise level XML Web Services to simplify customer solutions. 1-2:30 - Advanced Web Services Using ASP .NET Thom Robbins This session we will explore some of the more advanced areas of SOAP in ASP.NET s support for Web Services. ASP.NET Web Services are the preferred way for Web developers to expose Web services on the Internet. The goal Hitesh Seth J.P. Morgenthal is quick, easy, and high-performing SOAP services. We will Editor in Chief, XML Journal, Chief Services Architect, look at how to use the SOAP extension classes to create Chief Technology Officer, ikigo Software AG some very interesting applications on top of the core SOAP architecture found within .NET Framework. For instance, you can implement an encryption algorithm or screen scraping on top of the Web Service call. We ll dig into more advanced Hotel Arrangements Are Easier Than Ever! topics, explore the SOAP headers, and see ways to ensure Special arrangements have been made with some of Boston’s finest hotel, priced Web Services Edge East Conference & Expo Web security in our Web Services. Featuring FREE Tutorials, Training Sessions, Case Studies and Exposition Training FREEFeaturing Tutorials, well below regular rates. Hotels are locate within walking distance, if 2:45-4:15 - .NET Remoting Essentials not connected to the Hynes Convention Center. To learn more about hotel Thom Robbins savings, call ETI at (800) 829-2281 or (201) 444-0060 (direct) or fax Microsoft .NET Remoting is the .NET technology that allows reservations to (201) 444-0062. To make online reservations visit you to easily and quickly build distributed applications. All www.expotravel.com by Feb 24th, 2003. of the application components can be on one computer or they can be on multiple computers around the world. .NET SPECIAL RATES Remoting allows client applications to use objects in other processes on the same computer or on any other computer Official Hotels Address Single Double to which it can connect over its network. During this presenta- tion we will discuss what you will need to know to get started Sheraton Boston 39 Dalton Street $159 $159 with .NET Remoting. We will talk about how .NET Remoting Hotel compares with DCOM, how to host remoted objects in a variety of applications, how to call remoted objects from a client application, how to control the life time of remoted Hilton Boston 40 Dalton Street $149 $149 objects, and how to secure remoting applications. Back Bay

To learn more, visit RESERVATIONS Special Insert: www.sys-con.com/ To make reservations call (800) 829-2281 or (201) 444-0060 (direct). Fax reservations to (201) 444-0062. Credit card information is required to webservicesedge2003 guarantee reservations and expedite confirmation. Confirmations will be mailed directly from the hotel, time permitting. All changes and cancella- tions should be made directly through ETI.

REGISTER BY PHONE–201-802-3058 Special Insert: REGISTRATION FORM CONFERENCE: March 18 – 20, 2003 EXPO: March 19 – 20, 2003 4 A. Your Job Title John B. Hynes Veteran Memorial Convention Center • Boston, MA ❑ CTO, CIO, VP, Chief Architect ❑ Software Development Director/Manager/Evangelist ❑ IT Director/Manager THREE WAYS TO REGISTER FOR CONFERENCE ❑ Project Manager/Project Leader/Group Leader 1) On the Web: Credit Cards or “Bill Me” Please make checks payable to SYS-CON Events ❑ Software Architect/Systems Analyst 2) By Fax: Credit Cards or “Bill Me” 201-782-9651 ❑ Application Programmer/Evangelist ❑ Database Administrator/Programmer 3) By Mail: 135 Chestnut Ridge Road, Montvale, New Jersey 07645, Attention: Registration ❑ Software Developer/Systems Integrator/Consultant ❑ Web Programmers Please note: Registrations are not confirmed until payment is received. ❑ CEO/COO/President/Chairman/Owner/Partner ❑ VP/Director/Manager Marketing, Sales Please complete sections 1, 2, 3 and 4 ❑ VP/Director/Manager of Product Development ❑ General Division Manager/Department Manager 1 YOUR INFORMATION (Please Print) Mr. Ms. ❑ Other (please specify)______B. Business/Industry First Name ______Last Name ______❑ Computer Software ❑ Travel/Hospitality Title ______❑ Computer Hardware and ❑ Government/Military/Aerospace Electronics ❑ Health Care/Medical Company ______❑ Computer Networking & ❑ Insurance/Legal Web Edge East Conference & Expo Services Telecommunications ❑ Education Tutorials,Featuring FREE Training Sessions, Case Studies and Exposition Street ______❑ Internet/Web/E-commerce ❑ Utilities Mail Stop ______❑ Consulting & Systems ❑ Architecture/Construction/Real Integrator Estate City ______❑ Financial Services ❑ Agriculture ❑ Manufacturing ❑ Nonprofit/Religious State______Zip ______Country ______❑ Wholesale/Retail/Distribution ❑ Other (please specify) Phone ______❑ Transportation ______Fax ______E-Mail ______C. Total Number of Employees at Your Location and Entire Organization (check all that apply): 2 (Payment in full due with registration) PAYMENT METHOD: Location Company 10,000 or more 01 ❑ 01 ❑ Check or Money Order Enclosed (Registration confirmed upon receipt of payment) 5,000 - 9,999 02 ❑ 02 ❑ 1,000 - 4,999 03 ❑ 03 ❑ Check #______Amount of Check $ ______500 - 999 04 ❑ 04 ❑ 100-499 05 ❑ 05 ❑ Charge my Visa MasterCard American Express Discover 100 or less 06 ❑ 06 ❑ D. Please indicate the value of communications and Name on card______computer products and services that you recommend, buy, specify or approve over the course of one year: Card #______Exp. Date______❑ $10 million or more ❑ $10,000 - $99,999 Signature______❑ $1 million - $9.9 million ❑ Less than $10,000 ❑ $500,000 - $999,999 ❑ Don't know ❑ $100,000 - $499,999 Billing Address (if different from mailing address) ______E. What is your company’s gross annual revenue? ❑ $10 billion or more ❑ $1 million - $9.9 million ❑ ❑ 3 PLEASE INDICATE Total Registration fee $______$1 billion - $9.9 billion Less than $1 million ❑ $100 million - $999 million ❑ Don’t know YOUR CONFERENCE CHOICE: ❑ $10 million - $99.9 million Before 2/14/03 Before 3/14/03 On Site F. Do you recommend, specify, evaluate, approve or purchase ❑ GP Gold Passport includes Edge Conference march 18-20, $1,495.00 $1,695.00 $1,795.00 wireless products or services for your organization? and Select one: Web Services Programming Using Javaª 01 ❑ Yes 02 ❑ No Technology and XML (Mar.18) Javaª Fast Path: Architect G. Which of the following products, services, and/or technologies do you currently approve, specify or recommend the purchase of? (Mar.19) Javaª Fast Path: Programmer (Mar. 20) ❑ Application Servers ❑ ❑ Web Servers 3D Three Day Conference $1,295.00 $1,495.00 $1,695.00 ❑ Server Side Hardware (Does not include Sun Javaª Education) ❑ Client Side Hardware ❑ Wireless Device Hardware ❑ Databases ❑ ª 2 Day Conference (Does not include Sun Java $1,195.00 $1,295.00 $1,395.00 ❑ Java IDEs Education) (select any two days: ❑ Tue, ❑ Wed, ❑ Thurs.) ❑ Class Libraries ❑ Software Testing Tools ❑ 1 Day Conference (Does not include Sun Javaª Education) $495.00 $695.00 $895.00 ❑ Web Testing Tools ❑ (select any one day: ❑ Tue, ❑ Wed, ❑ Thurs.) Modeling Tools ❑ Team Development Tools ❑ Installation Tools ❑ JU1 Sun Javaª University Class $695.00 $895.00 $995.00 ❑ Frameworks Select one: Select one: ❑ Web Services Programming ❑ Database Access Tools / JDBC Devices ❑ Application Integration Tools ❑ Using Javaª Technology and XML (Mar.18) Javaª ❑ Enterprise Development Tool Suites Fast Path: Architect (Mar.19) ❑ Javaª Fast Path: ❑ Messaging Tools ❑ Programmer (Mar. 20) Reporting Tools ❑ Debugging Tools ❑ ❑ Virtual Machines JU2 Sun Javaª University Class $1,295.00 $1,495.00 $1,595.00 ❑ Wireless Development Tools Select two: Select one: ❑ Web Services Programming ❑ XML Tools Using Javaª Technology and XML (Mar.18) ❑ Javaª ❑ Web Services Development Toolkits ❑ Professional Training Services ❑ Fast Path: Architect (Mar.19) Javaª Fast Path: ❑ Other [Please Specify] Programmer (Mar. 20) ______❑ JU3 Sun Javaª University Class $1,495.00 $1,695.00 $1,895.00 Select three: Select one: ❑ Web Services Programming SYS-CON Events, Inc, and SYS-Con Media make no warranties regarding content, speakers or attendance. The opinions of speakers, Using Javaª Technology and XML (Mar.18) ❑ Javaª exhibitors and sponsors do not reflect the opinion of SYS-CON Events Fast Path: Architect (Mar.19) ❑ Javaª Fast Path: and SYS-CON Media and no endorsement of speakers, exhibiting companies products, or sponsors is implied. Programmer (Mar. 20)

CANCELLATIONS, 2003, will be honored less a 20% handling sessions and schedule are subject to change SUBSTITUTIONS, REFUNDS charge. No requests for refunds will be hon- without prior notice. Fax written request to SYS-CON Registration ored after March 1, 2003. Requests for substi- No solicitation by anyone other than If you require special assistance covered 201-782-9651. Requests for refunds received tutions must be made in writing prior to prior to February 15, 2003 will be honored, March 14, 2003. No one under 18 is permitted official exhibitors, sponsors or marketing under the Americans with Disabilities Act, partners is permitted. Such behavior is less a 10% handling charge; requests received to attend. No warranties are made regarding please call 201-802-3058 by cause for expulsion without refund. March 4, 2003. after February 15, 2003, and before March 1, the content of sessions or materials. Speakers, www.sys-con.com/webservicesedge2003east/registernew.cfm Meet with the Don’t Conference Miss the industry experts, March 18–20, 2003 Developer professionals, Event of and managers Exposition 2003 building todays Web March 19–20, 2003 Services enterprises! Hynes Convention Center, Boston

Past Exhibitors & Participants Web Services Edge East Conference & Expo Web Featuring FREE Tutorials, Training Sessions, Case Studies and Exposition Training FREEFeaturing Tutorials, Special Insert:

www.sys-con.com/webservicesedge2003east/registernew.cfm A LIMITED TIME SAVINGS OFFER FROM SYS-CON MEDIA

RECEIVE YOUR DIGITAL EDITION SUBSCRIBE TODAY ACCESS CODE INSTANTLY WITH YOUR PAID TO MULTIPLE MAGAZINES SUBSCRIPTIONS AND SAVE UP TO $400 AND 3-Pack Pick any 3 of our RECEIVE UP TO 3 FREE CDs! magazines and save up to $27500 Pick a Pay only $175 for a 3-Pack, a 1 year subscription 6-Pack or a plus a FREE CD • 2 Year – $299.00 ✔ • Canada/Mexico – $245.00 9-Pack • International – $315.00 6-Pack Pick any 6 of our magazines and save up to $35000 Choose the Multi-Pack you want to order by checking next to it below. Check the number of years you want to order. Indicate your location by Pay only $395 for a TO ORDER: checking either U.S., Canada/Mexico or International. Then choose which magazines you want to include with your Multi-Pack order.

WebLogic Developer’s Journal 1 year subscription 3-Pack 1YR 2YR U.S. Can/Mex Intl. U.S. - Two Years (24) Cover: $360 You Pay: $169.99 / Save: $190 + FREE $198 CD U.S. - One Year (12) Cover: $180 You Pay: $149 / Save: $31 plus 2 FREE CDs 6-Pack 1YR 2YR U.S. Can/Mex Intl. Can/Mex - Two Years (24) $360 You Pay: $179.99 / Save: $180 + FREE $198 CD Can/Mex - One Year (12) $180 You Pay: $169 / Save: $11 • 2 Year – $669.00 9-Pack 1YR 2YR U.S. Can/Mex Intl. Int’l - Two Years (24) $360 You Pay: $189.99 / Save: $170 + FREE $198 CD Int’l - One Year (12) $180 You Pay: $179 / Save: $1 • Canada/Mexico – $555.00 Java Developer’s Journal ColdFusion Developer’s Journal • International – $710.00 U.S. - Two Years (24) Cover: $144 You Pay: $89 / Save: $55 + FREE $198 CD U.S. - Two Years (24) Cover: $216 You Pay: $129 / Save: $87 + FREE $198 CD U.S. - One Year (12) Cover: $72 You Pay: $49.99 / Save: $22 U.S. - One Year (12) Cover: $108 You Pay: $89.99 / Save: $18 Can/Mex - Two Years (24) $168 You Pay: $119.99 / Save: $48 + FREE $198 CD Can/Mex - Two Years (24) $240 You Pay: $159.99 / Save: $80 + FREE $198 CD Can/Mex - One Year (12) $84 You Pay: $79.99 / Save: $4 Can/Mex - One Year (12) $120 You Pay: $99.99 / Save: $20 Int’l - Two Years (24) $216 You Pay: $176 / Save: $40 + FREE $198 CD Int’l - Two Years (24) $264 You Pay: $189 / Save: $75 + FREE $198 CD Int’l - One Year (12) $108 You Pay: $99.99 / Save: $8 Int’l - One Year (12) $132 You Pay: $129.99 / Save: $2 9-Pack Web Services Journal Wireless Business & Technology U.S.- Two Years (24) Cover: $168 You Pay: $99.99 / Save: $68 + FREE $198 CD U.S. - Two Years (24) Cover: $144 You Pay: $89 / Save: $55 + FREE $198 CD Pick all 9 of our U.S. - One Year (12) Cover: $84 You Pay: $69.99 / Save: $14 U.S. - One Year (12) Cover: $72 You Pay: $49.99 / Save: $22 Can/Mex - Two Years (24) $192 You Pay: $129 / Save: $63 + FREE $198 CD Can/Mex - Two Years (24) $192 You Pay: $139 / Save: $53 + FREE $198 CD Can/Mex - One Year (12) $96 You Pay: $89.99 / Save: $6 Can/Mex - One Year (12) $96 You Pay: $79.99 / Save: $16 magazines and save Int’l - Two Years (24) $216 You Pay: $170 / Save: $46 + FREE $198 CD Int’l - Two Years (24) $216 You Pay: $170 / Save: $46 + FREE $198 CD Int’l - One Year (12) $108 You Pay: $99.99 / Save: $8 Int’l - One Year (12) $108 You Pay: $99.99 / Save: $8 up to $40000 .NET Developer’s Journal WebSphere Developer’s Journal U.S. - Two Years (24) Cover: $168 You Pay: $99.99 / Save: $68 + FREE $198 CD U.S. - Two Years (24) Cover: $360 You Pay: $169.99 / Save: $190 + FREE $198 CD U.S. - One Year (12) Cover: $84 You Pay: $69.99 / Save: $14 U.S. - One Year (12) Cover: $180 You Pay: $149 / Save: $31 Pay only $495 for a Can/Mex - Two Years (24) $192 You Pay: $129 / Save: $63 + FREE $198 CD Can/Mex - Two Years (24) $360 You Pay: $179.99 / Save: $180 + FREE $198 CD Can/Mex - One Year (12) $96 You Pay: $89.99 / Save: $6 Can/Mex - One Year (12) $180 You Pay: $169 / Save: $11 Int’l - Two Years (24) $216 You Pay: $170 / Save: $46 + FREE $198 CD Int’l - Two Years (24) $360 You Pay: $189.99 / Save: $170 + FREE $198 CD 1 year subscription Int’l - One Year (12) $108 You Pay: $99.99 / Save: $8 Int’l - One Year (12) $180 You Pay: $179 / Save: $1 XML-Journal PowerBuilder Developer’s Journal plus 3 FREE CDs U.S. - Two Years (24) Cover: $168 You Pay: $99.99 / Save: $68 + FREE $198 CD U.S. - Two Years (24) Cover: $360 You Pay: $169.99 / Save: $190 + FREE $198 CD • 2 Year – $839.00 U.S. - One Year (12) Cover: $84 You Pay: $69.99 / Save: $14 U.S. - One Year (12) Cover: $180 You Pay: $149 / Save: $31 Can/Mex - Two Years (24) $192 You Pay: $129 / Save: $63 + FREE $198 CD Can/Mex - Two Years (24) $360 You Pay: $179.99 / Save: $180 + FREE $198 CD • Canada/Mexico – $695.00 Can/Mex - One Year (12) $96 You Pay: $89.99 / Save: $6 Can/Mex - One Year (12) $180 You Pay: $169 / Save: $11 Int’l - Two Years (24) $216 You Pay: $170 / Save: $46 + FREE $198 CD Int’l - Two Years (24) $360 You Pay: $189.99 / Save: $170 + FREE $198 CD • International – $890.00 Int’l - One Year (12) $108 You Pay: $99.99 / Save: $8 Int’l - One Year (12) $180 You Pay: $179 / Save: $1

OFFER SUBJECT TO CHANGE WITHOUT NOTICE Subscribe Online Today www.sys-con.com/suboffer.cfm CAREER OPPORTUNITIES Looking intothe Java Future… New growth areas for Java developers J2SE

For Java developers, as for all professionals, the beginning of a new year is a good time to review what new directions the technology world is moving in, what changes in WRITTEN BY the job environment those new directions will bring with them, and what changes you BILL BALOGLU & may need to make, as a Java developer, in order to continue conducting business suc- BILLY PALMIERI cessfully in this complex new world.

J2EENone of us can change J2ME the direction or Where previously many offshore solid is for high-level engineers and archi- trends of an industry. What we can do, adventures were merely exploratory – any tects, specifically in product companies however, is take control of our own future. actual success they achieved was consid- building enterprise-wide core technologies Inevitably, in the software engineer- ered an unforeseen bonus – today’s com- or core frameworks. This continues to be a ing industry as in every other sphere of panies are much more committed to strong area of employment. Such compa- business, some of today’s jobs and skills making investments and changes pay off, nies will always need the skills and experi- may be phased out and tomorrow’s jobs and they make significant efforts and ence of high-level engineers and architects will require different skills. It’s therefore investments to be successful. to build their products. Companies like always wise to consider just where the Where will the outsourcing trend Oracle, BEA, and TIBCO have both core and Home future of Java jobs and Java engineers is lead? Well, one way to predict the future applications groups. Engineering in the core heading and why. is to look at the past. We could look back or platform groups looks stable job-wise. One significant change in the way to the industrial age, for example, and Another area already experiencing technology will be conducting business see if the histories of the garment, auto- new growth is customer-facing positions in the very near future is the trend motive, or steel industries can give us a such as pre- or post-sales engineers, inte- among a number of large companies, hint as to what to expect. gration engineers, and implementation such as I2, Sun, HP, and Oracle, toward In those instances, when the expense engineers. Just think of the automotive moving more of their development off- of doing business became prohibitive at industry, for example. Car parts may be shore. Time and effort is being invested home, companies went abroad. The jobs made abroad and the car may even be AUTHOR BIOS assembled there, but if customers need Bill Baloglu is a service or want to customize a car, they do principal at ObjectFocus it locally. In the high-tech world, imple- (www. ObjectFocus Oracle, BEA, TIBCO...these companies mentation, customization, and integra- .com), a Java staffing tion contribute significantly to the bot- firm in Silicon Valley. Bill will always need the skills and tom line of every company, so they will go has extensive OO “ on needing highly skilled engineers with experience and has experience of high-level engineers and excellent communications and customer held software skills to successfully complete the work. development and There should be great opportunities for a senior technical architects to build their products long time to come in these areas. management One final thought: doomsayers positions at several sometimes speculate that one day soft- Silicon Valley firms. ware developers may be replaced by into facilities abroad in order to achieve they moved abroad were the ones on the applications that allow almost anyone Billy Palmieri is a payroll savings. production line. Assembly lines were with a high school diploma to take over seasoned staffing Of course, we’ve all heard outsourc- costly and the workers dispensable. the job. Or they foresee the day when industry executive and a ing nightmare stories from VPs, direc- They were initially replaced ”by cheaper developers could be replaced by appli- principal at ObjectFocus. tors, managers, and engineers who in foreign workers and then later by robots. cations that do the work all by them- His prior position was at the past may have been involved with If we then look at the people who are selves. That’s not going to be happening Renaissance Worldwide, groups working on development the “production line workers” in today’s in this decade though. So don’t worry! where he held abroad. We’ve all heard about the logisti- high-tech world, they are coders and • • • several senior cal and managerial problems, about the developers, especially in IT. Some of their As ever, we’re very interested in your management positions lack of experienced engineers. However, jobs are inevitably headed offshore. comments and feedback. in the firm’s Silicon Valley today the stakes have changed and so At the other end of the skills spectrum, operations. have company attitudes. one area where job demand remains rock [email protected]

72 JANUARY 2003

Java COM ADVERTISERINDEX ADVERTISER URL PHONE PAGE What’s in the next

AccelTree www.acceltree.com 38

Altova www.altova.com 9

AltoWeb www.altoweb.com 45 issue of JDJ?

American Microsystems www.amltd.com 800-648-4452 61 BEA Systems, Inc. www.dev2dev.bea.com/useworkshop 7 JDJ ASKS… BEA eWorld www.bea-eworld.com 47

Bowstreet www.bowstreet.com/easy 17

Computer Associates 27

CTIA Wireless 2003 www.ctiashow.com 51

Ektron www.ektron.com/cms300 603-594-0249 33 Evolution Hosting www.evolutionhosting.com 866-257-4809 49 IBM Don Ferguson is IBM’s lead for the EJB and J2EE specification evolution. His Fiorano Software, Inc. www.fiorano.com 37 work has focused on CORBA-based SM solutions and frameworks, and evolved InetSoft Technology Corp. www.inetsoft.com/jdj 888-216-2353 39 into an effort to define frameworks and system structure for CORBA-based object transaction monitors. The early design and prototype of these systems Infragistics, Inc. www.infragistics.com 800-231-8588 14-15 produced the IBM Component Broker and WebSphere family of products. JDJ

INT, inc. www.int.com 713-975-7434 24 readers were able to ask him questions about IBM and Java.

Jinfonet www.jinfonet.com/jdj1.htm 301-838-5560 23

LinuxWorld Conference & Expo www.linuxworldexpo.com 55 THE LONG ROAD AHEAD

Macromedia www.macromedia.com/go/jrun4jdj 31 Lately it’s been easy to dislike Sun. Their JVM is slow; Sun ONE is certainly nowhere near the fastest MotorolaFPO www.motorola.com/developers/wireless 4 J2EE application server; Forte, while capable, is far from what coders actually want to use if they want to /n software inc. www.nsoftware.com/subscriptions 29 write code in a reasonable amount of time; and MS’s n-ary www.javaSOS.com 53 constant marketing and technical assaults eat away at Sun’s armor. Northwoods Software www.nwoods.com/go/ 800-434-9820 59

Oracle oracle.com/javafaster 800-633-0546 21 ions. ENTERPRISE MESSAGING SECURITY Parasoft Corporation www.parasoft.com/jdj1 888-305-0041 19 JMS-based enterprise messaging has emerged as the ideal backbone for mission-critical and busi- QUALCOMM Incorporated www.qualcomm.com/brew 41 ness-sensitive data across the extended enterprise. As the need for more robust security measures aris- Rational Software www.rational.com/offer/javacd2 11 es, SSL is frequently used to secure messaging com- ReportMill Software www.reportmill.com/webstart 214-513-1636 25 munications. But is this using a sledgehammer to crack a nut? This article discusses different encryp- Sitraka (now part of Quest Software) www.sitraka.com/jclass/jdj 800-663-4723 13 tion technologies that are used to secure JMS and how to find the best compromise between your secu- Sitraka (now part of Quest Software) www.sitraka.com/jprobe/jdj 800-663-4723 43 rity and performance demands. Sitraka (now part of Quest Software) www.sitraka.com/performasure/jdj 800-663-4723 Cover IV REBEL WITHOUT A CLAUSE: SIX WAYS Sonic Software www.sonicsoftware.com/jdj 800-989-3773 Cover II TO MISUSE EXCEPTION HANDLING Do you consider yourself a Java expert? Think you SpiritSoft www.spiritsoft.com/climber Cover III know everything about exception handling? Rather than provide general guidelines (most of which are SYS-CON Subscription Offer www.sys-con.com/suboffer.cfm 71 well known), we decided to reveal what we call WebAppCabaret www.webappcabaret.com/jdj.jsp 57 antipatterns: common bad programming practices that we’ve seen time and again in Java code. Our Web Services Edge 2003www.sys-con.com/webservicesedge2003east/registernew.cfm201-802-3069 63- 70 purpose is to familiarize you with these counterexam- ples so that you can quickly spot and avoid them. Zero G www.zerog.com/install 415-512-7771 3 General Conditions: The Publisher reserves the right to refuse any advertising not meeting the standards that are set to protect the high edi- torial quality of Java Developer’s Journal. All advertising is subject to approval by the Publisher. The Publisher assumes no liability for any SALMON OPEN FRAMEWORK FOR costs or damages incurred if for any reason the Publisher fails to publish an advertisement. In no event shall the Publisher be liable for any costs INTERNET APPLICATIONS: A REVIEW or damages in excess of the cost of the advertisement as a result of a mistake in the advertisement or for any other reason. The Advertiser is fully responsible for all financial liability and terms of the contract executed by the agents or agencies who are acting on behalf of the Advertiser. SOFIA is a J2EE-based class and tag library for build- Conditions set in this document (except the rates) are subject to change by the Publisher without notice. No conditions other than those set forth ing database-driven Web applications. Conceptually in this “General Conditions Document” shall be binding upon the Publisher. Advertisers (and their agencies) are fully responsible for the content it’s similar to other open source frameworks like of their advertisements printed in Java Developer’s Journal. Advertisements are to be printed at the discretion of the Publisher. This discretion includes the positioning of the advertisement, except for “preferred positions” described in the rate table. Cancellations and changes to adver- Apache Struts. What makes SOFIA stand out from tisements must be made in writing before the closing date. “Publisher” in this “General Conditions Document” refers to SYS-CON Publications, Inc. This index is provided as an additional service to our readers. The publisher does not assume any liability for errors or omiss as an additional service is provided This index to our readers. other frameworks is the built in tools integration. CUBIST THREADS ‘(Frozen)’ Back in high school, I worked as a roadie for my friends’ rock and roll band. It was a great job, since I didn’t need to make WRITTEN BY much money. Good thing, that. My take from our fabulous two- BLAIRWYMAN week, Christmas ’74,“Wyoming Tour” was $9.

The band covered tunes in the ing some countercultural reading mate- across the prairie to oblivion. We didn’t emergent heavy metal genre – Uriah rial, I happened upon a simple recipe for even slow down; it was gone. J2SE Heep, Deep Purple, Led Zeppelin, a powerful – yet nontoxic and nonirritat- What next? What can we use now? Grand Funk Railroad – and got regular ing – smoke bomb. It was really simple Ah, the ashtray! We can force one tine of gigs all over the Black Hills and to compose, but it had to be “cooked,” so the fork into that hole you use to extin- Wyoming. I made literally dozens of the author advised taking great care in guish smoking material, like so, and dollars a week, when the band was its preparation. cook a batch of smoke bomb stuff here busy, just helping with unloading, I carefully cooked up a batch on my in the back seat! Yeah! setup, and aloof swaggering. Mom’s stove, mixed in the necessary I had no idea that cigarette ashes The swaggering came easy for me, matchheads, and took it out in the could catalyze a reaction so violently. J2EEbecause I also ran J2ME the band’s light show. backyard to light. After a few false “Fun with chemistry” ended with a Oh, I tried to be part of the band, prop- starts, the cakelike material finally trip into the fiery mouth of Mt. er, when I first met the guys. “Go ahead took off, momentarily filling the dis- Vesuvius, there at the end of my right and sing this Black Sabbath song for covered universe with impenetrably arm. Even factoring in the perceived us” they said, so I sidled up to the dense white smoke. I walked through time-dilation, allegedly unavoidable in microphone to belt out the definitive it, took a deep breath, and didn’t such acutely extreme circumstances, I rendition of “Sweet Leaf.” immediately die coughing, so I figured feel I can safely say that the car filled A few seconds later, as the auditory we had the band’s next Great Special with opaquely dense white smoke threshold of pain dwindled in my Effect! “instantly.” I can only imagine how that Home vibrating memory, it was obvious that I Back then, I started every road trip vehicle must have looked from the out- needed to be able to hear myself sing – with an entire Sara Lee cheesecake, just side – probably like the car suddenly in my own ears – to have any hope of out of principle. It never took long to pol- filled up with milk. carrying a tune. Since it was uncertain, ish one off, but this one went particularly Later, the driver told me what hap- just then, whether I would ever hear quickly since we needed the aluminum pened in the front seat, but I didn’t see again, I decided to just participate in a pie plate to cook up our first “official” any of it. I didn’t see anything at all, “supportive” role. smoke bomb. One of the guys brought until my buddy finally rolled down his To put the era in musical perspective, along a little alcohol burner, so right there window. The wind blew into the car, so a big hit of the time was Deep Purple’s in the back seat of the band’s ’65 Impala, out of reflex I held up my hand. In the “Smoke on the Water,” which tells the we mixed up the ingredients in the pie tin airstream from the open window my nostalgic story of a flaregun-sparked and heated them ever-so-gently. hand was absolutely the only thing I building fire at some European resort. When it was time to cool this con- could see, appearing to float with me in Our band covered the tune really well – it coction down so we could knead in the our own fluffy white pillowcase. was sort of our “signature song” – though matchheads, one of the guys had the Since snow is water, our snow- we never expected it to be prophetic… bright idea of holding the pan out the packed Wyoming highway adventure AUTHOR BIO For a bit there, we were exploring window. The windy subzero winter air was our own personal “Smoke on the Blair Wyman is a software spacey visual effects: Radio Shack strobe would certainly speed up the cooling (Frozen) Water.” (I’m just glad the band engineer working for IBM light kits, black lights with white T-shirts, process, but this turned out to be a Bad never learned “Highway to Hell.”) in Rochester, Minnesota, incredibly bright flash bulbs…anything . The wind caught that pie plate home of the IBM iSeries. was fair game. One day, as I was devour- and delivered it, rolling like a wheel, [email protected] Java Dudes

74 JANUARY 2003

Java COM

Get beyond TM metrics. PerformaSure

Now part of

Reach your J2EE performance goals.

Metrics are useful. In fact, they’re often the first step in uncovering a performance problem in your J2EE systems. But let’s face it, it’s not enough to detect the symptoms of a problem. You still need to solve it. That’s why PerformaSure correlates all metrics with individual transaction response times. It’s the difference between performance intelligence and just plain data.

Our exclusive Tag and Follow technology traces the end-to-end execution path of transactions through each component and server of a distributed J2EE system, with method-level timing captured every step of the way. Hotspots are intuitively color-coded for further drill-down. The result? Faster, more accurate performance analysis so you can reach your performance goals sooner.

Track down J2EE performance problems including: • inefficient and excessive database calls The Transaction Tree provides an end-to-end method-level view of any transaction’s path through the distributed J2EE system. Clearly see component interactions within • inefficient servlets, JSPs, EJBs, and Java classes the application architecture on a per-transaction basis, with performance hotspots highlighted in red. • network misuse including frequent/large object serialization • application server settings that limit scalability (EJB caching, JDBC pool sizes, etc.)

Take a walkthrough of PerformaSure today at: www.sitraka.com/performasure/jdj

© 2003 Quest Software, Inc. Quest, Sitraka, PerformaSure and JProbe are trademarks or registered trademarks of Quest Software, Inc. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. All other products are trademarks or registered trademarks of their respective companies.