ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button

Topic: Enterprise JavaBeans

Enterprise JavaBeans (EJB) is the primary server-side enterprise Java component architecture that allows developers to design and develop customizable, reusable business logic. Specific EJB topics of interest, include clustering, security, interoperability, design patterns, Message Beans, EJBQL, and Enterprise Media Beans (EMB).

O'Reilly Network articles about this topic:

Standardizing Java Persistence with the EJB3 Java Persistence API (ONJava.com)
Dissatisfaction with entity beans as an "official" means of persisting Java objects to databases has prompted a number of "unofficial" approaches, such as the very popular Hibernate. Now EJB3 seems to have learned its lesson: its new Java Persistence API allows you to persist plain old Java objects (POJOs) with a minimum of fuss and just a few annotations. Debu Panda looks at how to put this new standard to work.

JBoss Seam (ONJava.com)
Many frameworks are perfectly sensible and well-designed on their own, but don't work particularly well when you try to combine them. Combining, for example, JSF and EJB 3.0 requires a lot of glue code, and adding another framework like JBoss BPM confuses things further. JBoss Seam is designed to provide common context for frameworks to share objects. Project leader Thomas Heute introduces Seam and what you can do with it.

Using Dependency Injection in Java EE 5.0 (ONJava.com)
Dependency injection, also known as inversion of control, is a programming technique being adopted by many programmers and frameworks, including the popular Spring framework. But using it in J2EE 1.4 requires a burdensome deployment-descriptor-based approach. Debu Panda shows how Java EE 5.0 provides relief in the form of annotations-based dependency injection.

Bean-Managed Transaction Suspension in J2EE (ONJava.com)
Container-managed transactions seem more capable than bean-managed transactions in the EJB spec, with the latter unable to, for example, suspend and resume transactions. But what looks like a limitation isn't necessarily so, according to Dmitry Maximovich, who shows you how to get to the underlying TransactionManager, making BMT as powerful as CMT.

Constructing Services with J2EE (ONJava.com)
Web services are a popular means of deploying service-oriented applications, and the standards in J2EE 1.4 make it easier to develop services that are portable and interoperable. Debu Panda shows you how, and takes a look at how things will get easier in J2EE 5.0.

On-Demand Stateful EJBs (ONJava.com)
EJB session beans can be stateful or stateless, but they can't easily change from one to the other. That can be a problem in certain business situations. Swaminathan Radhakrishnan has a pattern that he says can address this problem.

Local and Remote EJB Interfaces (ONJava.com)
EJB 2.0's local interfaces can make your enterprise applications much faster, as they share data in memory instead of via an RMI link. But when can you use local interfaces, and when are you forced to go remote? Olexiy Prohorenko introduces the strategies for making the local/remote decision.

Using Timers in J2EE Applications (ONJava.com)
J2SE gained support for scheduled tasks in 1.3, and J2EE 1.4 provides an enterprise equivalent, with transactional, scheduled callbacks provided by application containers. Debu Panda introduces J2EE timers by way of an EJB that gets scheduled services.


"Head First EJB" Author Interview (ONJava.com)
Kathy Sierra and Bert Bates have just completed the second title in O'Reilly's Head First series, the recently released Head First EJB, a certification book as unique as the series itself. In this interview, the authors discuss why the Head First series now includes a certification book, why the book is essential even if you're not planning to take the exam, how they've used their unique teaching style to help Java candidates pass the EJB exam, and much more.

Understanding Classloaders: log4j in a J2EE Environment (ONJava.com)
EJBs are a little different from the normal J2EE world. Part of that difference lies in the app server's classloaders. While demonstrating how to use log4j with EJB applications, Vikram Goyal explains how classloaders work and how to use them.

EJB Free and Open Source Tools Summary (ONJava.com)
What's the best platform for J2EE development? Emmanuel Proulx finds himself answering that question time after time. In this article, he explores several free-as-in-speech and free-as-in-beer EJB 2.0 tools and gives his suggestions for choosing an application server.

OpenEJB: EJB for Tomcat (ONJava.com)
If you've ever added EJBs to an existing application, you know they can be complicated. Adding Tomcat makes it trickier. Fortunately, OpenEJB makes the process almost painless, as Jacek Laskowski explains.

Automating EJB Unit Testing (ONJava.com)
Adopting Extreme Programming (XP) requires programmers to have automated unit tests for most of their code. Achieving that with Enterprise Java Beans presents some difficulties. One reason is that EJBs must be deployed before testing; another reason is their intrinsic relationship to the database. Using JUnit and Apache Ant, JiRong Hu shows a simple solution to automating EJB unit testing -- moving one step closer to true XP.

EJB Inheritance, Part 4 (ONJava.com)
This series has demonstrated all sorts of ways to handle inheritance in beans. With web and message services, though, how do you handle inheritance with remotely-invoked beans? The EJB 2.0 specification allows it; Emmanuel Proulx demonstrates how.

EJB Inheritance, Part 3 (ONJava.com)
Session beans can take advantage of inheritance, just like entity beans. Indeed, implementing session bean inheritance is nowhere near as hard as it is with entity beans. Part 3 of this series shows the proper technique for implementing inheritance in session beans and addresses the use of factories.

EJB Inheritance, Part 2 (ONJava.com)
Part two of this series on inheritance with Entity Java Beans focuses on the various options for table mapping.

EJB Inheritance, Part 1 (ONJava.com)
The principles of object-oriented programming are encapsulation and inheritance. Enterprise JavaBeans handle encapsulation just fine, but what about inheritance? In this article, the author attempts to apply inheritance to EJBs.

What's New in EJB 2.1? (ONJava.com)
The draft spec for EJB 2.1 is out, and it includes enhancements to message-driven beans, the query language, and support for Web services.

Java API Map (ONJava.com)
Is the world of Java getting a little unweildy for you? Use our Java API map and directory to track all significant Java platforms and respective Java APIs. Includes the JAX Pack and MIDlets.

Business Logic, Part 3 (ONJava.com)
In Part 3 of our excerpt from Building Java Enterprise Applications (Vol. 1, Architecture), Brett McLaughlin addresses issues of statelessness and statefulness.

Business Logic, Part 2 (ONJava.com)
In Part 2 of our excerpt from Chapter 8 of Building Java Enterprise Applications, Vol I: Architecture, Brett McLaughlin builds a UserManager component, and illustrates why managers are a good thing.

JDO vs. Entity Beans: A Modest Proposal (ONJava.com)
The Java Data Objects (JDO) approach can replace performance-poor Entity Beans in many cases. But JDO is not enough; here's a proposal for improving Entity Beans without sacrificing their server-side power.

Business Logic, Part 1 (ONJava.com)
In this excerpt from Chapter 8 of Building Java Enterprise Applications, Vol I: Architecture, Brett McLaughlin discusses the fašade pattern, in which you use session beans to access entity beans. This access method is used instead of allowing direct access to entity beans, and is key to a sound strategy in building enterprise applications.

Using XDoclet: Developing EJBs with Just the Bean Class (ONJava.com)
XDoclet creates and manipulates XML descriptors and interfaces for EJBs. This article shows you how to take advantage of this open source tool.

The Debate Over Java Data Objects (ONJava.com)
The Java Data Objects spec is intended to free developers from worrying about mapping objects to databases. But not everyone thinks it's a great idea. Vendors like Thought Inc. take issue with JDO and think they have better solutions. Dion Almaer weighs in on the issues.

Unlocking the True Power of Entity EJBs (ONJava.com)
Tyler Jewell explains the real power of entity EJBs: developers can write once and deploy many times, with each deployment customized for unique data scenarios.

Stateful Session EJBs: Beasts of Burden (ONJava.com)
Tyler Jewell, BEA Systems Java Trainer, discusses the true purpose of Stateful session EJBs (SFSBs), where they belong in a J2EE design, and where they should not be used. Learn how to harness these beasts to create more robust architectures--not more burdens.

EJB Message-Driven Beans (ONJava.com)
In this excerpt from Chapter 13 of Enterprise JavaBeans, Richard Monson-Haefel explains EJB 2.0 Message-Driven Beans, and shows you how to use these in your enterprise Java and Web services development efforts.

Learning EJB QL (ONJava.com)
Learn how the addition of EJB QL to EJB 2 justifies the distributed component architecture as the standard way of defining queries, which allows database applications to be more portable.

EJB 2 and J2EE Packaging, Part II (ONJava.com)
Tyler Jewell continues his coverage of J2EE packaging issues by focusing on the approaches that vendors can use for implementing EAR classloaders and their ambiguities.

EJB 2 and J2EE Packaging (ONJava.com)
Tyler Jewell is back to discuss some of the nuances associated with J2EE packaging and provides some hints to make you more productive.

Using Ant and WebLogic EJBs (ONJava.com)
EJBs are complex. The steps required just to deploy them for Web application servers are difficult. But for developers using BEA WebLogic, life is much easier, thanks to Ant.

EJB 2 Message-Driven Beans (ONJava.com)
This article will talk about the new EJB 2.0 Message Driven Beans. I will walk through an example of using this new bean, along with the corresponding JMS infrastructure that surrounds it.

EJB 2.0 Specification Release Review (ONJava.com)
The latest revision of EJB 2.0 removes dependent objects and introduces local interfaces. Here's how to deal with them.

Sorting Out the EJB 2.0 Rumors (ONJava.com)
Tyler Jewell examines the latest rumors about the changing EJB 2.0 specification.

What's Wrong with the EJB 2 Specification? (ONJava.com)
Tyler Jewell points out errors in the latest EJB 2.0 API specification.

Clustering Stateless Session Beans (ONJava.com)
Adding to last month's article, Jewell demonstrates other techniques for load balanced and fault tolerant EJBs.

EJB 2 Clustering with Application Servers (ONJava.com)
Tyler Jewell, BEA Systems Java Trainer, teaches clustering with EJB 2, including a systematic breakdown of the different possibilities that application server vendors may incorporate.

Other documents about this topic:

Below are other references available on the web for this topic. Since other sites may change their links, please if you find any that may need to be updated.

Getting Started with EJB, Part 3
In this lesson, Richard Baldwin begins walking you through the detailed steps necessary to deploy a simple Enterprise Bean in the J2EE server. You'll learn about jar files and ear files, the deployment descriptor, J2EE applications, and the three steps required for deployment of an Enterprise Bean in the J2EE server. For Parts 1 and 2, click on previous link below the tutorial. [Source: Earthweb]

EJB Design Forum
This is a great forum for expressing and solving EJB design issues and problems, including design patterns, clustering and more. [Source: theserverside.com]

EJB Troubleshooting Forum
This is an EJB troubleshooting Forum, which should be useful for solving many of your problems and issues. [Source: theserverside.com]

Coarse Grained BMP beans with Dependent Value Objects
Coarse Grained BMP beans with Dependent Value Objects is a draft pattern. The pattern describes how to properly implement the equivalent of Dependent Objects in BMP, and provides a fully resuable implementation as an example. The pattern does not describe the motivation for dependent objects, that is a separate pattern and you can learn more about it by reading the EJB 2.0 specs or Sun's ejb-interest archives. [Source: Middleware]

Integrating SOAP and EJB
SOAP is basically an XML marshalling mechanism for RPC calls. It doesn't specify a transport although it is most commonly used with HTTP. It could also be used to encode an RPC call over a simple TCP/IP socket or a JMS message. People have a tendency to use the latest technology for no other reason than 'just because'. This article gives the reasons why SOAP may be appropriate in conjunction with session beans and when it makes little sense. See more in this article by Billy Newport on theserverside.com.

A few tips on deciding between EJB and COM
Recently, there's been much said about Enterprise JavaBeans (EJB) and Microsoft's COM+ technologies. Some assert that EJB is new, and is therefore not ready for prime-time. Others question the historical scalability of Windows, and are uneasy about using Windows 2000 in their mission-critical deployments. So what's a development lead to do when deciding between these two environments? In this article, Ed Roman, CEO of The Recently, there's been much said about Enterprise JavaBeans (EJB) and Microsoft's COM+ technologies. Some assert that EJB is new, and is therefore not ready for prime-time. Others question the historical scalability of Windows, and are uneasy about using Windows 2000 in their mission-critical deployments. So what's a development lead to do when deciding between these two environments?Middleware Company will raise some questions that you should be asking yourself to help you decide on the technology that's right for your business. This article will not answer all of your questions, but it will get you asking the right ones. [Source: Middleware]

EJB/JavaBeans Repository
Component Source has all the available JavaBean and Enterprise JavaBean (EJB)components and tools. To find a product choose one of the "Browse by" options listed on the web page or use the Product Search box provided. Please note that the Product Search facility works within the selected filter.

EJB Observer Pattern
This article explains how to implement the observer pattern in a suite of integrated EJB apps. The suite has a shared repository and each EJB application has it own repository. Every application in the suite runs on a separate host. Each application needs to observe changes in the shared repository as they occur -- and within the transaction in which they occur. If a proposed change to the shared data is unacceptable to any given application then the transaction must be aborted before the change is made permanent. [Source: theserverside.com]

Message-Driven Beans
The use of generic, encapsulated business rules has already been recognized as a fundamental need in corporate application development. In response to such a need, some AI-oriented products have been morphing into Java rule engines, and some application server products have already shifted their development focus to declarative rules. So it seems appropriate to discuss a design pattern that may foster a broader use of encapsulated business rules. [Source: theserverside.com]

SOAP and EJB Server Integration
This is a four part series on how to use SOAP with Visual Age and WebSphere. All lot of this articles just show how to install and configure the SOAP engine with VAJ/WAS. Part 2 will be useful to anybody using SOAP regardless of which server you're using as it shows how to write the server adapter code for binding SOAP to session beans. Part 3 gets SSL working and Part 4 will get certificate based authentication working. [Source: theserverside.com]

Automatic Bean-Managed Persistence
The persistence of Enterprise JavaBeans (EJB) components has become an important issue in building scalable enterprise applications based on the J2EE platform. [Source: TheServerSide.com]

EJB Tutorial
This is an EJB tutorial, written by jGuru. [Source: Sun/jGuru]

EJB Transactions Tutorial
This is an EJB Transactions tutorial session, presented at the O'Reilly Enterprise Java Conference by Doug Bateman. [Source: O'Reilly]

EJB Tutorial
This is DeMichiel's EJB tutorial session at the 2001 O'Reilly Enterprise Java Conference. [Source: O'Reilly]

Intro EJB Tutorial
This is an Introduction to EJB tutorial session as presented by William Grosso at the 2001 O'Reilly Enterprise Java Conference. [Source: O'Reilly]

Migrating from EJB 1.1 to 2.0
In previous articles, we've described the new features of the Enterprise JavaBeans TM (EJBTM) 2.0 specification and the changes those new features bring to the architecture. This article focuses on how enterprise bean developers and application developers can best migrate their application components from the earlier EJB 1.1 architecture to the 2.0 architecture. When appropriate, the article describes how a particular functional area was handled in the EJB 1.1 architecture. It then illustrates how developers can use the new features of the EJB 2.0 architecture to achieve the same functionality. In brief, the EJB 2.0 specification introduces these new features and functionality to the architecture: Message-driven beans Improvements in container-managed persistence Container-managed relationships for entity beans with container-managed persistence Local interfaces Enterprise JavaBeans Query Language (EJB QL) You should refer to the earlier articles for more information on these changes. You should also refer to the JavaTM 2 Enterprise Edition (J2EETM) tutorial. See the following: [Source: java.sun.com]

Enterprise Beans Tutorial
Enterprise beans are the J2EE components that implement Enterprise JavaBeans (EJB) technology. Enterprise beans run in the EJB container, a runtime environment within the J2EE server. (See Figure 5.) Although transparent to the application developer, the EJB container provides system-level services such as transactions to its enterprise beans. These services enable you to quickly build and deploy enterprise beans, which form the core of transactional J2EE applications. [Source: java.sun.com]

Session Beans Example
Session beans are powerful because they extend the reach of your clients into remote servers--yet they're easy to build. In Getting Started, you built a stateless session bean named ConverterEJB. This chapter examines the source code of a stateful session bean called CartEJB. [Source: java.sun.com]

Bean-Managed Persistence Examples
Data is at the heart of most business applications. In J2EE applications, entity beans represent the business objects that are stored in a database. For entity beans with bean-managed persistence, you must write the code for the database access calls. Although writing this code is an additional responsibility, you will have more control over how the entity bean accesses a database. This chapter discusses the coding techniques for entity beans with bean-managed persistence. For conceptual information on entity beans, please see What is an Entity Bean?. [Source: java.sun.com]

Message-Driven Bean Example
Since message-driven beans are based on the Java Message Service (JMS) technology, in order to understand the example in this chapter you should already be familiar with basic JMS concepts such as queues and messages. The best place to learn about these concepts is the Java Message Service Tutorial: http://java.sun.com/products/jms/tutorial/index.html This chapter describes the source code of a simple message-driven bean example. Before proceeding, you should read the basic conceptual information in What is a Message-Driven Bean?. [Source: java.sun.com]

Enterprise JavaBeans Query Language (EJB QL) defines the queries for the finder and select methods of an entity bean with container-managed persistence. A subset of SQL92, EJB QL has extensions that allow navigation over the relationships defined in an entity bean's abstract schema. The scope of an EJB QL query spans the abstract schemas of related entity beans that are packaged in the same EJB JAR file. You define EJB QL queries in the deployment descriptor of the entity bean. Typically, a tool will translate these queries into the target language of the underlying data store. Because of this translation, entity beans with container-managed persistence are portable--their code is not tied to a specific type of data store. This chapter relies on the material presented in earlier chapters. For conceptual information, see Container-Managed Persistence. For code examples, see Container-Managed Persistence Examples. [Source: java.sun.com]

When to Use EJB
A recent Gartner Group report cited companies overspent $1 billion on EJB last year, when they could have just gotten by with Servlets/JSPs. This motivates our next discussion: once you've decided whether server-side Java is the way to go, you then need to make the all-important decision: are you actually going to use EJB on this project? Or is EJB overkill? [Source: theserverside.com]

This is a community site dedicated to EJB-QL or the Enterprise JavaBeans Query Language. It contains the following: * EJB-QL syntax reference * ejb-jar.xml reference * other nice things...