Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-10384

Set JVM flag to start Attach listener by default

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 22.0.4
    • Fix Version/s: 23.0.0
    • Component/s: Build / Packaging
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None

      Description

      In some cases we've seen the JVM's Attach API listener go inexplicably missing during startup. Attempting to do a status, restart, or stop operation on such a system tends to result in a message like the following:

      java.io.IOException: Connection refused
              at sun.tools.attach.LinuxVirtualMachine.connect(Native Method)
              at sun.tools.attach.LinuxVirtualMachine.<init>(LinuxVirtualMachine.java:118)
              at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
              at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:213)

      Or sometimes this one:

      Could not connect to the OpenNMS JVM (OpenNMS might not be running or could be starting up or shutting down): Failed to retrieve RMIServer stub: javax.naming.NameNotFoundException: jmxrmi 

      In environments where we've seen this behavior, adding the flag -XX:+StartAttachListener has resolved the problem at least in the short term. Assuming there's no downside, we should add this flag to ADDITIONAL_MANAGER_OPTIONS by default.

        Attachments

          Activity

            People

            • Assignee:
              jeffg Jeff Gehlbach
              Reporter:
              jeffg Jeff Gehlbach
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: