Monitor Archive on remote host or docker container by VisualVM - dcm4che/dcm4chee-arc-light GitHub Wiki

  1. Download VisualVM and unzip the downloaded archive.

  2. Ensure that the Wildfly Administration Console is not protected with Keycloak. If running a secured version of the archive docker image, specify Environment Variable WILDFLY_ADMIN_OIDC=false. If specified in docker-compose.yml, you have to quote the value. E.g.:

    arc:
     image: dcm4che/dcm4chee-arc-psql:5.25.1-secure
     environment:
       WILDFLY_CHOWN: /opt/wildfly/standalone /storage
       WILDFLY_WAIT_FOR: ldap:389 db:5432
       WILDFLY_ADMIN_OIDC: "false"
  3. Ensure that an user for accessing the Wildfly Administration Console is created. If running an archive docker image, you may specify a username and password by Environment Variables WILDFLY_ADMIN_USER(_FILE) and WILDFLY_ADMIN_PASSWORD(_FILE) and ensure to purge mapped out /opt/wildfly/standalone directory - at least the sub-directories configuration and deployments - initalized on previous container starts. Or you may manually invoke add-user.sh in the running container, e.g.:

    $ docker-compose exec arc add-user.sh
    
    What type of user do you wish to add? 
     a) Management User (mgmt-users.properties) 
     b) Application User (application-users.properties)
    (a): 
    
    Enter the details of the new user to add.
    Using realm 'ManagementRealm' as discovered from the existing property files.
    Username : wildfly-adminmana
    Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
    - The password should be different from the username
    - The password should not be one of the following restricted values {root, admin, administrator}
    - The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
    Password : 
    Re-enter Password : 
    What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[  ]: 
    About to add user 'wildfly-admin' for realm 'ManagementRealm'
    Is this correct yes/no? yes
    Added user 'wildfly-admin' to file '/opt/wildfly/standalone/configuration/mgmt-users.properties'
    Added user 'wildfly-admin' to file '/opt/wildfly/domain/configuration/mgmt-users.properties'
    Added user 'wildfly-admin' with groups  to file '/opt/wildfly/standalone/configuration/mgmt-groups.properties'
    Added user 'wildfly-admin' with groups  to file '/opt/wildfly/domain/configuration/mgmt-groups.properties'
    Is this new user going to be used for one AS process to connect to another AS process? 
    e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server Jakarta Enterprise Beans calls.
    yes/no? no
    
  4. Ensure that the Wildfly HTTP Management Interface is not protected with SSL. You may disable the SSL on the HTTP Management Interface in the Wildfly Administration Console, navigating to the HTTP Management Interface and clicking on the Disable SSL button:

  5. Get $WILDFLY_HOME/bin/client/jboss-cli-client.jar from the same Wildfly version as the archive. You may extract it from the archive docker image by:

    $ docker run --rm -v $(pwd):/dest dcm4che/dcm4chee-arc-psql:VERSION \
      cp /opt/wildfly/bin/client/jboss-cli-client.jar /dest
    
  6. Launch VisualVM, appending its classpath with jboss-cli-client.jar and specify the JMX connection to Wildfly's HTTP Management Interface of the running archive. E.g.:

    $ ~/visualvm_21/bin/visualvm --cp:a jboss-cli-client.jar --openjmx service:jmx:remote+http://test-ng:9990
    

    You will get prompted for name and password of previous configured user for accessing the Wildfly Administration Console:

    After Reload of the jboss-modules.jar tab, you can start monitoring the Java VM of the archive application:

⚠️ **GitHub.com Fallback** ⚠️