wood burning stoves*
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
JavaRanch » Java Forums » Java » Applets
Reply locked New topic
Author

getCodeBase() NullPointerException

Korol Bloom
Ranch Hand

Joined: Jan 13, 2004
Posts: 33
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

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
 
wood burning stoves
 
subject: getCodeBase() NullPointerException
 
Similar Threads
file reading in applet
Access denied error for midi file in same directory as applet!
Facing problem while running Java Applets
Access HTTPS url in Applet
Applet can't find jar file