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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

getCodeBase() NullPointerException

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi,

I experience a NullPointerException inside the Applet.getCodeBase() method, when I start my applet from the filesystem. When i start the applet from the webbrowser, everything is fine. I am using firefox.

The behaviour I expected: The returned URL points to the directory, that was passed as param "codebase" to the applet from the browser.

Here is my stacktrace:
java.lang.NullPointerException
at java.applet.Applet.getCodeBase(Unknown Source)
at eniac.AppletStarter.openStream(AppletStarter.java:113)
at eniac.util.EProperties.<init>(EProperties.java:28)
at eniac.util.EProperties.getInstance(EProperties.java:41)
at eniac.AppletStarter.init(AppletStarter.java:42)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
 
Korol Bloom
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Sorry, folks. I got confused by too many singleton patterns. The instance of the Applet was an instance not created by the browser, but by a constructor-call from my code. So it had no appletstub attached...

+++ kinnla
 
    Bookmark Topic Watch Topic
  • New Topic