Jboss container compatibility
(cherry picked from commit 85aa12d)