I was wrong, not the lookup is failing
The error appears on:
final Context context = new InitialContext(jndiProperties);
It's not reaching the the lookup. I will try to trim the application to a simple ear with one EJB and the embedded login module to check if problem persists.