user3719857
user3719857

Reputation: 1123

Do EJB's packaged inside a war only run in the Lite container?

I recently read EJB in Action and i stumbeled upon this text:

The Java EE 6 specification allows for session and message-driven beans to be included
inside a WAR module instead of having to deploy them separately in an EJB-JAR module.
When included in a WAR module, the beans run in the EJB Lite container.

I couldn't find any info in the specification if When included in a WAR module, the beans run in the EJB Lite container. is true.

So can EJB's packaged inside a .war run in the full ejb container or are they strictly restricted to the Lite version. Any source on the matter is welcomed :)

Upvotes: 1

Views: 308

Answers (1)

ujulu
ujulu

Reputation: 3309

The Java EE 6 specification allows for session and message-driven beans to be included inside a WAR ...

This is only partially true! message-driven beans are not definitely part of the EJB lite according to the EJB 3.1 specification (see Chapter 21.1: EJB Lite which is extracted and displayed below):

21.1 EJB 3.1 Lite

The EJB API is comprised of a large feature set with support for implementing business logic in a wide variety of enterprise applications. However, the full range of API contracts is not always crucial for all runtime environments. In addition, the breadth of the full API can present challenges for developers just getting started with Enterprise JavaBeans technology.

For these reasons this specification defines a minimal subset of the EJB API known as EJB 3.1 Lite. EJB 3.1 Lite is not a product. Rather, it is a proper subset of the full EJB 3.1 API that includes a small,powerful selection of EJB features suitable for writing portable transactional business logic. The defini- tion of EJB 3.1 Lite gives vendors an option to implement only a portable subset of the EJB API within their product. The vastly reduced size of the feature set makes it suitable for inclusion in a wider range of Java products, many of which have much smaller installation and runtime footprints than a typical full Java EE implementation.

An EJB 3.1 Lite application is merely an EJB application whose EJB API usage falls within the EJB Lite subset. There are no special APIs defined only for EJB 3.1 Lite. Therefore, any EJB 3.1 Lite application can be deployed on any Java EE product that implements Enterprise JavaBeans technology,whether that product supports EJB 3.1 Lite or the full EJB API.

As detailed in Table 27, the EJB 3.1 Lite API is composed of the following subset of the EJB API :

  • Stateless, Stateful, and Singleton Session Bean components
  • Local and no-interface view only
  • Synchronous method invocations only
  • Container-managed transactions / Bean-managed transactions
  • Declarative and programmatic Security
  • Interceptors
  • Deployment Descriptor support (ejb-jar.xml)

The answer for your question

So can EJB's packaged inside a .war run in the full ejb container or are they strictly restricted to the Lite version.

is also answered by the specification: see bold typed part in the above extract. The Java EE 6 Web Profile is required to support a .war file which is also a part of the full profile.

You can find more information in:

Upvotes: 4

Related Questions