TOMEE-1415

Testcase which demonstrates the issue and a fix for it.