1 2 Previous Next 20 Replies Latest reply on Nov 13, 2009 5:45 PM by andygibson.contact.andygibson.net Go to original post
      • 15. Re: ConversationScope not working
        andygibson.contact.andygibson.net

        Ok chaps, first off, sorry for the delay, I was off for veterans day.


        I changed the EL expression for the conversation and the conversation info now appears in my page. I changed the logic of isTransient() so it does start a long running conversation and isTransient now changes as expected when I call conversation.start(). So, with those small changes those minor issues are cleared up.


        Since I can now see the conversation on the page, it looks like the conversation isn't propagated from one page to the next in Glassfish. Each page has its own new conversation instance regardless of whether a conversation is started or not (I am using a commandbutton and therefore a JSF post).


        I took the number guess example and added the conversational code suggested by Nicklas. It too fails in Glassfish in the same way, even with a long running conversation, each page refresh gets a new conversation instance. I took the exact same WAR file (as per the reference guide instructions), deployed it on JBoss 5.20 Beta and it works fine. Once you make the conversation long running, you get the same conversation instance each page refresh.


        Since it looks like it isn't deploying on glassfish properly, I can go file an issue with the Glassfish folks, I just want to make sure that I'm not missing something. I am assuming all weld related view handlers and listeners and application factories etc.. are automatically installed when deployed to glassfish and I don't need additional config that JBoss deployers automatically take care of?


        Cheers,


        Andy



        • 16. Re: ConversationScope not working
          andygibson.contact.andygibson.net

          Additional Fun Facts


          I was playing around looking at the JBoss Weld Deployer and poked around the faces-config it uses with the WeldApplicationFactory, the WeldPhaseListener and the ConversationAwareViewHandler. I decided to try adding that into my own faces-config to see if that was the missing link.


          No surprise it didn't like the WeldApplicationFactory since that is only in the jboss integration jar file. However, the Weld phase listener  and view handler are both in the weld-osgi bundle I am using (with the correct path) but when I deploy my app with just those two items in the faces config, I get class not found errors, even though they are in the deployed osgi bundle.


          I looked around some more, and it seems like glassfish does have its own weld app factory org.glassfish.weld.jsf.WeldApplicationFactory and it has a faces-config file like the jboss deployer specifying the phase listener and the application factory. It does not however have an entry for the conversation aware view handler. I guess it could be added elsewhere but that might be the crux of the problem.


          Cheers,


          Andy




          • 17. Re: ConversationScope not working
            gavin.king

            Thanks for your work on this, Andy.

            • 18. Re: ConversationScope not working
              andygibson.contact.andygibson.net

              No problem, not much compared to the work done on Weld / JSR 299!


              I registered the issue with the glassfish project and included the modified number guess war file for them to test here.


              Cheers,


              Andy


              • 19. Re: ConversationScope not working
                pmuir

                This was a mix of issues, someone forgot to document the view handler was required, so Roger missed it from the OSGi bundle and GF integration...

                • 20. Re: ConversationScope not working
                  andygibson.contact.andygibson.net

                  Yes, Roger emailed me a new osgi bundle and integration jar and it works fine now and should be in the next build.


                  Cheers,


                  Andy

                  1 2 Previous Next