7 Replies Latest reply on Jan 9, 2014 4:01 PM by allenjames

    Enabling SNMP in JBoss 7

    shaun.kalley

      I've enabled SNMP monitoring using the  com.sun.management.snmp.interface, com.sun.management.snmp.port, and com.sun.management.snmp.acl.file system properties.  However on startup I get the following error:

       

      Exception in thread "main" java.lang.ExceptionInInitializerError

                at org.jboss.as.server.Main.main(Main.java:73)

                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:597)

                at org.jboss.modules.Module.run(Module.java:260)

                at org.jboss.modules.Main.main(Main.java:291)

      Caused by: java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager")

                at org.jboss.logmanager.Logger.getLogger(Logger.java:60)

                at org.jboss.logmanager.log4j.BridgeRepositorySelector.<clinit>(BridgeRepositorySelector.java:42)

                ... 7 more

       

      Can anyone direct me to the solution to this, please?

       

      Thanks,

      Shaun

        • 1. Re: Enabling SNMP in JBoss 7
          matt.trisoline

          I am also having this same issue. Is it not possible to use the native Java SNMP with Jboss7?

           

          Starting jboss-as: WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager

          Exception in thread "main" java.lang.ExceptionInInitializerError

          at org.jboss.as.server.Main.main(Main.java:73)

          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:597)

          at org.jboss.modules.Module.run(Module.java:260)

          at org.jboss.modules.Main.main(Main.java:291)

          Caused by: java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager")

          at org.jboss.logmanager.Logger.getLogger(Logger.java:60)

          at org.jboss.logmanager.log4j.BridgeRepositorySelector.<clinit>(BridgeRepositorySelector.java:42)

          ... 7 more

           

          Are there any workarounds for this or is there a different native way to retrieve data through SNMP?

          • 2. Re: Enabling SNMP in JBoss 7
            dmlloyd

            This should be possible to do, just not in the usual way.  I'll look around a little bit.

            • 3. Re: Enabling SNMP in JBoss 7
              dmlloyd

              The only way I see this working is by manually bootstrapping the SNMP adapter class after the container starts instead of using the agent.  You should be able to do this from within a deployment for example, by calling sun.management.snmp.AdaptorBootstrap#initialize() directly.  If you use a POJO deployment you can probably do it with just an XML descriptor.

              • 4. Re: Enabling SNMP in JBoss 7
                scarlson

                Stumbled on this and it worked for me.  I did have to add <path name="sun/management/snmp"/> to modules/sun/jdk/main/module.xml .

                 

                Thanks


                • 5. Re: Enabling SNMP in JBoss 7
                  allenjames

                  This solution work for me as well, but i also had to include <path name="sun/management"/> in addition to the <path name="sun/management/snmp"/> to modules/sun/jdk/main/module.xml

                  • 6. Re: Enabling SNMP in JBoss 7
                    bha007

                    Hi,

                    Can you explain a little more how you got it running? Did you write a class for that?

                    I did the setup part but I miss the activation...

                    Thanks

                    • 7. Re: Enabling SNMP in JBoss 7
                      allenjames

                      Hi Bruno,

                       

                      Yes, I wrote a class which invokes the AdaptorBootstrap.initialize() method that David Lloyd mentioned in his post.  We packed that class in an ear file which is deployed upon start-up of the JBoss server.

                       

                      Hope this helps.