Today I run into a problem when trying to deploy a EAR with more than one web modules using CDI. Deploying such a EAR on Glassfish 3.1.1 or 3.1.2 will fail with the following exception:
Root exception is javax.naming.NameNotFoundException: CDIExtension not found
As you can read in this posting this is a known bug.
http://java.net/jira/browse/JERSEY-601
You can solve the problem when setting the system-property “com.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager=true”.
This can be done from the GlassFish server console.
- Select the node ->Configuration->server-config->JVM Settings
- change to the tab ‘JVM Options’
- add a new entry
-Dcom.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager=true
- restart your server
This will solve the deployment problem.