This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Applets and the fly likes getCodeBase() NullPointerException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Applets
Reply locked New topic

getCodeBase() NullPointerException

Korol Bloom
Ranch Hand

Joined: Jan 13, 2004
Posts: 33

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:
at java.applet.Applet.getCodeBase(Unknown Source)
at eniac.AppletStarter.openStream(
at eniac.util.EProperties.<init>(
at eniac.util.EProperties.getInstance(
at eniac.AppletStarter.init(
at Source)
at Source)
Korol Bloom
Ranch Hand

Joined: Jan 13, 2004
Posts: 33
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
I agree. Here's the link:
subject: getCodeBase() NullPointerException
It's not a secret anymore!