Monday, March 15, 2010

OpenWebBeans Apache Tomcat Support

Hello;

OpenWebBeans has been integrated with Apache Tomcat 6.x Java EE servlet/jsp container. So what?
  • You can deploy your JSR-299 enabled applications(Web deployment archives that contains WEB-INF/beans.xml marker file. ) directly into Tomcat. There is no need to define "servlet context listener" in a web.xml. Tomcat integration code automatically handles all configuration.
  • You can inject JSR-299 bean instances into Java EE component types including, Servlets, Filters, Tag Handlers, Listeners, JSF Managed Beans
You can checkout trunk from "http://svn.apache.org/repos/asf/openwebbeans/trunk/". And install it from root as "mvn install". After that do the followings
  • Add lifecycle listener to the server.xml of Tomcat. Listener class is org.apache.webbeans.web.tomcat.ContextLifecycleListener.java
  • Put JSR-299 API, JSR-330 API, Interceptor 1.1 API, and openwebbeans-tomcat and openwebbeans-spi modules to the "lib" directory of the Tomcat. (You can use geronimo-specs jars for JSR-299, JSR-330 and Interceptor APIs from http://repo2.maven.org/maven2/org/apache/geronimo/specs/)
  • Package your application with openwebbeans jars (Or if you use maven, just add dependency to openwebbeans-impl)
  • Enjoy!
There is an example in the samples directory :
http://svn.apache.org/repos/asf/openwebbeans/trunk/samples/tomcat-sample/

Have a nice week;

--Gurkan

Saturday, March 6, 2010

OpenWebBeans M4 is Released

Hi;

OpenWebBeans M4 is officially released. You can download it from http://www.apache.org/dyn/closer.cgi/openwebbeans/.

OpenWebBeans main motivation is an ease of use. There are several samples in the distribution that show how to use OpenWebBeans in
  • Java EE Web Containers
  • Embeddable OpenEJB in Tomcat
  • Java SE (Standalone Swing Application)
  • With JSF 1.2 and JSF2
  • With JSF Conversation Context
  • and more...
For example, if you wish to use OpenWebBeans in a web container such as Tomcat or Jetty, just add following listener element into web.xml

org.apache.webbeans.servlet.WebBeansConfigurationListener


Thanks;

--Gurkan