code adaptations to work in java8 and tomee1.7