• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Null pointer Exception

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
We cannot change unless we survive, but we will not survive unless we change. Evolving tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic