This question has many views, so I will answer it. Inspired by @mik's answer, I realized that to change the value of some JNDI key, for example, java:jboss/api/key
in newApiKey, run the JBoss CLI and execute:
connect /subsystem=naming/binding=java\:jboss\/api\/key/:write-attribute(name=value,value=newApiKey)
The change will be immediately visible on the server, and also saved (updated) in standalone.xml
so that it does not get lost after the server reboots.
source share