Run Java Applet defeats file save.

Using the Java SDK with TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
User avatar
Nicholas Jordan
Posts: 124
Joined: Mon Dec 20, 2004 12:33 am
Location: Central Texas ISO Latin-1
Contact:

Run Java Applet defeats file save.

Post by Nicholas Jordan »

This morning I decided to write a Welcome applet, which will be needed as a user-authentication shell for the application.

First thing I did was change WWW root in Configure Preferences to D:\ - which is where the class files for the applet are, then set that to another folder this morning. I will build and run a Java Server from JKD-5 to see if that has any effect.

It was a very simple applet, overriding one or two calls and calling public java.net.URL url_ = super.getDocumentBase(); in the variable initializations, which blew out to an exception. :shock:

At that point, and from then on - TextPad would not, could not save the file or something: (source).txt appeared in the fileSaveAs dialog box.

I launched a process viewer, there were no unexpected instances. 8)

Went down to a cold restart - problem persisted; machine responding properly, no bubbles in the screen refresh (**Always a good test under winnies low-carb kernel**), thought about running a registry monitor to look for who/where, but such efforts waste time on no-productivity.

Suggestions where to look ? Here is stack trace and code.

Code: Select all

java.lang.NullPointerException:
        at java.applet.Applet.getDocumentBase(Applet.java:90)
        at WelcomeApplet.<init>(WelcomeApplet.java:20)
        at java.lang.Class.newInstance0(Native Method)
        at java.lang.Class.newInstance(Class.java:239)
        at sun.applet.AppletPanel.createApplet(AppletPanel.java:532)
        at sun.applet.AppletPanel.runLoader(AppletPanel.java:468)
        at sun.applet.AppletPanel.run(Compiled Code)
        at java.lang.Thread.run(Thread.java:479)
Exception occurred during event dispatching:
java.lang.NullPointerException
        at sun.applet.AppletViewer.appletInfo(Compiled Code)
        at sun.applet.AppletViewer.processUserAction(AppletViewer.java:743)
        at sun.applet.AppletViewer$UserActionListener.actionPerformed(AppletViewer.java:137)
        at java.awt.MenuItem.processActionEvent(MenuItem.java:500)
        at java.awt.MenuItem.processEvent(MenuItem.java:464)
        at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:269)
        at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:259)
        at java.awt.EventQueue.dispatchEvent(Compiled Code)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:68)
TextPad 4.7.3
Process is hung, applet window shows through in the client area.
Process terminated sucessfully using X button on cli window.
File save as dialog box brings up modal "Error Accessing 'D:\Welcome Applet.java'"
Click OK brings up 2nd dialog "Failed to create backup file for D:\Welcome Applet.java"
Click OK brings disk activity.
Configure shows file is not read-only, same in Windows Explorer - 4.72.3110.1.

Code: Select all

public class WelcomeApplet extends  java.applet.Applet
{
    public java.net.URL url_ = super.getDocumentBase();
    public java.lang.String descriptor_ = url_.toString();
    public java.lang.String GREETING  = null;
    public java.lang.String NEIGHBOUR = null;
    public java.lang.String MARMALADE = null;
    public void init()
    {
        java.applet.AppletContext ac_ =  super.getAppletContext();
        this.GREETING   = super.getParameter("greeting");
        this.NEIGHBOUR = super.getParameter("neighbour");
        this.MARMALADE = super.getParameter("marmalade");
        return;
    }
    public void start()
    {
        super.showStatus(descriptor_);
        return;
    }
...
}
Proxies tab in Java Control Panel has use browser settings checked.
D:\>java -version
java version "1.4.1_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_07-b02)
Java HotSpot(TM) Client VM (build 1.4.1_07-b02, mixed mode)
Sony CPD 100ES on ATI RADEON 9600 SE
msvcp50.dll - corrupted per M$ tool System File Checker

Oh, yes, I tried it in a try-catch - same behaviour.
I have modules loaded and heapwalks for those modules.
e.g.

Code: Select all

KERNEL32.txt - 1  76210000  126976  C:\WINDOWS\SYSTEM\WLDAP32.DLL
MSGSRV32.txt - et cetera
TASKMON.txt
TEXTPAD.txt
MPREXE.txt
WMIEXE.txt
Problem may lie in the area of running Microsoft Internet Explorer - 5.00.2614.3500
Microsoft(R) Windows (R) 2000 Operating System over Win98 consumer kernel.
Also, there are *many* games and miscellaneous utility software from the previous user, most of which I attempted to remove.
Post Reply