How to connect to remote JMX configuration in dataservices

In my application, we want to monitor performance by connecting to jmx in a12-data-services.
The default configuration for jmx in a12-data-services running on tpi cluster

- name: JAVA_OPTS
          value: >-
            -Dhibernate.cache.hazelcast.instance_name=a12-data-services-hazelcast 
            -Dcom.sun.management.jmxremote.port=9875
            -Dcom.sun.management.jmxremote.rmi.port=9875
            -Dcom.sun.management.jmxremote
            -Dcom.sun.management.jmxremote.authenticate=false
            -Dcom.sun.management.jmxremote.ssl=false
            -Dcom.sun.management.jmxremote.local.only=false
            -Djava.rmi.server.hostname=127.0.0.1
....
 ports:
        - containerPort: 9875
          name: jmx
          protocol: TCP

When I attempt to forward a port on the local machine, I encounter an error similar to this.

failed to connect to localhost:9875 inside namespace \"namespace-id\", IPv4: dial tcp4 127.0.0.1:9875: connect: connection refused IPv6 dial tcp6: address localhost: no suitable address found "

Has anyone else encountered this problem or have any idea what could be causing it?

According to How to Build Java Apps with Paketo Buildpacks - Paketo Buildpacks the name of the environment variable to use is not JAVA_OPTS but JAVA_TOOL_OPTIONS. When changing the environment accordingly the jmx connection works as expected.

I have created Bug A12-17124 to address the issue.