7 Replies Latest reply on Aug 21, 2003 4:30 AM by adrian.brock

    Singleton Mbean

    scttu

      Can i create singletong mbean? I tried to create a mbean with a static variable. The variable doesn't seems static. Can someone show me how to create a static mbean?

      Thanks

        • 1. Re: Singleton Mbean

          MBeans are singletons unless you are playing with the
          classloaders (e.g. web deployments)
          More info please.

          Regards,
          Adrian

          • 2. Re: Singleton Mbean
            scttu

            Adrian,

            I am newbie to JMX, therefore, i not sure whether i do it incorrectly. I attach the mbean related files for your reference.

            I actually create a .sar directory under the deploy folder and there is META-INF folder with jboss-service.xml descriptor.

            Thanks






            • 3. Re: Singleton Mbean

              You are not using a singleton. You are passing an int
              over RMI (you specify a provider url).
              I bet it works if you just use new InitialContext();

              Regards;
              Adrian

              • 4. Re: Singleton Mbean
                scttu

                Adrian,

                If i just use InitialContext without the provider url. it will throw error and requesting the security.properties and ejb.properties file. what should i do?

                Thanks

                Regards,
                Stephen

                • 5. Re: Singleton Mbean

                  Are you trying to access it remotely?

                  You should use a JMX connector in that case.

                  Regards,
                  Adrian

                  • 6. Re: Singleton Mbean
                    scttu


                    Yes, i try to access the mbean remotely from a Swing java application.

                    You mention about using JMX connector, where can i find example for this?

                    thanks

                    • 7. Re: Singleton Mbean

                      There are lots of discussions about it in the JMX forum.
                      You might have to go back a few months for some
                      full examples.

                      The RMI adapter is used jboss testsuite to deploy/undeploy
                      applications and other config operations.

                      It is also mentioned in the 2.4 free docs, but some
                      of the classes have moved packages.

                      Regards,
                      Adrian