Quantcast
Channel: GlassFish Related Items on Java.net
Viewing all articles
Browse latest Browse all 1091

Glassfish 3.1.2.2: CDI in OSGi webapp with JSF2

$
0
0

Hi,

I'm trying to put together a hybrid OSGi/EE6 web app, using the maven-bundle-plugin to build my WAR. The project includes CDI beans which are being referenced in the JSF pages. When deploying to Glassfish as a regular web application, everything works - this is all familiar territory to me. However when I deploy the same WAR with the OSGi type, my CDI beans are no longer visible in the JSF pages. JSF2 managed beans in the same application still work, however.

I found a post similar to mine here:
https://www.java.net//node/705454

But this refers to injecting into a servlet. I've tested this in my project and if I add a servlet class I can inject my beans into it just fine. In addition, the @OsgiService Glassfish CDI extension is working just fine. So is something going wrong with the FacesServlet? Is it possible to use CDI for a JSF-based WAB on Glassfish, has anyone done this? The official guide mentions that all of EE6 should be available to OSGi web apps but it doesn't seem to work in practice.

Thanks,

Simon Priest


Viewing all articles
Browse latest Browse all 1091

Trending Articles