So related to:
There simply is no consistent notion of stopping a deployment as opposed to undeploying it. I have fixed the module type issue, and what happens now in the org.jboss.test.deployment.DeploymentTestCase.testListStartStopModules is that stopping the ear results in undeployment of the ejb and war modules, but does nothing to the ear deployment. The undeployment of the war/ejb do not result in removal of the jsr77 mbeans because the notification listener does not expect that a stop event equates to undeployment.
Attempting to start the ear after this therefore results in error regarding duplicate jsr77 mbeans, and there is also a problem starting the war as the deployer cannot go from the stop state to the start state:
Caused by: javax.security.jacc.PolicyContextException: Operation not allowed at org.jboss.security.jacc.JBossPolicyConfiguration.validateState(JBossP olicyConfiguration.java:201) at org.jboss.security.jacc.JBossPolicyConfiguration.linkConfiguration(JB ossPolicyConfiguration.java:160) at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:347) ... 96 more Caused by: org.jboss.util.state.IllegalTransitionException: No transition for ac tion: linkConfiguration from state:inService at org.jboss.util.state.StateMachine.nextState(StateMachine.java:111) at org.jboss.security.jacc.JBossPolicyConfiguration.validateState(JBossP olicyConfiguration.java:196)