J2EE Applications and BEA WebLogic Servers

J2EE Applications and BEA WebLogic Servers

2.8 5
by Michael Girdley, Sandra L. Emerson, Rob Woollen
  • Authoritative guidance and high-performance code—straight from BEA WebLogic's product team!
  • Step-by-step, example-rich coverage of every major J2EE API
  • Case study: Build a complete e-Commerce application from scratch
  • CD-ROM: Complete BEA WebLogic Server 6evaluation version, plus extensive code library



  • Authoritative guidance and high-performance code—straight from BEA WebLogic's product team!
  • Step-by-step, example-rich coverage of every major J2EE API
  • Case study: Build a complete e-Commerce application from scratch
  • CD-ROM: Complete BEA WebLogic Server 6evaluation version, plus extensive code library

The insider's guide to J2EE development with the world's #1 Java application server—BEA WebLogic Server 6!

BEA's WebLogic Server is the de facto industry standard for developing and deploying industrial strength Java E-commerce applications. This book delivers authoritative guidance for J2EE application development with the most powerful version of WebLogic ever: WebLogic Server 6. Authored by members of BEA's WebLogic project team, the book covers every aspect of real-world WebLogic J2EE development, from start to finish, through an industrial-strength case study application. You'll find coverage of all this, and more:

  • BEA WebLogic Server: Fundamental concepts and configuration techniques
  • Designing robust, high-performance J2EE applications—including detailed coverage of capacity planning and performance testing
  • Effective use of RMI and distributed naming
  • Building presentation logic with WebLogic Server servlets and JavaServer Pages
  • Using session, entity, and message-driven Enterprise JavaBeans
  • Interfacing with Internet Mail using WebLogic Server JavaMail
  • Establishing database connectivity with JDBC and implementing transactions with JTA
  • Developing security with WebLogic Server JNDI and the Java Authentication andAuthorization Service (JAAS)
  • Packaging, deploying, and testing WebLogic Server applications

Ready to move from "Java programmer" to "expert enterprise developer"? You won't find a more useful tool than BEA WebLogic Server—or a more useful book than J2EE Applications and BEA WebLogic Server.


  • All code from the book, including a complete enterprise application
  • Complete evaluation version of BEA WebLogic Server Release 6
  • Bonus WebLogic Server tools and utilities

Product Details

Pearson Education
Publication date:
Edition description:
Older Edition
Product dimensions:
7.06(w) x 9.28(h) x 1.98(d)

Read an Excerpt

Chapter 7: Enterprise Messaging with the Java Message Service (JMS)

The Java Message Service (JMS) provides a standard enterprise messaging service for Java 2 Enterprise Edition (J2EE) applications. JMS acts as an intelligent switchboard for routing messages among application components and processes in a distributed application. JMS queues messages and can deliver them asynchronously: Messaging need not take place in real time; and messages can be sent and consumed at different times.

Benefits of JMS

There are a number of reasons to use a messaging system for interprocess communication instead of making direct method calls. A messaging system provides a clean way to connect disparate systems within an application. Messaging systems also help divide long-running work into multiple transactions for greater efficiency. When communication is asynchronous, the client need not wait for all of the processing to complete.

Messaging systems also provide reliability. JMS can optionally save a message to a persistent store. There is, however, a trade-off between reliability and performance. The messaging system runs faster if messages are not persistent, but the application must tolerate lost messages in the event of a server crash. Messaging systems also enable clients to disconnect and reconnect to the server without losing work. JMS can be configured to save messages while the client is disconnected and deliver them once the client has reconnected. Unlike method calls on a single object, JMS allows sending a single message to many recipients.

Interprocess Communication

Most large systems are divided into several separate functional units. JMS provides reliable communication between these separate processes. For instance, an e-commerce application might include a Web front-end for customer order entry. A warehouse then receives the order, packages the appropriate items, and forwards the order to the shipping department. Finally, the shipping department sends the package and updates the customer's account records.

JMS provides the communication backbone for workflow applications.

Point-to-Point Messaging
The order fulfillment application uses JMS's point-to-point (PTP) messaging model to provide reliable communication within this multi-stage application. In PTP communication, JMS delivers each message to a single message consumer. For instance, in this application, the Web front-end sends a message including the new order information. A single warehouse receives the message and processes the order. The message system guarantees that multiple warehouses do not fill the same order. This application also uses JMS's reliability guarantees. Because customer orders are important information that should be retained, the developer will request JMS to mark these messages as persistent. With persistent messages, JMS saves the message contents to a persistent storage such as a database or file store.

Publish/Subscribe Messaging
In addition to PTP communication, JMS provides a publish-and-subscribe messaging model. With publish/subscribe messaging (also known as pub/sub), a message is sent to a named topic. There might be multiple message listeners subscribed to each topic. The JMS subsystem delivers a copy of the message to each of the topic's subscribers. For instance, an e-commerce site might define a frequent-customer topic. When a customer makes several purchases, a message is sent to this topic. The site can then send “special deals” messages to a select group of listeners, the frequent customers. Because there might be several message listeners, each offering a separate special deal, it is appropriate to use pub/sub instead of PTP communication.

JMS Fundamentals

The JMS specification defines both PTP and pub/sub APIs. A JMS Server can implement one or both of these APIs. The WebLogic Server's JMS implementation includes both the PTP and pub/sub APIs.

The JMS APIs define a set of fundamental objects. Each object is separately defined in the PTP and pub/sub domains, but their function is nearly identical in both domains.

Connection Factories

Connection factories are created by the server administrator and bound into the Java Naming and Directory Interface (JNDI) tree. A JMS client uses JNDI to look up the ConnectionFactory and then uses the ConnectionFactory to establish a JMS connection. The PTP connection factory is javax.jms.QueueConnectionFactory while the pub/sub domain uses javax.jms.TopicConnectionFactory.

The WebLogic Server binds a standard connection factory with the name weblogic.jms.ConnectionFactory. It also is possible to define additional connection factories with the WebLogic Server's Administration Console. An application uses a user-defined ConnectionFactory if needed to impose additional security constraints on the ConnectionFactory.

A JMS connection represents the active connection between the JMS client and the WebLogic Server. The JMS client creates the JMS connection by calling the createQueueConnection or the createTopicConnec-tion methods on the ConnectionFactory. A JMS connection is a rela-tively heavyweight object and normally each client uses a single JMS connection. Each JMS connection can be associated with many JMS destina-tions. The PTP connection is javax.jms.QueueConnection while the pub/sub connection is javax.jms.TopicConnection.

The JMS session represents a client's conversational state with a JMS Server. A session is created from the JMS connection, and it represents a single thread of conversation between a JMS client and server. Sessions define mes-sage ordering, and JMS uses sessions for transactional messaging. The PTP model uses javax.jms.QueueSession while the pub/sub model uses javax.jms.TopicSession.

JMS destinations are the actual messaging resource. PTP messaging defines javax.jms.Queue while pub/sub includes javax.jms.Topic. The server administrator uses the WebLogic Console to create destinations with a specified JNDI name. The JMS client then performs a JNDI lookup to locate the JMS destination....

Meet the Author

Michael Girdley, Senior Product Manager for the BEA WebLogic Server, serves as marketing liaison to over 200 BEA engineers. He has extensive experience programming with Java, HTML, C, and C++, and is co-author of Web Programming with Java and Java Unleashed, Second Edition (SAMS).

Rob Woollen is Senior Software Engineer for Enterprise JavaBeans at BEA Systems, and lead developer for the WebLogic Server EJB Container. He was formerly Senior Performance Engineer in charge of analyzing and improving WebLogic Server performance.

Sandra L. Emerson is a technical writer and consultant with 20 years of experience in the software industry. She is co-author of four books, including Addison-Wesley's best-selling The Practical SQL Handbook.

Customer Reviews

Average Review:

Write a Review

and post it to your social network


Most Helpful Customer Reviews

See all customer reviews >

J2EE Applications and BEA WebLogic Servers 2.8 out of 5 based on 0 ratings. 5 reviews.
Guest More than 1 year ago
The book is supposed to be a hands on experience of Weblogic and the use of J2EE applications. However it simply does not touch on more than half of the technologies that make up J2EE. The code examples are very poor and therefore the book does not even serve as a how-to. The educational level of the book is very poor. As a lognstanding user of weblogic and J2EE architect I hoped to get more insights into wls´s internals but it hardly passes the surface. The internal webligic documentation (HTML & pdf) are much more interesting reading, even for a beginner.
Guest More than 1 year ago
I'm not new to J2EE, but I wanted a helpful, hands-on tour of BEA WebLogic. What I got was a book full of typos and examples that were confusing and poorly reviewed. The book would cite one best practice, violate the practice in the example, or present example code that didn't work, or worse, patently different from what was on the CD.

Additionally, while Windows holds the personal computer desktop, the single most deployed BEA WebLogic platform in a commercial environment is UNIX. Yet an evaluation installer for UNIX is not provided.

I can only hope that if a second edition is published, the authors will be a little more diligent in the editing room.

Guest More than 1 year ago
I'm a J2EE developer that has moderate experience with JSPs and Servlets, but not so much with EJBs and other advanced topics like RMI, etc. This book talks about the real-world implications of all these tools a J2EE programmer can use. It's occasionally light on the details of deployment, but you should be able to reference the BEA documentation for those details. This book is good because it tells you why you should be using something, or not, and how to do it, or avoid it. This is the book to get if you've done a J2EE app or two before, but were not too comfortable with all of it, or thought it could have been designed better, but had no one to tell you how to do it right. It's a great mentor.
Guest More than 1 year ago
The book seemed informative, and in chapter 4 presented what appeared to be a great, step-by-step example of deploying a JSP/JavaBean application. Unfortunately when the book got to the last, most important step, deployment, instead of continuing to work through the steps, the authors direct the reader to take code off the CD and run the application that way. Didn¿t make any sense to me, would it not make more sense, sicne this is supposed to be a hands-on BEA book, to take the reader through every step required to create the files needed to deploy the application on the server? Since deployment was the kind of information I was really after, and I had to go digging through the Weblogic files to find it, I went and got my $49 back¿
Guest More than 1 year ago
This book provides an in-depth review of utilizing J2EE with BEA Web Logic 6. It provides a very comprehensive look at deploying Java enterprise applications including session beans, entity beans, java messenging, server clustering, JNDI, and JDBC. The book provides straight-foward code examples for every chapter. The last chapter is devoted to deploying a complete auction application. The book is very useful for anyone wanting to get hands on experience with BEA Weblogic 6 server.