If you experience the error message “Access denied! Invalid access level for requested MBeanServer operation”, this may lead to a problem of lack of enough permission when you invoke MBean method.
To solve it, edit jmxremote.access file. Find the user you connect to the JMX server and set the permission to readwrite.
userA readwriteFor further information, see the documentation section here.