3 Replies Latest reply on Jan 27, 2003 4:53 PM by adrian.brock

    Custom MBean Dependency

    nvenk

      Hi:

      Can someone tell me how to best ensure that my custom mbean gets started the last (so that all services are available to it) ?

      Essentially, the custom MBean shall be used to reconstruct the last application state on a server restart. The state is rebuilt from persistent data.
      The application uses CMP/PostGres.

      Thanks very much !!!

        • 1. Re: Custom MBean Dependency

          Add a dependency on the Deployment Scanner.
          Once that is started, the initial state is loaded.

          You might want to look at the change notes
          click on tracker at www.sf.net/projects/jboss

          There is a similar service just been added to jboss4.

          Regards,
          Adrian

          • 2. Re: Custom MBean Dependency
            nvenk

            Hi:
            Thanks for your response. I did try it but it throws the following exception.
            However, I did try to declare the MBean in the jboss-service.xml at the very end WITHOUT any tag and it seemed to start fine. But I would still like to know if this is the recommended approach or is there another fail-safe approach ? BTW, I am using JBoss 3.0.4.

            Thanks,
            -Nandak
            -----
            MBeans waiting for other MBeans:
            [ObjectName: user:service=CMStartup
            state: CONFIGURED
            I Depend On: jboss.deployment:service=URLDeploymentScanner

            Depends On Me: ]
            13:45:40,924 ERROR [STDERR] at org.jboss.deployment.MainDeployer.checkIncomp
            leteDeployments(MainDeployer.java:1127)
            13:45:40,924 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(Main
            Deployer.java:588)
            13:45:40,924 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(Main
            Deployer.java:569)
            13:45:40,924 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(
            Native Method)
            13:45:40,924 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(N
            ativeMethodAccessorImpl.java:39)
            13:45:40,924 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invo
            ke(DelegatingMethodAccessorImpl.java:25)
            13:45:40,924 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:3
            24)
            13:45:40,924 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatc
            her.invoke(ReflectedMBeanDispatcher.java:284)
            13:45:40,924 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MB
            eanServerImpl.java:517)
            13:45:40,924 ERROR [STDERR] at org.jboss.system.server.ServerImpl.doStart(Se
            rverImpl.java:324)
            13:45:40,924 ERROR [STDERR] at org.jboss.system.server.ServerImpl.start(Serv
            erImpl.java:221)
            13:45:40,924 ERROR [STDERR] at org.jboss.Main.boot(Main.java:148)
            13:45:40,924 ERROR [STDERR] at org.jboss.Main$1.run(Main.java:381)
            13:45:40,924 ERROR [STDERR] at java.lang.Thread.run(Thread.java:536)

            • 3. Re: Custom MBean Dependency

              I forgot about that.

              The scanner dumps undeployed mbeans when it has
              finished.

              I bet it deployed after it showed the error?

              Regards,
              Adrian