Hi Howard!

JUEL is an Expression Language implementation. It has nothing to do with CDI 
apart from CDI providing an ELResolver. JUEL is much faster than the EL 
interpreter in glassfish, so this is fine.

For your beans getting recognized in EL expressions: 

1.) Do you have a META-INF/beans.xml in all your jars/classpaths which contain 
CDI beans? This files can be empty, they just act as marker files. For the 
webapp you might add one to WEB-INF/beans.xml.


2.) Do your CDI beans you access via EL have a @Named annotation?
This is needed to make them available for ELResolvers.

3.) glassfish has a few nasty integration issues when it comes to pluggin in 
different container parts. Can you try your app on tomee-1.5? [1]. It comes 
with the latest MyFaces out of the box!

LieGrue,
strub


[1] http://tomee.apache.org/downloads.html


----- Original Message -----
> From: "Howard W. Smith, Jr." <smithh032...@gmail.com>
> To: MyFaces Discussion <users@myfaces.apache.org>
> Cc: 
> Sent: Saturday, November 17, 2012 10:35 AM
> Subject: MyFaces 2.1.9 / Glassfish 3.1.2.2: Migrating to CDI Managed Beans
> 
> Web application details:
> JSF 2.1, MyFaces 2.1.9, PrimeFaces 3.4.1 (or 3.5-SNAPSHOT), Glassfish
> 3.1.2.2 (build 5), JUEL 2.2.5
> 
> From server log:
> INFO: WELD-000900 1.1.8 (Final)
> 
> Yesterday, I started migrating from JSF Managed Beans to CDI Managed Beans.
> I referred to Chapter 28 (CDI) of Oracle's Java EE 6
> Tutorial<http://docs.oracle.com/javaee/6/tutorial/doc/giwhb.html>as
> well as many other pages I found on the internet.
> 
> Finally, the app starts, as I think I completed most steps necessary to
> migrate to CDI managed beans, but now it seems as though my beans are not
> accessible from facelets. As per
> MYFACES-3104<https://issues.apache.org/jira/browse/MYFACES-3104>,
> I am already using *JUEL 2.2.5* (that is working well with JSF Managed
> Beans in production), so I already had *
> org.apache.myfaces.EXPRESSION_FACTORY* set in web.xml, as well as
> *org.apache.myfaces.SUPPORT_JSP_AND_FACES_EL
> *to *false*, and the last thing I did was add the following to web.xml:
> 
>     <context-param>
>         
> <param-name>org.apache.myfaces.annotation.SCAN_PACKAGES</param-name>
>         <param-value>pf,jsf.users,jsf.orders</param-value>
>     </context-param>
> 
> Which are just a 'few' of the packages that contained beans referenced 
> by
> the initial page of the app (login.xhtml).
> 
> My questions:
> 
>    1. Can someone please advise me of blog/tutorials that list any/all
>    steps necessary to migrate MyFaces 2.1.9 / Glassfish 3.1.2.2 web app from
>    JSF Managed Beans to CDI?
>    2. I am not using MyFaces CODI or OpenWebBeans (yet). I've seen
>    OpenWebBeans recommended with MyFaces Core (2.1.7+) for performance
>    reasons, and in PrimeFaces forum, I've seen MyFaces Core and MyFaces CODI
>    used together by some people. If I should use MyFaces CODI or OpenWebBeans,
>    please reply with blog/tutorial/instruction URLs.
> 
> My next steps will probably be any/all of the following:
> 
>    1. Remove JUEL 2.2.5 from the project, and see if I can successfully get
>    my pages to render via CDI
>    2. Add MyFaces CODI (need to search for a good set of instructions on
>    how to do so)
>    3. Add OpenWebBeans (same as above, need good set of instructions)
> 
> Please confirm/advise. If you need any more details from me (for example,
> for me to reply with my web.xml), then please let me know.
> 
> Thanks,
> Howard
>

Reply via email to