Wednesday June 12, 2013

Apache OpenWebBeans-1.2.0 has been released

The Apache OpenWebBeans Team is proud to announce the release of

Apache OpenWebBeans-1.2.0

Apache OpenWebBeans is an Apache License v2 licensed implementation of the JSR-299 "Context and Dependency Injection for Java EE" and JSR-330 "atinject" specifications. OpenWebBeans has a modular structure and provides Dependency Injection scaling from Java SE environments up to EE6 server clusters with complicated ClassLoader hierarchies or OSGi environments.

openwebbeans-1.2.0 implements the CDI-1.0 API, passes the JSR-330 TCK and the JSR-299 standalone TCK.

Distribution packages can be downloaded from

The release is also available in maven.central

More info can be found at

The Apache OpenWebBeans Team  

Welcome Romain Manni-Bucau as new OpenWebBeans PMC member

The Apache OpenWebBeans team is proud to announce that Romain Manni-Bucau has accepted the invitation to our Project Management Committee.

Romain has been contributing to OpenWebBeans for a few years and responsible for integrating OWB into Apache TomEE.

Welcome on board, Romain!

Friday February 15, 2013

News from OpenWebBeans-1.2.0

The Apache OpenWebBeans team has been quite busy with big refactorings. Big improvements have been made to the proxying mechanism, the Bean scanning and the AnnotatedType handling. We managed to improve the overall performance again and now deliver almost native Java like performance for our NormalScoping proxies.

Parts which are already implemented

Let's take a close look at a few details of the parts we already finished and explain them briefly.

Split between NormalScoping Proxies and Interceptor Proxies

In OpenWebBeans 1.0.x and 1.1.x a single Bean only had one single Proxy handling for all tasks - The NormalScopedBeanInterceptorHandler. This did handle all the stuff like Interceptors, Decorators provide subclassing for abstract Decorators but also did the NormalScope handling.

As result of this unified handling we only stored the native Contextual Instances in the Contexts (Session, Request map, Conversation map, etc). The negative side effect of this approach was that we had to introduce a quite hacky mechanism to regain access to the CreationalContext. Needless to say that this was not only complex but also error prone.

In OpenWebBeans-1.2.0 we now maintain 2 proxies. The first one solely handles NormalScoping, then 2nd one does all the Interceptor and Decorator stuff. The most important change is that we apply the DecoratorProxy directly 1:1 on the Contextual Instance and thus don't need to do any of those weird CreationalContext hacks anymore. Instead the already intercepted/decorated instance gets stored in the Context.

All NormalScope proxies now implement the Interface OwbNormalScopeProxy and have a name *$OwbNormalScopeProxy*.

All Interceptor and/or Decorator proxies implement the Interface OwbInterceptorProxy and have a name *$OwbInterceptProxy*.

Additionally to those 2 proxies we also introduced a new separate proxy kind for creating subclasses for abstract Decorators which now implement the marker interface OwbDecoratorProxy.

Creating our own proxy bytecode

For performance reasons we moved from using Javassist (where we fixed quite a few mem leaks in the past) to generating our own native Java ByteCode with ASM. We now only use reflection if really necessary. For standard NormalScoping of public methods we e.g. generate the following code. Consider a simple User class:

public class User {
   public String getGivenName() { return "Hans"; }

For this class the generated bytecode of an OwbNormalScopeProxy will look like the following:

public class User$OwbNormalScopeProxy0 extends User {
  private Provider owbContextualInstanceProvider;
  public String getGivenName() {
    return owbContextualInstanceProvider.get().getGivenName();

There is no bells and whistle and especially no reflection - just pure plain Java bytecode which is blazingly fast!

Btw, we do very similar stuff for non-intercepted methods of intercepted/decorated classes. And we also improved the handling of intercepted methods and are now more than twice as fast as OWB-1.1.7 (which was already very fast). 

Cleaning up the Bean creation

In the past we had 2 ways to create beans. If an Extension used ProcessAnnotatedType to tweak the AnnotatedType of a class then we built the Bean<T> from the modified AnnotatedType<T>. For cases where the AnnotatedType did not get modified we took a completely different part and created the Bean from the Class reflection information. This part came from a time where there was no AnnotatedType in the spec yet.

In OWB-1.2.0 we now do all the Bean<T> construction based on the AnnotatedType - regardless if it got provided by a CDI-Extension or remained unchanged. This made our codebase much easier to maintain! Arne also did a great job by introducing and cleaning up all the BeanBuilders and making the final Bean<T> immutable.

Parts waiting to be done

More new things to come before the release:

  • Replace Scannotation by xbean-finder.
  • Create the initial AnnotatedTypes from the information already collected by xbean-finder instead of doing expensive Class reflection.

CDI-1.0 or CDI-1.1?

We initially targeted CDI-1.1 with this release. But during the development we figured that we do not yet need to. All the parts introduced so far are perfectly working with CDI-1.0 as well. Thus it looks like we gonna release OWB-1.2.0 as still being CDI-1.0. But we are well prepared to support the new features of CDI-1.1 very quickly as we already did all the preparations. Sometimes we internally already use CDI-1.1 mechanisms (like the BeanAttributs) and only have to add 'implements RandomCdi11FeatureInterface'. This will likely be shipped as OWB-2.0.0 though when the spec hits an almost final status and the TCK is available.

How to Test

That's a pretty easy thing. If you have the apache.snapshots maven repo in your build, then you can just reference owb 1.2.0-SNAPSHOT in your build and you're done!

Saturday January 19, 2013

Welcome Arne Limburg as new OpenWebBeans PMC member

The Apache OpenWebBeans team is proud to announce that Arne Limburg has accepted the invitation to our Project Management Committee.

Arne has been working on OpenWebBeans for a few years, is using it for big customers and helped a lot with fixing bugs and moving OWB forward to CDI-1.1.

Welcome on board, Arne!

Saturday December 15, 2012

New CMS managed page

We finally have a nice new Homepage! 

The new page is based on the ASF CMS. Read  for more info about the background.

CDI-1.1, here we come!

The Apache OpenWebBeans team started working towards implementing the CDI-1.1 specification in our trunk. Maintaining the CDI-1.0 version of OWB will be done in branches/owb_1.1.x.
[Read More]

New Committer: Jean-Louis Monteiro and Thomas Andraschko

We are proud to have Jean-Louis Monteiro and Thomas Andraschko supporting the Apache OpenWebBeans team since October 2012.

Thomas will help us supporting the failover functionality and Jean-Louis is an EJB expert working on all CDI and TomEE related parts.

Wednesday May 18, 2011

And the winner is - a new OWB logo!

The Apache OpenWebBeans community has voted on a new Logo recently.[Read More]

Wednesday June 03, 2009

Apache Incubator OpenWebBeans 1.0.0-M2 is Released

I am pleased to announce the 1.0.0-M2 release of OpenWebBeans. OpenWebBeans will be an ASL-licensed implementation of the Context and Dependency Injection for Java EE Platform Specification which is defined as JSR-299.

This M2 release contains the parts of the specification that enables the developers to start and see more functional aspects of the JSR-299 than M1 release. Please look at the README file to get more about release information.

- M2 Release Supports the followings
* Simple WebBeans Support
* Producer Method Support
* Producer Field Support
* JMS WebBeans Support
* Inheritance, Stereotype Inheritances and Realization Support
* Specialization Support
* Event Support
* Decorator and Interceptor Support
* Experimental XML Configuration Support
* Lookup and Dependency Injection Support
* Java EE Plugin Support (via ServetContextListener interface)
* JPA Persistence Context injection support.(Currently does not support JTA based persistence context.)

This release also contains full blown JSF application which is developed by JSF + OWB + JPA.

In addition to the implementation of the specification, the project aims to create a new set of Web Beans exposing functionality of other Apache Foundation projects.

Feel free to ask any questions about the OpenWebBeans and M2-Release via our user forums.

Download URL :

Project Main Site :

User Forum :

Wiki Page :

Gurkan Erdogdu
OpenWebBeans Project Lead

Thursday May 14, 2009

Sample Application with JSF, JPA and OpenWebBeans

We have written a real sample application written with JSF + JPA +OWB. It is called "Hotel Reservation Application". You can create "Admin" and "Normal" user accounts. "Admin" is responsible for defining hotels etc, and user  creates a hotel reservation.
Altough it is a simple application, it uses and shows most of the functionality that are defined in the JSR-299, including Scope and Contexts, Interceptors,Decorators, Events and Observers etc.

It is located in the trunk[1]/samples/reservation directory. In this directory

> mvn clean install -Pjetty --> to compile and install
> mvn jetty:run -Pjetty  --> to run the jetty container

Then, http://localhost:8080/reservation
Voila, enjoys it!


OWB Team



Hot Blogs (today's hits)

Tag Cloud