3 Replies Latest reply on Dec 1, 2003 8:10 PM by vijpan

    Hibernate Service depends on DataSource

    vijpan

      Hi,

      When i am trying to have the hibernate run as a service , its not getting deployed as it depends upon the datasource.
      Hibernate as a service deploys fine if i simple paste the *.sar (hibernate service file ) after starting the jboss (as the datasource is already deployed now).I have made use of the depends "jboss.jca:service=RARDeployer jboss.jca:service=LocalTxCM,name=test
      "
      but its not working?

      Please let me know where i am going wrong

      Thanks

        • 1. Re: Hibernate Service depends on DataSource

          http://localhost:8080/jmx-console
          will show the correct name for your data source's connection
          manager.

          Posting the excetion would get you more answers.

          Regards,
          Adrian

          • 2. Re: Hibernate Service depends on DataSource
            vijpan

            Thanks Adrian for the reply.

            I did checked in the jmx-console view and this is what in there for the datasource "test"
            ---------------------------------------------
            name=test,service=LocalTxCM
            name=test,service=ManagedConnectionFactory
            name=test,service=ManagedConnectionPool
            --------------------------------------------------
            This is the exception whicm i am getting while deploying the "hibernate-services.sar" file which has a depends clause for the above datasource "test", i dont know where i am going wrong.
            Exception is --
            -------------------------------------------------------
            20:35:37,939 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.2.2/server/default/deploy/hibernate-s
            ervices.sar
            20:35:38,129 WARN [NestedThrowable] Duplicate throwable nesting of same base type: class org.jboss.deployment.Deploymen
            tException is assignable from: class org.jboss.deployment.DeploymentException
            20:35:38,129 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-3.2.2/server/default/deploy/hibernate-serv
            ices.sar
            org.jboss.deployment.DeploymentException: create operation failed for package file:/C:/jboss-3.2.2/server/default/deploy
            /hibernate-services.sar; - nested throwable: (org.jboss.deployment.DeploymentException: - nested throwable: (java.lang.r
            eflect.UndeclaredThrowableException))
            at org.jboss.deployment.SARDeployer.create(SARDeployer.java:202)
            at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
            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:324)
            at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
            at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
            at $Proxy6.deploy(Unknown Source)
            at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
            at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:476)
            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:20
            1)
            at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:274)
            at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
            at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
            at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
            at $Proxy0.start(Unknown Source)
            at org.jboss.system.ServiceController.start(ServiceController.java:394)
            at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
            at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
            at $Proxy4.start(Unknown Source)
            at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
            at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:589)
            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:324)
            at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
            at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
            at $Proxy5.deploy(Unknown Source)
            at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:384)
            at org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)
            at org.jboss.Main.boot(Main.java:150)
            at org.jboss.Main$1.run(Main.java:395)
            at java.lang.Thread.run(Thread.java:534)
            Caused by: org.jboss.deployment.DeploymentException: - nested throwable: (java.lang.reflect.UndeclaredThrowableException
            )
            at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:143)
            at org.jboss.system.ServiceController.install(ServiceController.java:225)
            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:324)
            at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
            at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
            at $Proxy4.install(Unknown Source)
            at org.jboss.deployment.SARDeployer.create(SARDeployer.java:183)
            ... 49 more
            Caused by: java.lang.reflect.UndeclaredThrowableException
            at org.jboss.system.ServiceCreator.install(ServiceCreator.java:181)
            at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:155)
            at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:118)
            ... 59 more
            Caused by: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
            at net.sf.hibernate.jmx.HibernateService.(HibernateService.java:30)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
            at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:847)
            at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:291)
            at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:318)
            at org.jboss.system.ServiceCreator.install(ServiceCreator.java:98)
            ... 61 more
            ------------------------------------------------------------
            And this is the message that "test" datasource is deployed succesfully and this is done after the error is thrown while starting the JBOSS

            --------------------
            20:36:00,431 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.2.2/server/default/deploy/test-ds.xml
            20:36:00,912 INFO [RARDeployment] Started jboss.jca:service=ManagedConnectionFactory,name=DB2DS
            20:36:00,932 INFO [JBossManagedConnectionPool] Started jboss.jca:service=ManagedConnectionPool,name=test
            20:36:01,002 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.2.2/server/default/deploy/test-ds.xml
            ------------------------------------

            Also i am pasting here the "jboss-service.xml" file which is included in the META-INF folder of the hibernate-services.sar file which i am trying to deploy.

            ----------------------------------------


            jboss.jca:service=RARDeployerjboss.jca:service=LocalTxCM,name=test
            hib/Persons.hbm.xml
            java:/hibernate/HibernateFactory
            java:/test
            net.sf.hibernate.dialect.DB2Dialect
            true
            false
            java:/UserTransaction



            ---------------------------------------------------

            Thanks for the help.
            Please throw some light where i am going wrong.






            • 3. Re: Hibernate Service depends on DataSource
              vijpan

              Sorry for putting a part of the message incorrect
              ----------------
              And this is the message that "test" datasource is deployed succesfully and this is done after the error is thrown while starting the JBOSS

              --------------------
              20:36:00,431 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.2.2/server/default/deploy/test-ds.xml
              20:36:00,912 INFO [RARDeployment] Started jboss.jca:service=ManagedConnectionFactory,name=test
              20:36:00,932 INFO [JBossManagedConnectionPool] Started jboss.jca:service=ManagedConnectionPool,name=test
              20:36:01,002 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.2.2/server/default/deploy/test-ds.xml
              ------------------------------------
              This is what its in there "instead of DB2DS its test"

              Thanks in advance!!