1 2 3 4 5 Previous Next 61 Replies Latest reply on May 28, 2007 1:36 PM by carlos.abreu Go to original post
      • 30. Re: JAAS and SEAM
        mirko27

        Btw lcotzee. You do not need this dummy call to your templates. That is a question of logic.
        Because you do not need user entity bean before you really use it, you needn`t put it into session scope...
        Anyway got it working quite good.

        • 31. Re: JAAS and SEAM
          mirko27

          Btw I use Stateless FactoryBean because the thing happens only once.(pulling entity bean)

          • 32. Re: JAAS and SEAM
            lcoetzee

            Excellent. Glad that it works.

            Louis

            • 33. Re: JAAS and SEAM

              Hi Louis,

              Great to hear it's going well for you, especially considering the scale/nature of your project. I've spent a couple of weeks delving into various aspects of Seam, and am planning to move forward with pretty much the same stack you're using. I've 100,000 users to support initially, but this is set to grow quickly.

              I've a couple of questions for you, if you can help. Is the content management subsystem part of what you've developed in-house, or something external? I've got to tackle it at some stage & am casting my eye around. Also, did you find many corner cases needing manual API usage for Seam?

              I'm also watching the JIRA bug you mentioned. I can foresee many stale conversations building up over time for my project - and attempts to re-enter conversations too.

              Anyway, good to hear about your project. Best of luck with it

              Simon

              • 34. Re: JAAS and SEAM
                lcoetzee

                Hi,

                I've 100,000 users to support initially

                We would love to have so many users! If we get 1000 initially we would regard it as a success (mostly due to the target demographic and other cultural issues).


                Is the content management subsystem part of what you've developed in-house, or something external?


                The CMS system is the first main deliverable for the NAP project. We developed it in-house because of the need that it must be completely accessible (so a lot of focus was put on the interface making it usable and accessible for people using assistive device technologies). In addition it also had to support our very diverse multi-cultural society (e.g. 11 languages).

                Also, did you find many corner cases needing manual API usage for Seam?

                If I understand you correctly you are asking if I had to jump out of the Seam stack to do things which might not be possible with Seam ? No. Gavin and team have done really well. Those things that came up which we weren't able to do was added to Seam in due course (as part of the natural progression and development of Seam from Beta 1 to Beta 2).


                I'm also watching the JIRA bug you mentioned. I can foresee many stale conversations building up over time for my project - and attempts to re-enter conversations too.

                I have found a way to kill the existing conversation when entering a specific page (e.g. by clicking on a left-hand navigation menu). I only saw it this morning, but I think Gavin added it some time ago (don't know if it is really meant to be used in this way, but seems to do the trick with the way my action methods start conversations).

                Make use of the pages.xml functionality and the #{conversation.end} action. Thus when the page is accessed the conversation is ended before the @Begin annotation on my method in my ActionBean is invoked. In essence killing the existing conversation, then starting a new one. I plan to test this a bit more though !

                <pages>
                 <page view-id="/secure/structure/management/service/services.xhtml" action="#{conversation.end}"/>
                 <page view-id="/secure/structure/management/topic/servicesTopicManagement.xhtml" action="#{conversation.end}"/>
                 <page view-id="/secure/structure/management/grouping/servicesGroupingManagement.xhtml" action="#{conversation.end}"/>
                 <page view-id="/secure/content/approval/servicesList.xhtml" action="#{conversation.end}"/>
                 <page view-id="/secure/discussion/management/forum/forums.xhtml" action="#{conversation.end}"/>
                 <page view-id="/secure/structure/management/adminHome.xhtml" action="#{conversation.end}"/>
                
                </pages>


                Thanks for the good wishes. Regards

                Louis


                • 35. Re: JAAS and SEAM

                  With regards to API use, I meant manual Seam context & component management.
                  I'm using it in a few places where I'm trying out finer control over the components created & their outjection
                  (usually from upstream actions)

                  Your pages.xml use does look interesting, & that's a good tip.
                  I'm guessing that actions on pages.xml came in for the RESTful blog example (a great example addition I think).
                  Thanks for the info!

                  • 36. Re: JAAS and SEAM
                    lcoetzee

                     

                    I meant manual Seam context & component management
                    Aah ;-) Very seldom actually. The only place where I really had to do manual stuff was in a JSF phaselistener where I wanted to see if the guy was already logged in (so I actually checked for the existence of the valid info in the portalUser).

                    L


                    • 37. Re: JAAS and SEAM
                      lcoetzee

                      Just an update on the usage of pages.xml and conversation.end .... I have removed it again, seems that it did not do as I wished it would.

                      Regards

                      L

                      • 38. Re: JAAS and SEAM
                        gavin.king

                         

                        "lcoetzee" wrote:
                        Just an update on the usage of pages.xml and conversation.end .... I have removed it again, seems that it did not do as I wished it would.


                        What was the problem?

                        • 39. Re: JAAS and SEAM
                          lcoetzee

                          When the conversations was just joined things worked. However, with the pages.xml conversation.end things got a bit confusing. Using a @Factory with an @Begin to start the new conversation, later on (a few methods calls down in the same conversation and same stateful bean) I get this:

                          org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: csir.structure.par.CMSTopic.groupings, no session or session was closed


                          Which doesn't make sense at all, as the CMSTopic (extended from Topic) gets loaded in this stateful bean (and in this conversation), even though I use another bean to actually do the retrieving of the Topic. (When I remove the pages.xml no problem).

                          Has me completely stumped.

                          L



                          • 40. Re: JAAS and SEAM
                            lcoetzee

                            I also doubt if the conversation has really ended. If I click a link specified in my pages.xml (with the conversation.end) (with a running conversation), (and if the action I am going to is annotated only with an @Begin and the @Factory) I get the following exception:

                            Caused by: javax.faces.el.EvaluationException: /WEB-INF/tags/adminLeftNavigation.xhtml @34,28 action="#{groupingManagementBean.loadAllServices}": javax.ejb.EJBTransactionRolledbackException: java.lang.IllegalStateException: begin method invoked from a long running conversation, try using @Begin(join=true)
                             at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
                             at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
                             ... 35 more
                            


                            L

                            • 41. Re: JAAS and SEAM
                              mirko27

                              Dear Louis,

                              if this exception is the only problem then please turn your code back. This exception is caused by a very common shortcome of hibernate. Portaluser roles does not get initialized when portaluser is initiliazed. You should do smth. like creating portaluser and after that calling user.roles.size(); or smth, which initializes the list.
                              I still think that Seam`s documentation is very poor. Are there any improvements going on?
                              And does community need more tutorial type of things? I`m creating a Hardware-shop management/front-end with seam+facelets+jaas and day-by-day it seems to get more working:P
                              So if you need help with documentation, please do not hestitate to contant me.

                              • 42. Re: JAAS and SEAM
                                gavin.king

                                Of course, we can use the the help we can get.

                                Example application are *always* useful, especially if they come with a tutorial explaining how they work and what they do.

                                Note that I spent all week updating the booking example.

                                • 43. Re: JAAS and SEAM
                                  mirko27

                                  gavin, is there any way to talk with you more real-time? I would start with tutorial then, but I have few questions.

                                  • 44. Re: JAAS and SEAM
                                    gavin.king

                                     

                                    "lcoetzee" wrote:
                                    I also doubt if the conversation has really ended.


                                    Converation.end() will make the current long-running conversation into a temporary conversation and destroy the conversation context at the end of the request.