I am encountering strange behavior - runtime exceptions like IllegalArgumentException etc. and stack trace doesn't contain any reference to my own code. It is only refering to libraries I have used.
But it is absolutely doubtless that source of exception is my application. Is is very difficult to find out where it is originating because it is uncontrolled exceptions inherited from RuntimeException.
Please, is there any way how to see really full stack trace where will be referred line in my application?
Thank you for all replies but it's little misunderstanding. I am experiing RuntimeException exceptions (uncontrolled exceptions that don't have to be catched explicitly).
I can see stack trace but there isn't information about where in my own code (not libraries or environment) exceptions was thrown. Eg. this only what I see (a lot of lines but no with my own code - it's NetBeans Platform app):
java.lang.NullPointerException at org.openide.windows.OpenComponentAction.actionPerformed(OpenComponentAction.java:89)
[catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
It other words it means that I have some code causing NullPointerException but I don't know where (no mention about my files in exception stack trace).
I did a tons of changes from last commit. It would be nice to know where is the problem causing RuntimeException. Otherwise I will have to revert changes and start from the last known working revision :-( And I will hope that I will not do same bug once more.
Our app is containg of hundreds of files. From last commit I changes about 200-300 lines of code. Because of these changes something is going wrong - and I don't know why (because it's not in stack trace).
Please do you have any experience with these mystic RuntimeExceptions? With no information where is the true origin?
Paul Clapham wrote:Oh, it's Swing. That kind of thing usually happens when you have Swing code which isn't running on the Swing event thread. Read the Concurrency in Swing tutorial to see what that's about.
Yes, yes it's Swing. But how it is possible that exception stack trace doesn't contain information about origin? How it is theoretically possible? Can I somehow to simulate or hide the exception origin programmatically?
The exception DOES contain information about its origin. However that origin isn't in your code, it's in the Swing code which processes GUI events. And errors in that code generally occur when something in another thread (e.g. your code) has changed some Swing data in a non-thread-safe way. Don't spend your time trying to hide the problem, fix it. Read the tutorial.