6 Replies Latest reply on Aug 9, 2008 8:29 PM by luxspes

    seam without hibernate is impossible?

    deanhiller2000

      I have been taking the registration example and trimmed it down so hibernate did not exist(though there was a @Stateless annotation for javax.ejb, but that was it from ejb).  Seam still seems to require hibernate????  I can't seem to drop it. 


      Here is the problem I am trying to solve...We have an api that serves to flash right now.  We want to reuse the same api and put seam on top of it(and perhaps later expose the api for an SOA-like B2B use).  But once I finally got all the jars up to date without the huge jboss embeddable, I started getting transaction commit exceptions.  What is seam committing?  I don't want it dealing with database transactions at all, nor do I want the huge memory footprint of jboss microkernel(and it takes so long to start up with that...much faster with just seam).  Seam requiring me to drag hibernate already increased memory by 10Meg.  Any ideas? 


      Let's say I do go back to the microkernel...why is seam commiting transactions and can it be stopped?  Also, is there way to only put microkernel in web app.  I MUCH prefer to have an installation manual that says install tomcat, drop the war in instead of install tomcat, install jboss microkernel, then drop war in for developers so when someone joins the team, it is very easy to setup like it was in the past for JSF.

        • 1. Re: seam without hibernate is impossible?

          Well if you do this, Hibernate it is pretty much deactivated, but you still will get this exception if you delete all hibernate jars:


          java.lang.RuntimeException: Could not create Component: org.jboss.seam.core.validators
               at org.jboss.seam.init.Initialization.addComponent(Initialization.java:989)
               at org.jboss.seam.init.Initialization.installComponents(Initialization.java:911)
               at org.jboss.seam.init.Initialization.init(Initialization.java:589)
               at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
               at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
               at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
               at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
               at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
               at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
               at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
               at org.apache.catalina.core.StandardService.start(StandardService.java:516)
               at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
               at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
               at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
          Caused by: java.lang.NoClassDefFoundError: org/hibernate/validator/ClassValidator
               at java.lang.Class.getDeclaredMethods0(Native Method)
               at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
               at java.lang.Class.privateGetPublicMethods(Class.java:2519)
               at java.lang.Class.getMethods(Class.java:1406)
               at org.jboss.seam.Component.hasAnnotation(Component.java:1070)
               at org.jboss.seam.Component.<init>(Component.java:229)
               at org.jboss.seam.Component.<init>(Component.java:217)
               at org.jboss.seam.init.Initialization.addComponent(Initialization.java:974)
               ... 18 more
          

          • 2. Re: seam without hibernate is impossible?

            It seems the Seam component org.jboss.seam.core.validators points to the classorg.jboss.seam.core.Validators...


            Mmmm... I think this class should implement and interface, so that it could be possible to replace it with one that doesn't use org.hibernate.validator.ClassValidator I guess with that we could say that Seam can be used in a 100% free of Hibernate way (Let me say that I love Hibernate, but sometimes, for really simple projects, or for projects full of interactions with stored procedures , it might be overkill or innapropiate).

            • 3. Re: seam without hibernate is impossible?

              Yes, copied back in to WEB-INF\lib the file hibernate-validator.jar and now it working, 99% without hibernate.

              • 4. Re: seam without hibernate is impossible?

                IMHO, hibernate validator is supposed to work with other JPA providers. I don't think it's really a roadblock here.

                • 5. Re: seam without hibernate is impossible?
                  pmuir

                  Yeah, HV should work with any JPA, however last I checked it hard a hard dependency on Hibernate Core (raise that on the Hibernate forum for Hardy to look at).


                  I'm happy to remove the hard dependency in Seam, please file a JIRA issue.

                  • 6. Re: seam without hibernate is impossible?

                    Pete Muir wrote on Aug 09, 2008 19:49:


                    I'm happy to remove the hard dependency in Seam, please file a JIRA issue.


                    Here it is: JBSEAM-3247