1 2 3 Previous Next 42 Replies Latest reply on May 30, 2006 3:13 PM by gavin.king

    JSF 1.2 / Seam

    rogerk

      Hello.

      I've been tryin got get Seam to run in a JSF 1.2/JSP 2.1/Servlet 2.5 container (glassfish).
      Specifically, I am trying to get the Seam booking exampe to run, but I am running into the following problems:

      1. the SeamVariableResolver is not getting called - it is my understanding that with Seam beta2 you do not have to specify the SeamVariableResolver.

      2. To get by the first problem, I added the SeamVariableResolver in my faces-config.xml.
      The SeamVariableResolver cannot resolve the name "user" (which is supposed to be the name of the entity bean User.java). After some debugging, the SeamVariableReoslver.resolveVariable method is called, but that entity bean does not exist in any of the Seam contexts. It appears that none of the entity beans are getting loaded at initialization time.

      Any ideas on this one? Is there a workaround to this problem?

      Thanks, Roger

        • 1. Re: JSF 1.2 / Seam
          gavin.king

          Jacob talked to me about this problem, apparently it is due to some change in JSF 1.2. I'm not sure if there is a JIRA issue for this, but it is something we need to resolve, so please add one if it is not already there.

          Thanks,
          Gavin

          • 2. Re: JSF 1.2 / Seam
            • 3. Re: JSF 1.2 / Seam
              rogerk

              Yes. JSF 1.2 has the restriction of not setting up a VariableReslver *after* the Application has been initialized. However, even after removing this restriction, I am noticing that
              the Entity Beans (such as User) for the Booking application are not being loaded.
              So when I get to the first page and click on "register new user" link,
              I get a stacktrace about "user" in the EL expression not being found.

              I can run the same Booking app in Tomcaqt 5.5 and I see the Entity beans getting loaded.

              Any ideas?

              Thanks, in advance, Roger.

              • 4. Re: JSF 1.2 / Seam

                Hi Roger,

                I get the same problem, and have updated JIRA with some investigation info.

                • 5. Re: JSF 1.2 / Seam
                  gavin.king

                  Thanks folks, I will take a look. I knew about the first problem. The second problem sounds a bit suspicious and sounds more like you guys have some classpathing problems or something. Are you sure you have changed *nothing else* in your deployment?

                  • 6. Re: JSF 1.2 / Seam
                    gavin.king

                    OK, one comment I have is that you are trying to deploy JSF in the war, which I suspect might cause some problems. It would be better to actually upgrade the JSF libs in the JBoss server/default/deploy/jbossweb-tomcat55.sar/jsf-libs directory.

                    • 7. Re: JSF 1.2 / Seam
                      rogerk

                      Hi folks -

                      Are you guys taking about running with the JBoss application server?
                      Is there a JBoss application server that supports JSF 1.2?

                      My problem is with Glassfish.

                      -roger

                      • 8. Re: JSF 1.2 / Seam
                        gavin.king

                        The JIRA issue says JBoss.

                        • 9. Re: JSF 1.2 / Seam
                          gavin.king

                          So, I did the following:

                          (1) Fixed Seam to be compliant to the changes in JSF 1.2 (use jboss-seam.jar/META-INF/faces-config.xml to set up the nav handler, var resolver, etc). This is working fine.

                          (2) Installed the JSF 1.2 RI in JBoss. This also seems to be working fine.

                          When running the booking demo, I get the following error:

                          WARNING: /home.xhtml @21,82 value="#{user.username}": Target Unreachable, identifier 'user' resolved to null
                          javax.el.PropertyNotFoundException: /home.xhtml @21,82 value="#{user.username}": Target Unreachable, identifier 'user' resolved to null
                           at com.sun.facelets.el.TagValueExpression.getType(TagValueExpression.java:62)
                           at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:110)
                          


                          The funny thing is, I can debug and see the SeamVariableResolver being called and returning a non-null user (with all null property values).

                          • 10. Re: JSF 1.2 / Seam
                            gavin.king

                            I notice that a lot has changed in this version of the JSF spec. (VariableResolver is deprecated, and replaced with ELResolver, apparently.) I wonder if they have broken backward compatibility here too....?

                            • 11. Re: JSF 1.2 / Seam

                              ah, i think i know what hte problem might be-- if you see the seamvariableresovler returning a non-null user, then maybe the ELContext.setPropertyResolved() is not being set by the RI's wrappers?

                              • 12. Re: JSF 1.2 / Seam
                                gavin.king

                                So yes, the story is that this was a bug in the JSF RI jars I was using (the ones attached to that JIRA issue), and that upgrading to a more recent build provided by Jacob fixed the problem.

                                I now have the booking demo running against the JSF 1.2 RI in JBoss.

                                • 13. Re: JSF 1.2 / Seam
                                  gavin.king

                                  So, FWIW, this issue is now solved. Roger, let us know how you go getting Seam working in GlassFish. Thanks.

                                  • 14. Re: JSF 1.2 / Seam

                                    Thanks! I did try updating jsf-libs initially, but had the same issue as I recall.
                                    Is this a nightly JSF 1.2 build you're using? I'll give it a try. Else, can you let me know where to get it?

                                    1 2 3 Previous Next