GeeCON Prague 2014*
The moose likes Java in General and the fly likes Null pointer Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Null pointer Exception" Watch "Null pointer Exception" New topic
Author

Null pointer Exception

Keshava murthy S
Greenhorn

Joined: Jul 20, 2006
Posts: 5
Exception in thread "main" java.lang.NullPointerException
at java.awt.Window.init(Unknown Source)
at java.awt.Window.<init>(Unknown Source)
at java.awt.Frame.<init>(Unknown Source)
at java.awt.Frame.<init>(Unknown Source)
at javax.swing.JFrame.<init>(Unknown Source)
at Mantra.awt.UBSFrame.<init>(UBSFrame.java:11)
at Mantra.PUI.PDialogUI.CMantraConsoleUI.<init> (CMantraConsoleUI.java:15
)
at Mantra.PGeneral.CGlobal.initEnvironment(CGlobal.java:2614)
at Mantra.PMain.tcFrame.<init>(tcFrame.java:39)
at Mantra.PMain.tcFrame.main(tcFrame.java:25)

Actually i am getting this stack trace while i am trying to launch a product so please any solutions.

Thanks in advance
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
Do you know how to use a debugger? It's an essential skill. Trap this exception in the debugger and look at the variables to see what's going on.

The first stack frame that's not in your application-specific code is javax.swing.JFrame.<init>. The constructor of a JFrame is being called. I am guessing that your code is passing a null as one of the parameters, when the API does not allow it.

No-one can help you debug your application-specific code, unless you post it. But don't post screeds of code. You need to make the effort to identify where the problem might be happening, and post just the few pertinent lines of code.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

In another thread (which I've deleted, since it was similar to this one) you added the details that this happens with ANY Swing application, and only with JDK 1.5, not with 1.4, and that you're using Windows 98.

Windows 98 second edition is a supported configuration for JDK 1.5; if you're not using the fully patched 2E, though, I'd make sure to apply all the patches you can and try again. Otherwise, one likely conclusion is that your JDK 1.5 install is simply broken, and ought to be wiped and redone. If this still doesn't help, then perhaps you've got some incompatible third-party software; not sure what to recommend there.


[Jess in Action][AskingGoodQuestions]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

This sounds like this AWT bug from the bug database, although it is marked "fixed". Check that page, try the workarounds, see if they help. Are you really using the release version of 1.5, or do you have an old beta version?
 
GeeCON Prague 2014
 
subject: Null pointer Exception