9 Replies Latest reply on Jul 9, 2007 3:43 PM by przemjaskier

    Dropping clean MC support was a Bad Thing :(

      Hi!

      After struggling with 1.3->2.0 migration for couple of days (no success) I want
      to share my objections on last Seam changes. I admire Seam team work and am working with the bleeding edge versions of Seam since a long long time.
      Forgive me if I'm sounding a little bit harsh and disappointed, but I am recently frustrated by the changes I see.

      Env: Apache 6.0.13.

      Having MC support I could:
      1. Create my own, custom Microcontainer bootstrap class, feeding it with hand-picked, programmatically-defined xml bean descriptors, creating two separate flavours "test" and "production". It could be simply bootstrapped no matter of environment, servler container or not. Small, robust, elegant.
      2. Can run advanced test harness without relying on deployers magic, totally out of a servlet container.
      3. Microcontainer was a small, almost-clean jar, and it's classpath dependencies were rational and manageable.
      4. You can have best-of-breed integration of JBoss managed datasource, JTA etc. with clean, well-grained configuration.

      Now, the Embedded approach.. geez...

      1. You got a 13 MB ball with a chain - is you look into it's contents it looks like a pure mess... What is the idea of having such "all" tarBALL with some magic and esoteric versions of half of the javax.* APIs dropped into it. Come on, it's Maven time now...
      2. Even if I know that there is an old-good MC beneath all these things, it has been obscured by a mass of deployment descriptors and redundant dependencies.
      3. JBossE is in beta stage, almost undecummented(???) and all optimization
      hinst provided here http://www.jboss.com/index.html?module=bb&op=viewtopic&t=111734
      are nothing comparing to the ability to selectively spawn selected services as it was possible in Seam 1.x.
      It's not the case of blubbering about "lightweightness" of anything... It's about creating clean, robust and manageable development/production platform with Seam.

      With MC I could have simple, small, manageable JTA environment for Seam, and was thinking about migrating to JBoss AS someday, when the phase of rapid development of my application ends...
      I would prefer my previous MC-driven setup, even trying (with no success) to get Spring-bound Postgres DS + Spring-bound Hibernate SessionFactory to work with Seam 2.0 like posted here:
      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=112972

      I've invested in my project a lot of time and hoped for a stable Seam environment for a long-running development process... Now I'm a little bit confused :(.

      Best regards,
      Przemek.

        • 1. Re: Dropping clean MC support was a Bad Thing :(
          jcruise

          +1

          Not to mention that I now have 50sec start times instead of 17sec start times since the move to embedded from mc.

          FYI the upgrade for me involved:

          upgrading to tomcat 6.
          upgrading to jboss embedded.
          downgrading to Java 1.5 (for bug in Jboss embedded)
          upgrading to eclipse 3.3 (for tomcat 6 support)
          upgrading from Exadel Studio Pro to Jboss Tools (for eclipse 3.3 support).
          applying the documented migration changes
          working out the rest of the neccessary changes.

          All in all a fairly nervewracking 4 days. And not really happy with the move to Jboss embedded.

          The JPA/Seam/Tomcat config that I had in 1.2.1GA was a sweet spot that I am disappointed to find unavailable right now.

          As an aside, I would really like to see some momentum building around more supportive documentation. What we have right now is really good for those people who are prepared to immerse themselves deep into the Seam culture. You can currently get by with Seam if you arm yourself with the source, the examples, the forum and the docs, and keep on top of all of those things on a regular basis. This is kind of OK, when the product is really, really new.

          But as we head into V2 it would be good to see some nice comprehensive tutorials that reveal the Seam-magic in an easily digestible way. I think that the Seam story is great, but it is currently told in a very terse and difficult to absorb way and leaves a lot of "discovery learning" for the developer.

          Cheers
          J

          • 2. Re: Dropping clean MC support was a Bad Thing :(
            christian.bauer

            Ahem, you realize that what ships with Seam are _examples_. You can take the examples and make them run on pure JBoss MC again, e.g. the Hibernate-without-EJB example.

            Most other users don't care that much about it, because they use a Java EE application server (the easiest option) and the embeddable container only for testing.

            • 3. Re: Dropping clean MC support was a Bad Thing :(

              Christian,

              "org.seam.microcontainer" package has been removed from Seam codebase, taking out a way to bootstrap Jboss Managed Connection Pool and JTA Transaction Manager as described in Seam 1.3. docs. I don't know JBoss Embedded internals at all, if I'm missing something, please elaborate.
              In general an interesting thing would be to have working example of such architecture:
              a. PostgresDS, PooledDS wired by Spring +
              b. HibernateSessionFactory wired by Spring (currently there is no way in Seam to specify custom naming strategy or easy, pluggable, create-drop/create switching) +
              c. Seam managed Session.

              I cannot achieve this with Seam's Spring integration as described in my cited post (http://www.jboss.com/index.html?module=bb&op=viewtopic&t=112972)

              Like I said before I'm a big fan of your work on this project and I perceive this whole decision as a one that can reduce integration of Seam... If there would be an easy Spring+Seam+Hibernate integration guide/example
              that would definitely help. Yes, I'm aware of Spring chapter in Seam Ref :).


              JCruise,
              you can follow http://wiki.jboss.org/wiki/Wiki.jsp?page=EmbeddedOptimizations to reduce bootstrap time if it's your major concern.

              • 4. Re: Dropping clean MC support was a Bad Thing :(
                jcruise

                Przemek.

                Thanks for the ref. That shaved off about 10secs. Which is good.

                Cheers
                J

                • 5. Re: Dropping clean MC support was a Bad Thing :(
                  christian.bauer

                  Well, you could just add this single component from Seam 1.3 to your Seam 2.0 application and it would boot the microcontainer just like before, no? It's not tied to the Seam version, it's just a regular component.

                  • 6. Re: Dropping clean MC support was a Bad Thing :(
                    christian.bauer

                    Note that I don't find your proposed architecture very interesting or appealing. You basically want to run _three_ containers that bootstrap each other (JBoss MC, Spring, Seam).

                    • 7. Re: Dropping clean MC support was a Bad Thing :(

                      Christian,

                      I'm aware that these are standalone, simple POJOs. Making them into my custom build can solve my problem for now, but like you see I've already made some things in a different way and I'm bitting my nails next day in a row now. I simply don't want to spend another few days when I hit another landmine because of a custom Seam build...

                      Talking about my architecture. Your a little bit sarcastic (:P) summary of it can just simply comment the current state of Java frameworks. I guarantee that I would prefer a monolithic solution, but every one of this containers adds some value to my (rather big) application. To be honest, MC is in the mix just because I like Seam soooo much and want to develop with it... \

                      But guess something? My dev flavour boots in FEW (<10) seconds and it can be tested one-after-another maven submodule without any managed environment that is not necessary. Clean and manageable, believe me :)

                      Don't you think that using Spring-managed SessionFactory to create Seam-managed Session should be trivial? Just gimme/help me to get that opportunity. I really really like your project :)

                      Best regards,
                      Przemek.

                      • 8. Re: Dropping clean MC support was a Bad Thing :(
                        christian.bauer

                        You call three containers "without any managed environment"? :) What I also don't understand: If you disable JMS and EJB in Embeddable JBoss, it is effectively the same as a pure JBoss MC (JTA, JNDI). Why is that not sufficient?

                        (Yes, I know that Embeddable JBoss requires a whole bunch of configuration files that never change - some of them can be packaged in a JAR to make things simpler, for the rest complain to Bill Burke.)

                        • 9. Re: Dropping clean MC support was a Bad Thing :(


                          I want to share, in case that someone is googling for a solution here:

                          I managed to create this configuration:
                          DataSource bound by Spring, HibernateSessionFactory bound by Spring, Seam-managed Session by creating a Seam delegate component "sessionFactoryDelegate" that wraps Spring-bound SessionFactory and serve it via EL, like this:

                          <persistence:managed-hibernate-session name="pecpSeamManagedHibernateSession" auto-create="true"
                          session-factory="#{sessionFactoryDelegate.sessionFactory}"/>

                          I would prefer another solution but current Spring integration apparently does not allow me to to this (is broken?) - see comments on http://www.jboss.com/index.html?module=bb&op=viewtopic&t=112972)