Running in domain mode, you need to also include your domain name (host) that you would like to shutdown. Seeing that you are connected to localhost on the default 9999 port, I'm assuming you are also using the default domain name of master (found in host.xml).
So, your shutdown command would look like:
/opt/jboss/bin/jboss-admin.sh --connect command=/host=master:shutdown