I think there is a bug with Environment.getCurrent() :
In this test (in ContextBlockSubscription.java):
public void testUnexistingScope() {
 EnvironmentFactory environmentFactory = EnvironmentFactory.parseXmlString(
 "<environment-scopes>" +
 " <application />" +
 " <block>" +
 " <object name='recorder' class='"+Recorder.class.getName()+"' init='eager'>" +
 " <subscribe context='unexistingcontext' />" +
 " </object>" +
 " </block>" +
 "</environment-scopes>"
 );
 assertNull(Environment.getCurrent());
 try {
 environmentFactory.openEnvironment();
 fail("expected exception");
 } catch (WireException e) {
 assertNull(Environment.getCurrent());
 }
 }JIT
fixed. thanks!