File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Null pointer Exception

Keshava murthy S

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>(
at Mantra.PUI.PDialogUI.CMantraConsoleUI.<init> (
at Mantra.PGeneral.CGlobal.initEnvironment(
at Mantra.PMain.tcFrame.<init>(
at Mantra.PMain.tcFrame.main(

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

Joined: Jul 08, 2003
Posts: 24199

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

Joined: Jul 08, 2003
Posts: 24199

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?
I agree. Here's the link:
subject: Null pointer Exception
jQuery in Action, 3rd edition