With the following code in a class named e.g. {{JNDIBinderBean.java}} --------------------------------------------- private static final String name = "java:jboss/exported/JNDIBinderBean"; private static final String value = "JNDIBinderBean instantiated at " + new Date(); @PostConstruct public void start() { new InitialContext().rebind(name, value); } @PreDestroy public void stop() { new InitialContext().unbind(name); } --------------------------------------------- When JBoss shuts down, I get an error saying that the MSC service isn't available: --------------------------------------------- javax.naming.NamingException: JBAS011836: Could not resolve service service jboss.naming.context.java.jboss.exported.JNDIBinderBean ---------------------------------------------
The impact of this bug is small. It can be worked around by using EE injection or just using a try/catch block around unbind. Doing a fix in this area touches some sensitive code, and such changes require adequate upstream bake.
As upstream is marked as a feature: https://issues.jboss.org/browse/WFLY-3865 Workaround: try / catch in the PreDestory in case the jndi was already unbound.