• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why does getCodeBase return null?

 
Baijun Jiang
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I have an applet invoked by a jsp page.

<APPLET height=500 width=900
code="applet/trend/trendchart">
</APPLET>

I got this this error:

java.lang.NullPointerException
at java.applet.Applet.getCodeBase(Unknown Source)
at applet.trend.trendchart.getServletConnection(trendchart.java:212)
...

in what kind of situation getCodeBase() can return a null value?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The javadocs don't mention that it could or should ever return null.

Are you running this on a web server, via appletviewer or are you opening a local HTML file?
 
Baijun Jiang
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running it on a tomcat server.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Loooking at it again I notice that it doesn't actually return null, it has an internal NPE. I'm surprised it works at all with the "applet/trend/trendchart"; that should contain dots, not slashes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic