Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NullPointerException on View-JavaConsole in IE

Status
Not open for further replies.

nattugan

Programmer
Aug 9, 2001
5
GB
Hi
I have a problem with my applet which uses JDBC to retrieve the values from the oracle database. I try to create a chart with the data from the db. I find that applet works fine when i run with the appletviewer but it does not work properly when i see it on the browser. So what ever graphics shapes(rectangle) that i draw based on the values from the db does not appear on the browser. I learned that only signed applets can access and made a signed applet. I do not know how to proceed further. I have given the &quot;codebase&quot; and &quot;archive&quot; values properly in the <applet> tag.
I get the following error :

Cannot get connection
java.lang.NullPointerException
at Chart1.paint (Chart1.java:51)
at com/ms/awt/WComponentPeer.doClearAndPaint (WComponentPeer.java)
at com/ms/awt/WComponentPeer.paintNode (WComponentPeer.java)
at com/ms/ui/windowmanager/PaintRequest.run (PaintRequest.java)
at com/ms/ui/windowmanager/RunnableMessage.run (RunnableMessage.java)
at com/ms/awt/WSystemQueue.getMessage (WSystemQueue.java)
at com/ms/awt/WEventQueue.getNextEvent (WEventQueue.java)
at java/awt/EventDispatchThread.run (EventDispatchThread.java)

&quot;Cannot get connection &quot; is the msg that i give in the try catch block for SQLException...

Thanks in advance
nat
 
You say that using appletviewer, your programmes executes with no problems, yet using your browser, it does not ... This leads me to suspect that one of the following may be the case :
- your browser default settings are preventing access to system resources (like files, db's etc)

- the way that you have embedded your call to the applet class is incorrect, or any other classes that your applet uses are not include

- your database is not started

To narrow down the cause, try the following (not necessarily in that order!) :
- make sure your db is started

- check your browser settings and applet security.policy

- edit the applet code, commenting out any calls to file system or db connection - so that you can see if it is a browser problem is at fault. If your applet GUI appears - then you know that it has something to do with the security aspect of applet-db interaction. If it doesn't appear, then you can probably suspect the way you are calling the applet in the HTML, or some classes arn't available...

Post back with results (and the HTML used to call applet) !

Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top