9 Replies Latest reply on Apr 20, 2005 8:22 AM by jmorgalis

    Hibernate 3.0 and the 4.0.1 HARDeployer

    jmorgalis

      Currently, the distribution of JBoss AS 4.0.1 bundles hibernate2.jar with its jboss-hibernate.deployer component. If hibernate2.jar is replaced by hibernate3.jar, this still does not fully upgrade the HARDeployer because jboss-hibernate.jar still has hibernate2 classes within it. Is there a way to fix this so that hibernate3 will run in JBoss 4.0.1?

      Thanks.

        • 1. Re: Hibernate 3.0 and the 4.0.1 HARDeployer
          yuricake

          I am facing the same problem right now - has there been a solution yet? Thank you very much in advance!

          Yuri Niyazov

          • 2. Re: Hibernate 3.0 and the 4.0.1 HARDeployer
            jmorgalis

            I finally gave up and realized that that HARDeployer must be 2.x specific. So I just created a hibernate3 SAR and deleted the old har deployer from my install. Seems to work fine right now.

            • 3. Re: Hibernate 3.0 and the 4.0.1 HARDeployer
              yuricake

              Could you possibly post the SAR somewhere or email it to me? my address is

              yuricakespam-google@yahoo.com

              • 4. Re: Hibernate 3.0 and the 4.0.1 HARDeployer
                g_nagesh

                Even I am looking for sar file for Jboss4.0.1. Can you send it to g_nagesh@novell.com


                Regards
                Nagesh G

                • 5. Re: Hibernate 3.0 and the 4.0.1 HARDeployer
                  yuricake

                  For any future lurkers:

                  this is fairly easy to create.

                  Step 1: Download JBOSS 4 source code.

                  there's going to be a hibernate subdirectory which contains the source for the jboss-hibernate.jar file.

                  Step 2) open those sources in Java Project

                  Step 3) replace all net.sf.hibernate with org.hibernate references. You will get some "methods not implemented" errors because new interfaces have extra methods. Implement these methods, you can, for now, put in just a "return null" for all those methods. This could cause problems if you are using the TreeCache - I do not, so I don't really know what those methods have to do. Will have to wait from the JBoss/Hibernate folks to provide this.

                  Step 4) modify xml in same way: replace net.sf.hibernate with org.hibernate

                  Step 5) rebuild and deploy

                  • 6. Re: Hibernate 3.0 and the 4.0.1 HARDeployer
                    jmorgalis

                    That was my original fix, but IT DID NOT WORK. I had a jboss-hibernate.jar with the new package structure, but it was not sufficient, because it never picked up my HAR file. I do not know why. That is why I went with this SAR structure. I think that the HARDeployer is a 2.1-specific construct. That is only a guess at this point, but a re-packaged jboss-hibernate.jar did NOT pick up and deploy my original HAR file.

                    Hopefully you have more luck than I did.

                    • 7. Re: Hibernate 3.0 and the 4.0.1 HARDeployer

                      Could you possibly email SAR to me? my address is

                      efremov_andrei@mail.ru

                      • 8. Re: Hibernate 3.0 and the 4.0.1 HARDeployer
                        redwave

                        hi i am also using Hibernate3.0 with JBoss 4.0.1

                        i have created hibernate.har which has following:
                        1. hibernate-service.xml->META-INF
                        2. *.class and *.hbm.xml files which maintain the class hierarchy.
                        3. hibernate.cfg.xml and hibernate.properties

                        my hibernate-service.xml contains following:




                        jboss.har:service=HARDeployer
                        java:/MySqlDS
                        java:/HibernateFactory

                        org.hibernate.dialect.MySQLDialect

                        org.hibernate.cache.TreeCacheProvider
                        true



                        the error when i deploy my *.har file is

                        17:08:22,015 INFO [ServiceConfigurator] Problem configuring service jboss.har:service=Hibernate
                        org.jboss.deployment.DeploymentException: No Attribute found with name: TransactionManagerLookupStrategy
                        at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:263)
                        at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:164)
                        at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:118)
                        at org.jboss.system.ServiceController.install(ServiceController.java:200)
                        at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        at java.lang.reflect.Method.invoke(Method.java:324)
                        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
                        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                        at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
                        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
                        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
                        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
                        at $Proxy4.install(Unknown Source)
                        at org.jboss.deployment.SARDeployer.create(SARDeployer.java:208)
                        at org.jboss.deployment.MainDeployer.create(MainDeployer.java:918)
                        at org.jboss.deployment.MainDeployer.create(MainDeployer.java:910)
                        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:774)
                        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
                        at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        at java.lang.reflect.Method.invoke(Method.java:324)
                        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
                        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                        at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:122)
                        at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                        at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
                        at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
                        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
                        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
                        at $Proxy8.deploy(Unknown Source)
                        at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:305)
                        at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:481)
                        at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
                        at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:215)
                        at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:194)


                        if somebody can help me please send a reply to info@redtext.net.

                        • 9. Re: Hibernate 3.0 and the 4.0.1 HARDeployer
                          jmorgalis

                          I think your issue has to do with the fact that HAR deployment does not seem to work with Hibernate 3.0. Try taking that HAR and making it a SAR with a jboss-service rather than a hibernate-service.

                          It is unlikely, at least last I heard, that a backport of jboss4 to make hibernate3 work with the HARDeployer was going to happen. The SAR seems to work as a temporary measure until JBoss 5 comes out.