Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Erratic Null Pointer Exception (App terminates early when Run, but completes successfully when Debug)
Erratic Null Pointer Exception [message #1814023] Mon, 02 September 2019 02:56
Dick Wissbaum is currently offline Dick WissbaumFriend
Messages: 1
Registered: September 2019
Junior Member
I have an elusive Null Pointer bug.
When I run my application, it terminates early with a Null Pointer Exception. It reports the source line where the error occurs and the trace back to main().

When I start the application using Debug, the debugger halts execution on the source line and at the same point where the Null Pointer Exception occurs. The Debug window reports that thread [main] execution has been suspended because of a Null Pointer Exception.

So far, I understand all of this. BUT when I set a breakpoint in the program before the exception occurs, the app completes successfully. This happens whether I step through one line at a time, or simply press resume.

Null pointer errors are hard enough to find - I have no hope of tracking it down without the debugger.

This is a Swing application, and the Debug window shows an AWT Event Queue thread running... Is it possible that I am trying to refer to a control in a Swing window before it has been instantiated? What is the significance of the code snippet "SwingUtilities.invokeLater(new Runnable()" I understand that this is the code that places the controls in my window. Do I need to do something explicit to insure that the window building is complete before I start to access the controls?
Previous Topic:eclipse installer problem
Next Topic:OOMPH launching Eclipse via Commandline
Goto Forum:
  


Current Time: Sun Sep 22 20:20:23 GMT 2019

Powered by FUDForum. Page generated in 0.03008 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top