Linux – GlassFish will not start when SNMP is enabled

glassfishjavalinuxsnmp

I have a GlassFish v3 app server running on 64-bit Debian Lenny. Everything is running fine, except I would like to monitor GF's JVM instance with SNMP. However, every time I try to enable it by adding the following <jvm-options> in domain.xml:

-Dcom.sun.management.snmp.port=10161
-Dcom.sun.management.snmp.acl.file=/path/to/snmp.acl
-Dcom.sun.management.snmp.interface=127.0.0.1

GlassFish refuses to start:

$ asadmin start-domain
Waiting for DAS to start .Error starting domain: default.
The server exited prematurely with exit code 1.
Command start-domain failed.
$

There is also nothing illuminating (well, really nothing at all) in jvm.log or server.log. The snmp.acl file contains:

acl = {
  {
    communities = public
    access = read-only
    managers = localhost
  }
}

and is chmod 600 (I know this is not the problem because it will actually fail with an error about the permissions if it is set to anything other than 600)

$ java -version
java version "1.6.0_0"
OpenJDK  Runtime Environment (build 1.6.0_0-b11)
OpenJDK 64-Bit Server VM (build 1.6.0_0-b11, mixed mode)

Best Answer

-Dcom.sun.management options are Sun extension to JVM. It is not a part of the JVM spec, and therefore they are not available in OpenJDK !

Anyway, even using a Sun JVM, i got fatal error when deploying applications on my running cluster. Maybe it is intentional by Sun because they sold a extension for SNMP monitoring.