AS 5.2.0 is based on Carbon 4.2.0 while ESB 4.7.0 is based on Carbon 4.1.0. When you are mixing features of different products they should have the same Carbon core version.
So you should try using AS 5.1.0 with ESB 4.7.0.
UPDATE:
Unfortunately it seems like there are some compatibility issues in features of 4.1 patch releases which introduces these problem for AS 5.1.0 with ESB 4.7.0. You better try with Carbon 4.2 based products. AS 5.2.0 and ESB 4.8.0 (to be released this week). Also Carbon 4.2 based BPS new version will be released in December.