Byteman's code analysis is doen on a single pass through method byteocde. So, it relies on propagating constraints through the bytecode as instructions are visited. This assumes that control flow into each basic block primarily involves forward flow through i.e. every basic block will always be entered via a forward jump or exception transfer before it can be re-entered via a backward jump. If this assumption is met then blocks can be visited by the analyzer before all their constraints can be posted.
Unfortunately, the ECJ compiler appears to compile loops with a forward jump over the loop body to the loop test code followed by a backward conditional jump to the start of the loop body. This means Byteman cannot always propagate monitorenter constraints to the loop start during bytecode analysis and hecne that it can lose track of the enter constraint when it encounters a subsequent monitorexit. Result = null pointer exception for the (missing in action) reference to the monitorenter.
This will be a real pig to fix since it is deep in the guts of Byteman and the one-pass assumption is key to doing injection relatively eficiently.