# I/O problems.

Hien Cao (hcao@eecs.uic.edu)
Tue, 18 May 1999 13:46:02 -0500 (CDT)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Mauro Migliardi: "Invoker ID based security"
- Previous message: Jan Luehe: "Re: JCE documentation"

    Date: Tue, 18 May 1999 13:46:02 -0500 (CDT)

    From: Hien Cao <hcao@eecs.uic.edu>

    To: java-security@java.sun.com

    Subject: I/O problems.

---559023410-851401618-927053162=:7122
Content-Type: TEXT/PLAIN; charset="US-ASCII"
X-Sun-Content-Length: 2020

Hi
My name is Hien Cao studen at UIC. My school, they don't teach Java but I
realy like to program in java then I learn it myself. that why I have no
one to ask for my problem except you.
please help me with this problem, I couldn't find the solution to solve
it. The problem is the files that I attach with this message, there is no
error when I compiled it but when I run with "Appletviewer" it always give
me the message like this:
C:\javascript>appletviewer file.html
sun.applet.AppletSecurityException: checkwrite
at sun.applet.AppletSecurity.checkWrite(AppletSecurity.java:432)
at java.io.FileOutputStream.<init>(FileOutputStream.java:63)
at CreateSequentialFile.<init>(CreateSequentialFile.java:21)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:462)

and if I user RandomeAccessFile it gave me this:
C:\javascript>appletviewer makefile.html
Exception occurred during event dispatching:
sun.applet.AppletSecurityException: checkwrite
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.SecurityException.<init>(Compiled Code)
at sun.applet.AppletSecurityException.<init>(Compiled Code)
at sun.applet.AppletSecurityException.<init>(Compiled Code)
at sun.applet.AppletSecurity.checkWrite(Compiled Code)
at java.io.FileOutputStream.<init>(FileOutputStream.java:63)
at MakeFile.addRecord(MakeFile.java:66)
at MakeFile.actionPerformed(MakeFile.java:102)
at java.awt.Button.processActionEvent(Button.java:257)
at java.awt.Button.processEvent(Button.java:230)
at java.awt.Component.dispatchEventImpl(Compiled Code)
at java.awt.EventDispatchThread.run(Compiled Code)
with another file that I don't attach it here.

however, I just see the blank window pop up and Applet not initialized at
the status bar of Applet. I used two version of JDK, they are jdk1.1.5
and jdk1.1.6 and the result is the same thing. Please help me with this
problem. Thank you very much.
truly
Hien

---559023410-851401618-927053162=:7122
Content-Type: TEXT/PLAIN; charset="US-ASCII"; name="CreateSequentialFile.java"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.3.96.990518134602.7122B@bert.eecs.uic.edu>
X-Sun-Content-Length: 3708

aW1wb3J0IGphdmEuYXd0Lio7DQ0KaW1wb3J0IGphdmEuYXd0LmV2ZW50Lio7
DQ0KaW1wb3J0IGphdmEuaW8uKjsNDQoNDQoNDQpwdWJsaWMgY2xhc3MgQ3Jl
YXRlU2VxdWVudGlhbEZpbGUgZXh0ZW5kcyBGcmFtZSAgaW1wbGVtZW50cyBB
Y3Rpb25MaXN0ZW5lcg0NCnsNDQoNDQogIHByaXZhdGUgVGV4dEZpZWxkIGFj
Y291bnRGaWVsZCwgZmlyc3ROYW1lRmllbGQsIGxhc3ROYW1lRmllbGQsDQ0K
CQkgICAgYmFsYW5jZUZpZWxkOw0NCiAgcHJpdmF0ZSBCdXR0b24gZW50ZXIs
IGRvbmU7DQ0KDQ0KICBwcml2YXRlIERhdGFPdXRwdXRTdHJlYW0gb3V0cHV0
Ow0NCg0NCiAgDQ0KICBwdWJsaWMgIENyZWF0ZVNlcXVlbnRpYWxGaWxlKCkN
DQogIHsNDQogICAgc3VwZXIgKCJjcmVhdGUgQ2xpZW10IEZpbGUiICk7DQ0K
ICAgICAgIA0NCiAgICB0cnkgew0NCiAgICAgIG91dHB1dCA9IG5ldyBEYXRh
T3V0cHV0U3RyZWFtKCBuZXcgRmlsZU91dHB1dFN0cmVhbSggImNsaWVudC5k
YXQiICkgKTsNDQogICAgfQ0NCiAgICBjYXRjaCAoIElPRXhjZXB0aW9uIGUg
KXsNDQogICAgICBsYXN0TmFtZUZpZWxkLnNldFRleHQoICJJbnZhbGlkIFVS
TCBmb3JtYXQuIik7DQ0KICAgIH0NDQoNDQogICAgc2V0U2l6ZSggMzAwLCAx
NTAgKTsNDQogICAg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JvciBkdXJpbmcgd3JpdGUgdG8gZmlsZVxuIiArIGlvLnRvU3RyaW5n
KCkgKTsNDQoJU3lzdGVtLmV4aXQoMSk7DQ0KICAgICAgfQ0NCiAgICB9DQ0K
ICB9DQ0KDQ0KICBwdWJsaWMgdm9pZCBhY3Rpb25QZXJmb3JtZWQoIEFjdGlv
bkV2ZW50IGUgKQ0NCiAgew0NCiAgICBhZGRSZWNvcmQoKTsNDQogICAgaWYg
KCBlLmdldFNvdXJjZSgpID09IGRvbmUgKXsNDQogICAgICB0cnkgew0NCiAJ
b3V0cHV0LmNsb3NlKCk7DQ0KICAgICAgfQ0NCiAgICAgIGNhdGNoIChJT0V4
Y2VwdGlvbiBpbyApew0NCglTeXN0ZW0uZXJyLnByaW50bG4oIkZpbGUgbm90
IGNsb3NlZCBwcm9wZXJseVxuIik7DQ0KICAgICAgfQ0NCiAgICAgIFN5c3Rl
bS5leGl0KCAwICk7DQ0KICAgIH0NDQogIH0NDQoNDQogIHB1YmxpYyBzdGF0
aWMgdm9pZCBtYWluKCBTdHJpbmcgYXJnc1tdICkNDQogIHsNDQogICAgbmV3
IENyZWF0ZVNlcXVlbnRpYWxGaWxlKCk7DQ0KICB9DQ0KfQ==
---559023410-851401618-927053162=:7122
Content-Type: TEXT/html; name="file.html"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.3.96.990518134602.7122C@bert.eecs.uic.edu>
X-Sun-Content-Length: 130

PGh0bWw+DQ0KPGFwcGxldCBjb2RlPSJDcmVhdGVTZXF1ZW50aWFsRmlsZS5j
bGFzcyIgd2lkdGg9Mjc1IGhlaWdodD0zMDA+DQ0KPC9hcHBsZXQ+DQ0KPC9o
dG1sPg==
---559023410-851401618-927053162=:7122--

- Next message: Mauro Migliardi: "Invoker ID based security"
- Previous message: Jan Luehe: "Re: JCE documentation"