I am trying hard to find the cause of a weird JSF error. To do this, I try to debug the source code inside javaee-web-api module where a NullPointerException
is thrown during JSF rendering. But I am stuck because the debugger does not show me the source code of that location.
There is a discussion thread that says that javaee-web-api is stripped (no bytecode for methods) and meant to be used only for compilation.
What does this mean? Can someone explain it in more detail? I want to understand why I cannot debug the location where that NullPointerException is thrown. I think this is related to the fact that these JARs are stripped.
Byte code is the intermediate code compiled and executed by a virtual machine (VM). Byte code can be used unchanged on any platform on which the VM operates.
byte codes are intermediate representation of your code which is generated by Java compiler. this can be understood only by Java compiler and can't be execute anywhere. where as jar is generated in order to deploy the written code. jar contains class files and its used for deploying the application.
Byte Code can be defined as an intermediate code generated by the compiler after the compilation of source code(JAVA Program). This intermediate code makes Java a platform-independent language.
The JIT compiler is enabled by default, and is activated when a Java method is called. The JIT compiler compiles the bytecodes of that method into native machine code, compiling it "just in time" to run. When a method has been compiled, the JVM calls the compiled code of that method directly instead of interpreting it.
Normally, the class files in a jar file will contain information on the line numbers relating to the code in the class - this is called the debug information. A stripped jar simply does not have this information.
You are correct in assuming this is the problem. The stack trace you see won't contain any line numbers relating to the code in the stripped jar. Since the jar is provided by a third-party, there's nothing you can do to get that information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With