NameAlreadyBoundException after a failed deploy of test ejb31/full/jcdifull
I was able to reproduce it with trunk build, too. When deploying with a non-existent cdi interceptor class, it failed as expected. Nothing's deployed so far. But the failed deploy didn't clean up jndi names already registered. After correcting the class name, the 2nd deploy still failed due to the naming conflict with the left-over names.
Since ejb deployer executed before weld deployer, all the jndi registration already happens when weld detects errors.
During the cleanup after partial deployment, ejb deployer.unload is invoked, which unbinds component env entries. See EngineRef.unload
Currently the global jndi unpublishing happens in BaseContainer.undeploy, which can be reached from EjbApplication.stop. So any failure within ejb module is handled correctly.