To be able to step through the code, I had to follow a few steps:
1 - Increase the logging in GlassFish. This is optional, but it gave me an idea of where to start looking for the issue.
2 - Download the GlassFish source code. This is not an issue for an open source app server. If you don't have access to the source of your particular proprietary app server, IntelliJ IDEA will still allow you to step through it, and will try to decompile the code, with various level of sucess.
3 - Add the jar that contains the actual compiled byte code. I found two ways of doing this for Maven based project, one using the provided scope, and another way using the system scope. This step is critical, and at least for me counter intuitive.
Add the jar to your pom.xml using the provided scope:
This is the easiest solution, but you might not be able to find the required jar in any maven repo. If you don't find the right jar, but find any jar that has the class, you can use. For this to work you will have to attach the right source code, as downloaded in step #2. Otherwise, IntelliJ will decompile the class and give you a nonsensical java file that does not match what you are running.
If you don't have source code, I recommend this approach. This will give you a lot of information, even if you lack access to the source code.