This is the vm crashing and it has nothing to do with jboss. Its a bug in the vm.
I found the answer to my problem.
In my database a role was attributed to the principal. This role is CallerPrincipal. And when this role is attributed to the principal, when you call the GetName from the UserPrincipal, it returns the RoleName and not the UserName.
So no it is working like this. But could you explain me why this behaviour ?
Thanks in advance,
That is a known bug in 3.2.6 that has been fixed for 3.2.7.