I'm trying the create a some deployment scripts for our application on jboss using the DMR and ModellControllerClient, the script should be idempotent so can be run any number of times to put server into a known state.
1) connect and set admin mode
2) wait for state to change to admin
3) Remove all children under datasources/messaging/resource adapters (is there an easier way to get a clean config?)
4) Create new items as created
The process works for things such as datasources but i am trying to create a PooledConnectionFactory for hornet and when i remove then re-add the PoolConnectionFactory successfuly after reloading i get 'org.jboss.msc.service.DuplicateServiceException: Service jboss.naming.context'. If i kill the process the start with the exact config it works as expected. It appears like when i remove the PooledConnectionFactory it not cleanly removing from JNDI and fails when it trys to register with the same name. Note other resources such as datasources work fine and re-register and re-create. Do i need to undeploy any running apps and redeploy after making admin changes?