Actually, there is one more workaround - specify a servlet context param of name WELD_CONTEXT_ID_KEY and value equal to org.jboss.weld.environment.se.WeldContainer.getId().