users@glassfish.java.net

Re: Glassfish + Open Web Beans

From: <forums_at_java.net>
Date: Tue, 9 Aug 2011 09:13:21 -0500 (CDT)

I don't know how you'd go about replacing weld as the server CDI
implementation but you should be able to use owb within a specific
application, if that is you don't use Jersey/JAX-RS which has some
compatibility issues with owb (as tested with glassfish 3.1.1, OWB 1.0 &
Jersey 1.8).   Add the dependencies openwebbeans-impl-1.0.0, and the
additional modules jsf, resource, spi & web (openwebbeans-jsf-1.0.0 etc..).
Then add this line to web.xml directly after the context params:      
<listener>
       
<listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
    </listener>   (commenting this out totally disables owb, no need to
remove dependencies)   In WEB-INF create a folder called openwebbeans
containing the file openwebbeans.properties, just take the file from the
openwebbeans distribution. If you use myfaces CODI (groupid
org.apache.myfaces.extensions.cdi.bundles artifactid
myfaces-extcdi-bundle-jsf20 v1.0.0) it will print out a nice message telling
you which cdi implementation it is using). Note that myfaces codi provides
additional scopes for jsf (REALLY useful) and intercepts standard jsf
@ManagedBean @...Scoped annotations.   Unfortunately I have loads of jax-rs
modules and can't use owb, but if you try it let us know how you get on.
Theoretically you should be able to run jMeter tests against weld, uncomment
the listener in web.xml and re-run the tests against owb.

--
[Message sent by forum member 'oversteer']
View Post: http://forums.java.net/node/830181