10 Replies Latest reply on Oct 4, 2011 3:44 PM by slominskir

    Seam 3 production ready?

    slominskir

      I'm trying to get Seam Faces 3.0.2-Final integrated into my project just so I can use ViewScope with CDI.  I added the seam dependency to my POM and immediately ran into issues:


      1. ClassNotFoundException - I had to add a dependency in my POM for joda-time to get around this.


      2. AmbiguousResolutionException - I guess this is because many of my JSF converters extend from an abstract class named EntityConverter that I created and a few of the converters convert the same entity, just in different situations.  I added some bogus qualifiers and marked all converters as RequestScoped to get rid of this exception.  Note: I'm not actually using dependency injection in my converters (just using manual JSF MBF injection as before) so this requirement imposed by Seam to muck around with my converters is aggravating.


      3. Now I'm getting warnings about Using JSF provided instance, unable to find a BeamManaged instance related to my converters. What do I need to do to satisfy this now?  I'm temped to remove inheritance altogether in my converters and try using composition instead, but that is going to be more pain.


      I had evaluated Seam 3 about this time last year and concluded that it wasn't production worthy.  I'm starting to get the feeling it still isn't.

        • 1. Re: Seam 3 production ready?
          oranheim

          It would make it easier to comment on your issues/questions/statements if you provided deps and code.


          Not sure how you manage you Converter class. Can you provide an example here?


          In case you wonder whether it's production ready, the answer is clearly yes. My company's solution run Seam 3 in production: http://www.musific.com.


          We're using mostly every Seam 3.x module on JBoss 7.0.2 and runs like a charm.

          • 2. Re: Seam 3 production ready?
            bleathem

            1. ClassNotFoundException

            Sounds like it could be the OverzealousClassScanner problem.  What container are you running on?



            2. AmbiguousResolutionException

            This is a CDI/Weld exception.  Raise an issue with weld if you have a complex class hierarchy that it isn't co-operating with well.  Or use Solder's @Veto annotation to exclude your converter classes from being scanned.



            3. Using JSF provided instance, unable to find a BeamManaged instance

            It's just a warning.  If you think the warning is too verbose, please open a jira issue, and we'll adjust it.  Alternatively you can use the @Veto annotation I described in 2.

            • 3. Re: Seam 3 production ready?
              slominskir

              I'm running in GlassFish 3.1.1 so I guess I'm running into the known issue you mentioned with respect to the ClassNotFoundException.  I hope it is resolved soon since it doesn't inspire confidence. 


              For the converter issues; My converter class hierarchy:


              abstract class EntityConverter implements Converter


              class MyEntityAConverter extends EntityConverter


              class MyEntityBConveter extends EntityConverter


              class MyEntityCConverter extends MyEntityBConverter (problem)


              The Veto annotation isn't getting rid of the warning messages.  However, if I make MyEntityCConverter extend EntityConverter (and copy and paste inherited stuff from MyEntityBConverter), and remove the bogus qualifiers I threw in, then the warnings go away.

              • 4. Re: Seam 3 production ready?
                slominskir

                I was able to avoid the warning message for my entity converters by flattening out the hierarchy a bit.  However, I'm not able to get around the warnings with respect to my enumeration converters.  


                I've got a few enumerations defined in my project that are used as JSF view parameters so they appear in the page URL among other places like select boxes.  In order to keep with best practices I want the enum values all uppercase in the code and all lowercase in the URL.  Therefore I define an abstract LowercaseEnumConverter which extends EnumConverter.  I've then got concrete instances for each of my URL-bound enums. 


                I'll get an AmbiguousResolutionException if I keep the converters as is.  To avoid this I can either (1) create a bunch of bogus qualifiers or (2) Mark the converters with the Veto annotation.  In either case though I will get the Using JSF provided instance warning.  I use the enums all over the place so my log is littered with warning messages .  I guess I could try to set the logging level for Seam to Error to avoid getting warnings, but that isn't ideal.


                To be fair, the converters seem to work regardless of the warning, but I really don't like having a ton of clutter in the log and warnings make me uneasy.

                • 5. Re: Seam 3 production ready?
                  clerum
                  • 6. Re: Seam 3 production ready?
                    slominskir

                    I guess I'll just set the logging level to hide the message for now (org.jboss.seam.faces.environment.SeamApplicationWrapper.level=SEVERE). 


                    I still wonder if the message is just nonsensical or if I really didn't setup/annotate my beans correctly such that the bean manager can find them in my inheritance hierarchy.

                    • 7. Re: Seam 3 production ready?
                      hantsy

                      Ove Ranheim wrote on Sep 27, 2011 17:44:


                      It would make it easier to comment on your issues/questions/statements if you provided deps and code.

                      Not sure how you manage you Converter class. Can you provide an example here?

                      In case you wonder whether it's production ready, the answer is clearly yes. My company's solution run Seam 3 in production: http://www.musific.com.

                      We're using mostly every Seam 3.x module on JBoss 7.0.2 and runs like a charm.



                      This website looks good.
                      There is a multicheckbox in the regiterar page.
                      I encounterd an exception when saveing data in my application.


                      HowToAvoidLazyInitializationExceptionInFaceletsPage


                      Can u help me?

                      • 8. Re: Seam 3 production ready?
                        slominskir

                        I just discovered another problem while trying to integrate Seam Faces into my app.  I have a postValidate component system event nested in my datatable's last column component used for multi-component validation.  The event listener gets applied to each row of the datatable; each of my rows has mutually exclusive values and the PrimeFaces datatable is row-at-a-time editable.  I use the f:event tag to declare the listener.  This all worked fine until I added Seam Faces; now the listener isn't called.  Any ideas on how to handle this?  It seems like it might be easier to simply not use Seam or CDI!

                        • 9. Re: Seam 3 production ready?
                          bleathem

                          Can you post the relevant facelet and listener code?

                          • 10. Re: Seam 3 production ready?
                            slominskir

                            Figured it out.  Actually the problem was unrelated to Seam Faces.  In certain scenarios some of the columns are not rendered and if the column with the f:event on it is one of the missing columns then the multi-component validation won't get triggered. D'oh.  Sorry for the false alarm.