I don't exactly know about CDI extensions and application packaging, but what's the expected behaviour for nested deployments? More specifically, this code will end up registering the JMSCDIExtension twice for an .ear containing a .war (one for the .ear and once for the .war). Is that fine?