https://issues.jboss.org/browse/HORNETQ-1351

cherry-picked the fix for HORNETQ-1351 into 2.3 branch.